Add-support-for-SPV_NV_shading_rate

This commit is contained in:
Chao Chen
2018-09-19 11:43:21 -07:00
parent b50c02ef53
commit 5b2203db04
10 changed files with 93 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ enum Op;
enum Capability;
static const int GLSLextNVVersion = 100;
static const int GLSLextNVRevision = 10;
static const int GLSLextNVRevision = 11;
//SPV_NV_sample_mask_override_coverage
const char* const E_SPV_NV_sample_mask_override_coverage = "SPV_NV_sample_mask_override_coverage";
@@ -69,4 +69,7 @@ const char* const E_SPV_NV_mesh_shader = "SPV_NV_mesh_shader";
//SPV_NVX_raytracing
const char* const E_SPV_NVX_raytracing = "SPV_NVX_raytracing";
//SPV_NV_shading_rate
const char* const E_SPV_NV_shading_rate = "SPV_NV_shading_rate";
#endif // #ifndef GLSLextNV_H

View File

@@ -864,6 +864,14 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
builder.addExtension(spv::E_SPV_EXT_fragment_fully_covered);
builder.addCapability(spv::CapabilityFragmentFullyCoveredEXT);
return spv::BuiltInFullyCoveredEXT;
case glslang::EbvFragmentSizeNV:
builder.addExtension(spv::E_SPV_NV_shading_rate);
builder.addCapability(spv::CapabilityShadingRateNV);
return spv::BuiltInFragmentSizeNV;
case glslang::EbvInvocationsPerPixelNV:
builder.addExtension(spv::E_SPV_NV_shading_rate);
builder.addCapability(spv::CapabilityShadingRateNV);
return spv::BuiltInInvocationsPerPixelNV;
// raytracing
case glslang::EbvLaunchIdNV:

View File

@@ -385,6 +385,8 @@ const char* BuiltInString(int builtIn)
case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
case BuiltInPositionPerViewNV: return "PositionPerViewNV";
case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
case BuiltInFragmentSizeNV: return "FragmentSizeNV";
case BuiltInInvocationsPerPixelNV: return "InvocationsPerPixelNV";
case BuiltInBaryCoordNV: return "BaryCoordNV";
case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
#endif
@@ -892,6 +894,7 @@ const char* CapabilityString(int info)
case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV";
case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV";
case CapabilityMeshShadingNV: return "MeshShadingNV";
case CapabilityShadingRateNV: return "ShadingRateNV";
#endif
case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT";