Merge branch 'feature2' of https://github.com/amdrexu/glslang into amdrexu-feature2
This commit is contained in:
@@ -287,6 +287,10 @@ enum TOperator {
|
||||
EOpReadInvocation,
|
||||
EOpReadFirstInvocation,
|
||||
|
||||
EOpAnyInvocation,
|
||||
EOpAllInvocations,
|
||||
EOpAllInvocationsEqual,
|
||||
|
||||
EOpAtomicAdd,
|
||||
EOpAtomicMin,
|
||||
EOpAtomicMax,
|
||||
|
||||
@@ -1363,6 +1363,16 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan)
|
||||
"\n");
|
||||
}
|
||||
|
||||
// GL_ARB_shader_group_vote
|
||||
if (profile != EEsProfile && version >= 430) {
|
||||
commonBuiltins.append(
|
||||
"bool anyInvocationARB(bool);"
|
||||
"bool allInvocationsARB(bool);"
|
||||
"bool allInvocationsEqualARB(bool);"
|
||||
|
||||
"\n");
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// Prototypes for built-in functions seen by vertex shaders only.
|
||||
@@ -3477,6 +3487,10 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan
|
||||
BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable);
|
||||
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
|
||||
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
|
||||
|
||||
symbolTable.setFunctionExtensions("anyInvocationARB", 1, &E_GL_ARB_shader_group_vote);
|
||||
symbolTable.setFunctionExtensions("allInvocationsARB", 1, &E_GL_ARB_shader_group_vote);
|
||||
symbolTable.setFunctionExtensions("allInvocationsEqualARB", 1, &E_GL_ARB_shader_group_vote);
|
||||
}
|
||||
|
||||
// Compatibility variables, vertex only
|
||||
@@ -4065,6 +4079,10 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan
|
||||
symbolTable.relateToOperator("ballotARB", EOpBallot);
|
||||
symbolTable.relateToOperator("readInvocationARB", EOpReadInvocation);
|
||||
symbolTable.relateToOperator("readFirstInvocationARB", EOpReadFirstInvocation);
|
||||
|
||||
symbolTable.relateToOperator("anyInvocationARB", EOpAnyInvocation);
|
||||
symbolTable.relateToOperator("allInvocationsARB", EOpAllInvocations);
|
||||
symbolTable.relateToOperator("allInvocationsEqualARB", EOpAllInvocationsEqual);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,6 +171,7 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_ARB_shader_image_load_store] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_shader_atomic_counters] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_shader_draw_parameters] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_shader_group_vote] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable;
|
||||
@@ -273,6 +274,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_ARB_shader_image_load_store 1\n"
|
||||
"#define GL_ARB_shader_atomic_counters 1\n"
|
||||
"#define GL_ARB_shader_draw_parameters 1\n"
|
||||
"#define GL_ARB_shader_group_vote 1\n"
|
||||
"#define GL_ARB_derivative_control 1\n"
|
||||
"#define GL_ARB_shader_texture_image_samples 1\n"
|
||||
"#define GL_ARB_viewport_array 1\n"
|
||||
|
||||
@@ -108,6 +108,7 @@ const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attri
|
||||
const char* const E_GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store";
|
||||
const char* const E_GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters";
|
||||
const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_parameters";
|
||||
const char* const E_GL_ARB_shader_group_vote = "GL_ARB_shader_group_vote";
|
||||
const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control";
|
||||
const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples";
|
||||
const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array";
|
||||
|
||||
@@ -353,6 +353,9 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
|
||||
case EOpBallot: out.debug << "ballot"; break;
|
||||
case EOpReadFirstInvocation: out.debug << "readFirstInvocation"; break;
|
||||
case EOpAnyInvocation: out.debug << "anyInvocation"; break;
|
||||
case EOpAllInvocations: out.debug << "allInvocations"; break;
|
||||
case EOpAllInvocationsEqual: out.debug << "allInvocationsEqual"; break;
|
||||
|
||||
default: out.debug.message(EPrefixError, "Bad unary op");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user