SPV: 1st pass implementation of SPV_EXT_shader_viewport_index_layer.
This commit is contained in:
parent
1f312f9078
commit
b41bff69d2
@ -43,5 +43,6 @@ static const char* const E_SPV_KHR_16bit_storage = "SPV_KHR_16bit
|
|||||||
static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class";
|
static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class";
|
||||||
static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage";
|
static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage";
|
||||||
static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export";
|
static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export";
|
||||||
|
static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer";
|
||||||
|
|
||||||
#endif // #ifndef GLSLextKHR_H
|
#endif // #ifndef GLSLextKHR_H
|
||||||
|
@ -455,15 +455,13 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
|||||||
case glslang::EbvViewportIndex:
|
case glslang::EbvViewportIndex:
|
||||||
if (!memberDeclaration) {
|
if (!memberDeclaration) {
|
||||||
builder.addCapability(spv::CapabilityMultiViewport);
|
builder.addCapability(spv::CapabilityMultiViewport);
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
if (glslangIntermediate->getStage() == EShLangVertex ||
|
if (glslangIntermediate->getStage() == EShLangVertex ||
|
||||||
glslangIntermediate->getStage() == EShLangTessControl ||
|
glslangIntermediate->getStage() == EShLangTessControl ||
|
||||||
glslangIntermediate->getStage() == EShLangTessEvaluation) {
|
glslangIntermediate->getStage() == EShLangTessEvaluation) {
|
||||||
|
|
||||||
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer);
|
||||||
builder.addCapability(spv::CapabilityShaderViewportIndexLayerNV);
|
builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return spv::BuiltInViewportIndex;
|
return spv::BuiltInViewportIndex;
|
||||||
|
|
||||||
@ -482,15 +480,13 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
|||||||
case glslang::EbvLayer:
|
case glslang::EbvLayer:
|
||||||
if (!memberDeclaration) {
|
if (!memberDeclaration) {
|
||||||
builder.addCapability(spv::CapabilityGeometry);
|
builder.addCapability(spv::CapabilityGeometry);
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
if (glslangIntermediate->getStage() == EShLangVertex ||
|
if (glslangIntermediate->getStage() == EShLangVertex ||
|
||||||
glslangIntermediate->getStage() == EShLangTessControl ||
|
glslangIntermediate->getStage() == EShLangTessControl ||
|
||||||
glslangIntermediate->getStage() == EShLangTessEvaluation) {
|
glslangIntermediate->getStage() == EShLangTessEvaluation) {
|
||||||
|
|
||||||
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer);
|
||||||
builder.addCapability(spv::CapabilityShaderViewportIndexLayerNV);
|
builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return spv::BuiltInLayer;
|
return spv::BuiltInLayer;
|
||||||
@ -5475,14 +5471,12 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
|
|||||||
}
|
}
|
||||||
else if (builtIn == spv::BuiltInLayer) {
|
else if (builtIn == spv::BuiltInLayer) {
|
||||||
// SPV_NV_viewport_array2 extension
|
// SPV_NV_viewport_array2 extension
|
||||||
if (symbol->getQualifier().layoutViewportRelative)
|
if (symbol->getQualifier().layoutViewportRelative) {
|
||||||
{
|
|
||||||
addDecoration(id, (spv::Decoration)spv::DecorationViewportRelativeNV);
|
addDecoration(id, (spv::Decoration)spv::DecorationViewportRelativeNV);
|
||||||
builder.addCapability(spv::CapabilityShaderViewportMaskNV);
|
builder.addCapability(spv::CapabilityShaderViewportMaskNV);
|
||||||
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
||||||
}
|
}
|
||||||
if(symbol->getQualifier().layoutSecondaryViewportRelativeOffset != -2048)
|
if (symbol->getQualifier().layoutSecondaryViewportRelativeOffset != -2048) {
|
||||||
{
|
|
||||||
addDecoration(id, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, symbol->getQualifier().layoutSecondaryViewportRelativeOffset);
|
addDecoration(id, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, symbol->getQualifier().layoutSecondaryViewportRelativeOffset);
|
||||||
builder.addCapability(spv::CapabilityShaderStereoViewNV);
|
builder.addCapability(spv::CapabilityShaderStereoViewNV);
|
||||||
builder.addExtension(spv::E_SPV_NV_stereo_view_rendering);
|
builder.addExtension(spv::E_SPV_NV_stereo_view_rendering);
|
||||||
|
@ -8,6 +8,7 @@ spv.stereoViewRendering.vert
|
|||||||
Capability ShaderViewportIndexLayerNV
|
Capability ShaderViewportIndexLayerNV
|
||||||
Capability ShaderViewportMaskNV
|
Capability ShaderViewportMaskNV
|
||||||
Capability ShaderStereoViewNV
|
Capability ShaderStereoViewNV
|
||||||
|
Extension "SPV_EXT_shader_viewport_index_layer"
|
||||||
Extension "SPV_NV_stereo_view_rendering"
|
Extension "SPV_NV_stereo_view_rendering"
|
||||||
Extension "SPV_NV_viewport_array2"
|
Extension "SPV_NV_viewport_array2"
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
@ -7,6 +7,7 @@ spv.viewportArray2.tesc
|
|||||||
Capability MultiViewport
|
Capability MultiViewport
|
||||||
Capability ShaderViewportIndexLayerNV
|
Capability ShaderViewportIndexLayerNV
|
||||||
Capability ShaderViewportMaskNV
|
Capability ShaderViewportMaskNV
|
||||||
|
Extension "SPV_EXT_shader_viewport_index_layer"
|
||||||
Extension "SPV_NV_viewport_array2"
|
Extension "SPV_NV_viewport_array2"
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
|
@ -8,6 +8,7 @@ spv.viewportArray2.vert
|
|||||||
Capability MultiViewport
|
Capability MultiViewport
|
||||||
Capability ShaderViewportIndexLayerNV
|
Capability ShaderViewportIndexLayerNV
|
||||||
Capability ShaderViewportMaskNV
|
Capability ShaderViewportMaskNV
|
||||||
|
Extension "SPV_EXT_shader_viewport_index_layer"
|
||||||
Extension "SPV_NV_viewport_array2"
|
Extension "SPV_NV_viewport_array2"
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
|
Loading…
x
Reference in New Issue
Block a user