Merge pull request #965 from chaoc/spv-khr-post-depth-coverage
Implement SPV_KHR_post_depth_coverage
This commit is contained in:
commit
9645f78293
20 changed files with 185 additions and 6 deletions
|
|
@ -32,7 +32,7 @@ enum Op;
|
|||
enum Capability;
|
||||
|
||||
static const int GLSLextKHRVersion = 100;
|
||||
static const int GLSLextKHRRevision = 1;
|
||||
static const int GLSLextKHRRevision = 2;
|
||||
|
||||
static const char* const E_SPV_KHR_shader_ballot = "SPV_KHR_shader_ballot";
|
||||
static const char* const E_SPV_KHR_subgroup_vote = "SPV_KHR_subgroup_vote";
|
||||
|
|
@ -41,5 +41,6 @@ static const char* const E_SPV_KHR_multiview = "SPV_KHR_multi
|
|||
static const char* const E_SPV_KHR_shader_draw_parameters = "SPV_KHR_shader_draw_parameters";
|
||||
static const char* const E_SPV_KHR_16bit_storage = "SPV_KHR_16bit_storage";
|
||||
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";
|
||||
|
||||
#endif // #ifndef GLSLextKHR_H
|
||||
|
|
|
|||
|
|
@ -980,6 +980,12 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
|
|||
if (glslangIntermediate->getEarlyFragmentTests())
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeEarlyFragmentTests);
|
||||
|
||||
if (glslangIntermediate->getPostDepthCoverage()) {
|
||||
builder.addCapability(spv::CapabilitySampleMaskPostDepthCoverage);
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModePostDepthCoverage);
|
||||
builder.addExtension(spv::E_SPV_KHR_post_depth_coverage);
|
||||
}
|
||||
|
||||
switch(glslangIntermediate->getDepth()) {
|
||||
case glslang::EldGreater: mode = spv::ExecutionModeDepthGreater; break;
|
||||
case glslang::EldLess: mode = spv::ExecutionModeDepthLess; break;
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ const char* ExecutionModeString(int mode)
|
|||
case 31: return "ContractionOff";
|
||||
case 32: return "Bad";
|
||||
|
||||
case 4446: return "PostDepthCoverage";
|
||||
case ExecutionModeCeiling:
|
||||
default: return "Bad";
|
||||
}
|
||||
|
|
@ -843,6 +844,7 @@ const char* CapabilityString(int info)
|
|||
case 5009: return "ImageGatherBiasLodAMD";
|
||||
#endif
|
||||
|
||||
case 4447: return "SampleMaskPostDepthCoverage";
|
||||
#ifdef NV_EXTENSIONS
|
||||
case 5251: return "GeometryShaderPassthroughNV";
|
||||
case 5254: return "ShaderViewportIndexLayerNV";
|
||||
|
|
|
|||
|
|
@ -47,11 +47,11 @@ namespace spv {
|
|||
typedef unsigned int Id;
|
||||
|
||||
#define SPV_VERSION 0x10000
|
||||
#define SPV_REVISION 10
|
||||
#define SPV_REVISION 11
|
||||
|
||||
static const unsigned int MagicNumber = 0x07230203;
|
||||
static const unsigned int Version = 0x00010000;
|
||||
static const unsigned int Revision = 10;
|
||||
static const unsigned int Revision = 11;
|
||||
static const unsigned int OpCodeMask = 0xffff;
|
||||
static const unsigned int WordCountShift = 16;
|
||||
|
||||
|
|
@ -122,6 +122,7 @@ enum ExecutionMode {
|
|||
ExecutionModeOutputTriangleStrip = 29,
|
||||
ExecutionModeVecTypeHint = 30,
|
||||
ExecutionModeContractionOff = 31,
|
||||
ExecutionModePostDepthCoverage = 4446,
|
||||
ExecutionModeMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
|
|
@ -628,6 +629,7 @@ enum Capability {
|
|||
CapabilityMultiView = 4439,
|
||||
CapabilityVariablePointersStorageBuffer = 4441,
|
||||
CapabilityVariablePointers = 4442,
|
||||
CapabilitySampleMaskPostDepthCoverage = 4447,
|
||||
CapabilitySampleMaskOverrideCoverageNV = 5249,
|
||||
CapabilityGeometryShaderPassthroughNV = 5251,
|
||||
CapabilityShaderViewportIndexLayerNV = 5254,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue