Implement GL_EXT_maximal_reconvergence
This commit is contained in:
parent
7eea61b5a3
commit
8066fa086b
16 changed files with 1452 additions and 1384 deletions
|
|
@ -258,6 +258,7 @@ void TParseVersions::initializeExtensionBehavior()
|
|||
extensionBehavior[E_GL_EXT_shader_16bit_storage] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_subgroup_uniform_control_flow] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_maximal_reconvergence] = EBhDisable;
|
||||
|
||||
extensionBehavior[E_GL_EXT_fragment_shader_barycentric] = EBhDisable;
|
||||
|
||||
|
|
@ -446,6 +447,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
if (version >= 310) {
|
||||
preamble += "#define GL_EXT_null_initializer 1\n";
|
||||
preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n";
|
||||
preamble += "#define GL_EXT_maximal_reconvergence 1\n";
|
||||
}
|
||||
|
||||
} else { // !isEsProfile()
|
||||
|
|
@ -599,6 +601,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
if (version >= 140) {
|
||||
preamble += "#define GL_EXT_null_initializer 1\n";
|
||||
preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n";
|
||||
preamble += "#define GL_EXT_maximal_reconvergence 1\n";
|
||||
}
|
||||
if (version >= 130) {
|
||||
preamble +="#define GL_FRAGMENT_PRECISION_HIGH 1\n";
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ const char* const E_GL_EXT_mesh_shader = "GL_EXT_mesh_shade
|
|||
const char* const E_GL_EXT_opacity_micromap = "GL_EXT_opacity_micromap";
|
||||
const char* const E_GL_EXT_draw_instanced = "GL_EXT_draw_instanced";
|
||||
const char* const E_GL_EXT_texture_array = "GL_EXT_texture_array";
|
||||
const char* const E_GL_EXT_maximal_reconvergence = "GL_EXT_maximal_reconvergence";
|
||||
|
||||
// Arrays of extensions for the above viewportEXTs duplications
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,8 @@ TAttributeType TParseContext::attributeFromName(const TString& name) const
|
|||
return EatSubgroupUniformControlFlow;
|
||||
else if (name == "export")
|
||||
return EatExport;
|
||||
else if (name == "maximal_reconvergence")
|
||||
return EatMaximalReconvergence;
|
||||
else
|
||||
return EatNone;
|
||||
}
|
||||
|
|
@ -360,6 +362,10 @@ void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttri
|
|||
requireExtensions(loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
|
||||
intermediate.setSubgroupUniformControlFlow();
|
||||
break;
|
||||
case EatMaximalReconvergence:
|
||||
requireExtensions(loc, 1, &E_GL_EXT_maximal_reconvergence, "attribute");
|
||||
intermediate.setMaximalReconvergence();
|
||||
break;
|
||||
default:
|
||||
warn(loc, "attribute does not apply to a function", "", "");
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ namespace glslang {
|
|||
EatNonReadable,
|
||||
EatSubgroupUniformControlFlow,
|
||||
EatExport,
|
||||
EatMaximalReconvergence,
|
||||
};
|
||||
|
||||
class TIntermAggregate;
|
||||
|
|
|
|||
|
|
@ -964,18 +964,24 @@ function_prototype
|
|||
$$.function = $1;
|
||||
if (parseContext.compileOnly) $$.function->setExport();
|
||||
$$.loc = $2.loc;
|
||||
const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence };
|
||||
parseContext.requireExtensions($2.loc, 2, extensions, "attribute");
|
||||
parseContext.handleFunctionAttributes($2.loc, *$3);
|
||||
}
|
||||
| attribute function_declarator RIGHT_PAREN {
|
||||
$$.function = $2;
|
||||
if (parseContext.compileOnly) $$.function->setExport();
|
||||
$$.loc = $3.loc;
|
||||
const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence };
|
||||
parseContext.requireExtensions($3.loc, 2, extensions, "attribute");
|
||||
parseContext.handleFunctionAttributes($3.loc, *$1);
|
||||
}
|
||||
| attribute function_declarator RIGHT_PAREN attribute {
|
||||
$$.function = $2;
|
||||
if (parseContext.compileOnly) $$.function->setExport();
|
||||
$$.loc = $3.loc;
|
||||
const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence };
|
||||
parseContext.requireExtensions($3.loc, 2, extensions, "attribute");
|
||||
parseContext.handleFunctionAttributes($3.loc, *$1);
|
||||
parseContext.handleFunctionAttributes($3.loc, *$4);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1512,6 +1512,9 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
|
|||
if (getSubgroupUniformControlFlow())
|
||||
infoSink.debug << "subgroup_uniform_control_flow\n";
|
||||
|
||||
if (getMaximalReconvergence())
|
||||
infoSink.debug << "maximal_reconvergence\n";
|
||||
|
||||
switch (language) {
|
||||
case EShLangVertex:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@ public:
|
|||
needToLegalize(false),
|
||||
binaryDoubleOutput(false),
|
||||
subgroupUniformControlFlow(false),
|
||||
maximalReconvergence(false),
|
||||
usePhysicalStorageBuffer(false),
|
||||
spirvRequirement(nullptr),
|
||||
spirvExecutionMode(nullptr),
|
||||
|
|
@ -963,6 +964,9 @@ public:
|
|||
void setSubgroupUniformControlFlow() { subgroupUniformControlFlow = true; }
|
||||
bool getSubgroupUniformControlFlow() const { return subgroupUniformControlFlow; }
|
||||
|
||||
void setMaximalReconvergence() { maximalReconvergence = true; }
|
||||
bool getMaximalReconvergence() const { return maximalReconvergence; }
|
||||
|
||||
// GL_EXT_spirv_intrinsics
|
||||
void insertSpirvRequirement(const TSpirvRequirement* spirvReq);
|
||||
bool hasSpirvRequirement() const { return spirvRequirement != nullptr; }
|
||||
|
|
@ -1226,6 +1230,7 @@ protected:
|
|||
bool needToLegalize;
|
||||
bool binaryDoubleOutput;
|
||||
bool subgroupUniformControlFlow;
|
||||
bool maximalReconvergence;
|
||||
bool usePhysicalStorageBuffer;
|
||||
|
||||
TSpirvRequirement* spirvRequirement;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue