Skip to content

Commit

Permalink
Upgrade glslang to 11.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas authored and coelckers committed Jun 22, 2022
1 parent 32d059e commit 5cc21c5
Show file tree
Hide file tree
Showing 53 changed files with 5,729 additions and 4,726 deletions.
9 changes: 7 additions & 2 deletions libraries/glslang/glslang/Include/BaseTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ enum TBuiltInVariable {
EbvObjectRayDirection,
EbvRayTmin,
EbvRayTmax,
EbvCullMask,
EbvHitT,
EbvHitKind,
EbvObjectToWorld,
Expand All @@ -274,6 +275,8 @@ enum TBuiltInVariable {
// barycentrics
EbvBaryCoordNV,
EbvBaryCoordNoPerspNV,
EbvBaryCoordEXT,
EbvBaryCoordNoPerspEXT,
// mesh shaders
EbvTaskCountNV,
EbvPrimitiveCountNV,
Expand Down Expand Up @@ -478,8 +481,10 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
case EbvWorldToObject: return "WorldToObjectNV";
case EbvCurrentRayTimeNV: return "CurrentRayTimeNV";

case EbvBaryCoordNV: return "BaryCoordNV";
case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
case EbvBaryCoordEXT:
case EbvBaryCoordNV: return "BaryCoordKHR";
case EbvBaryCoordNoPerspEXT:
case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspKHR";

case EbvTaskCountNV: return "TaskCountNV";
case EbvPrimitiveCountNV: return "PrimitiveCountNV";
Expand Down
37 changes: 35 additions & 2 deletions libraries/glslang/glslang/Include/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

#include <algorithm>
#include <cassert>
#ifdef _MSC_VER
#include <cfloat>
#else
#include <cmath>
#endif
#include <cstdio>
#include <cstdlib>
#include <list>
Expand All @@ -61,7 +66,7 @@ std::string to_string(const T& val) {
}
#endif

#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || MINGW_HAS_SECURE_API
#include <basetsd.h>
#ifndef snprintf
#define snprintf sprintf_s
Expand Down Expand Up @@ -213,7 +218,7 @@ template <class T> T Max(const T a, const T b) { return a > b ? a : b; }
//
// Create a TString object from an integer.
//
#if defined _MSC_VER || defined MINGW_HAS_SECURE_API
#if defined _MSC_VER || MINGW_HAS_SECURE_API
inline const TString String(const int i, const int base = 10)
{
char text[16]; // 32 bit ints are at most 10 digits in base 10
Expand Down Expand Up @@ -302,6 +307,34 @@ template <class T> int IntLog2(T n)
return result;
}

inline bool IsInfinity(double x) {
#ifdef _MSC_VER
switch (_fpclass(x)) {
case _FPCLASS_NINF:
case _FPCLASS_PINF:
return true;
default:
return false;
}
#else
return std::isinf(x);
#endif
}

inline bool IsNan(double x) {
#ifdef _MSC_VER
switch (_fpclass(x)) {
case _FPCLASS_SNAN:
case _FPCLASS_QNAN:
return true;
default:
return false;
}
#else
return std::isnan(x);
#endif
}

} // end namespace glslang

#endif // _COMMON_INCLUDED_
2 changes: 2 additions & 0 deletions libraries/glslang/glslang/Include/PoolAlloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ class pool_allocator {

TPoolAllocator& getAllocator() const { return allocator; }

pool_allocator select_on_container_copy_construction() const { return pool_allocator{}; }

protected:
pool_allocator& operator=(const pool_allocator&) { return *this; }
TPoolAllocator& allocator;
Expand Down
18 changes: 5 additions & 13 deletions libraries/glslang/glslang/Include/SpirvIntrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct TSpirvExecutionMode {
// spirv_execution_mode
TMap<int, TVector<const TIntermConstantUnion*>> modes;
// spirv_execution_mode_id
TMap<int, TVector<const TIntermConstantUnion*> > modeIds;
TMap<int, TVector<const TIntermTyped*> > modeIds;
};

// SPIR-V decorations
Expand All @@ -75,7 +75,7 @@ struct TSpirvDecorate {
// spirv_decorate
TMap<int, TVector<const TIntermConstantUnion*> > decorates;
// spirv_decorate_id
TMap<int, TVector<const TIntermConstantUnion*> > decorateIds;
TMap<int, TVector<const TIntermTyped*>> decorateIds;
// spirv_decorate_string
TMap<int, TVector<const TIntermConstantUnion*> > decorateStrings;
};
Expand All @@ -98,20 +98,12 @@ struct TSpirvInstruction {
struct TSpirvTypeParameter {
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())

TSpirvTypeParameter(const TIntermConstantUnion* arg) { isConstant = true; constant = arg; }
TSpirvTypeParameter(const TType* arg) { isConstant = false; type = arg; }
TSpirvTypeParameter(const TIntermConstantUnion* arg) { constant = arg; }

bool operator==(const TSpirvTypeParameter& rhs) const
{
return isConstant == rhs.isConstant && ((isConstant && constant == rhs.constant) || (!isConstant && type == rhs.type));
}
bool operator==(const TSpirvTypeParameter& rhs) const { return constant == rhs.constant; }
bool operator!=(const TSpirvTypeParameter& rhs) const { return !operator==(rhs); }

bool isConstant;
union {
const TIntermConstantUnion* constant;
const TType* type;
};
const TIntermConstantUnion* constant;
};

typedef TVector<TSpirvTypeParameter> TSpirvTypeParameters;
Expand Down
Loading

0 comments on commit 5cc21c5

Please sign in to comment.