Add GLSL_EXT_shader_tile_image

This commit is contained in:
janharaldfredriksen-arm 2023-03-30 17:50:56 +02:00 committed by arcady-lunarg
parent a3310b7cff
commit 0bbec2e8f6
33 changed files with 5712 additions and 5083 deletions

View file

@ -524,6 +524,7 @@ TBuiltIns::TBuiltIns()
dimMap[EsdRect] = 2;
dimMap[EsdBuffer] = 1;
dimMap[EsdSubpass] = 2; // potentially unused for now
dimMap[EsdAttachmentEXT] = 2; // potentially unused for now
#endif
}
@ -4440,6 +4441,24 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
// GL_EXT_shader_tile_image
if (spvVersion.vulkan > 0) {
stageBuiltins[EShLangFragment].append(
"lowp uint stencilAttachmentReadEXT();"
"lowp uint stencilAttachmentReadEXT(int);"
"highp float depthAttachmentReadEXT();"
"highp float depthAttachmentReadEXT(int);"
"\n");
stageBuiltins[EShLangFragment].append(
"vec4 colorAttachmentReadEXT(attachmentEXT);"
"vec4 colorAttachmentReadEXT(attachmentEXT, int);"
"ivec4 colorAttachmentReadEXT(iattachmentEXT);"
"ivec4 colorAttachmentReadEXT(iattachmentEXT, int);"
"uvec4 colorAttachmentReadEXT(uattachmentEXT);"
"uvec4 colorAttachmentReadEXT(uattachmentEXT, int);"
"\n");
}
// GL_ARB_derivative_control
if (profile != EEsProfile && version >= 400) {
stageBuiltins[EShLangFragment].append(derivativeControls);
@ -6201,6 +6220,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
for (int dim = Esd2D; dim <= EsdCube; ++dim) { // 2D, 3D, and Cube
#else
for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, ..., buffer, subpass
if (dim == EsdAttachmentEXT)
continue;
if (dim == EsdSubpass && spvVersion.vulkan == 0)
continue;
if (dim == EsdSubpass && (image || shadow || arrayed))
@ -6246,6 +6267,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
#ifndef GLSLANG_WEB
if (dim == EsdSubpass) {
sampler.setSubpass(bTypes[bType], ms ? true : false);
} else if (dim == EsdAttachmentEXT) {
sampler.setAttachmentEXT(bTypes[bType]);
} else
#endif
if (image) {
@ -8732,6 +8755,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
}
// GL_EXT_shader_tile_image
symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
symbolTable.setFunctionExtensions("colorAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
#endif // !GLSLANG_WEB
break;
@ -9957,6 +9985,10 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("beginInvocationInterlockARB", EOpBeginInvocationInterlock);
symbolTable.relateToOperator("endInvocationInterlockARB", EOpEndInvocationInterlock);
symbolTable.relateToOperator("stencilAttachmentReadEXT", EOpStencilAttachmentReadEXT);
symbolTable.relateToOperator("depthAttachmentReadEXT", EOpDepthAttachmentReadEXT);
symbolTable.relateToOperator("colorAttachmentReadEXT", EOpColorAttachmentReadEXT);
break;
case EShLangCompute: