Fixes #1158.
Fixes #1159.
return spv::BuiltInSamplePosition;
case glslang::EbvSampleMask:
- builder.addCapability(spv::CapabilitySampleRateShading);
return spv::BuiltInSampleMask;
case glslang::EbvLayer:
// Id's are bound by 88
Capability Shader
- Capability SampleRateShading
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 68 78 82 86
// Id's are bound by 18
Capability Shader
- Capability SampleRateShading
Capability SampleMaskPostDepthCoverage
Extension "SPV_KHR_post_depth_coverage"
1: ExtInstImport "GLSL.std.450"
--- /dev/null
+spv.sample.frag
+// Module Version 10000
+// Generated by (magic number): 80002
+// Id's are bound by 13
+
+ Capability Shader
+ Capability SampleRateShading
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Fragment 4 "main" 9 11
+ ExecutionMode 4 OriginUpperLeft
+ Source GLSL 450
+ Name 4 "main"
+ Name 9 "color"
+ Name 11 "samp"
+ Decorate 9(color) Location 0
+ Decorate 11(samp) Sample
+ Decorate 11(samp) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeFloat 32
+ 7: TypeVector 6(float) 4
+ 8: TypePointer Output 7(fvec4)
+ 9(color): 8(ptr) Variable Output
+ 10: TypePointer Input 7(fvec4)
+ 11(samp): 10(ptr) Variable Input
+ 4(main): 2 Function None 3
+ 5: Label
+ 12: 7(fvec4) Load 11(samp)
+ Store 9(color) 12
+ Return
+ FunctionEnd
--- /dev/null
+spv.sampleId.frag
+// Module Version 10000
+// Generated by (magic number): 80002
+// Id's are bound by 26
+
+ Capability Shader
+ Capability SampleRateShading
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Fragment 4 "main" 8 18 20
+ ExecutionMode 4 OriginUpperLeft
+ Source GLSL 450
+ Name 4 "main"
+ Name 8 "gl_SampleID"
+ Name 18 "color"
+ Name 20 "samp"
+ Decorate 8(gl_SampleID) Flat
+ Decorate 8(gl_SampleID) BuiltIn SampleId
+ Decorate 18(color) Location 0
+ Decorate 20(samp) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 1
+ 7: TypePointer Input 6(int)
+ 8(gl_SampleID): 7(ptr) Variable Input
+ 10: 6(int) Constant 3
+ 11: TypeBool
+ 15: TypeFloat 32
+ 16: TypeVector 15(float) 4
+ 17: TypePointer Output 16(fvec4)
+ 18(color): 17(ptr) Variable Output
+ 19: TypePointer Input 16(fvec4)
+ 20(samp): 19(ptr) Variable Input
+ 23: 15(float) Constant 1073741824
+ 4(main): 2 Function None 3
+ 5: Label
+ 9: 6(int) Load 8(gl_SampleID)
+ 12: 11(bool) SLessThan 9 10
+ SelectionMerge 14 None
+ BranchConditional 12 13 22
+ 13: Label
+ 21: 16(fvec4) Load 20(samp)
+ Store 18(color) 21
+ Branch 14
+ 22: Label
+ 24: 16(fvec4) Load 20(samp)
+ 25: 16(fvec4) VectorTimesScalar 24 23
+ Store 18(color) 25
+ Branch 14
+ 14: Label
+ Return
+ FunctionEnd
// Id's are bound by 20
Capability Shader
- Capability SampleRateShading
Extension "SPV_NV_sample_mask_override_coverage"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
--- /dev/null
+spv.samplePosition.frag
+// Module Version 10000
+// Generated by (magic number): 80002
+// Id's are bound by 30
+
+ Capability Shader
+ Capability SampleRateShading
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Fragment 4 "main" 9 22 24
+ ExecutionMode 4 OriginUpperLeft
+ Source GLSL 450
+ Name 4 "main"
+ Name 9 "gl_SamplePosition"
+ Name 22 "color"
+ Name 24 "samp"
+ Decorate 9(gl_SamplePosition) BuiltIn SamplePosition
+ Decorate 22(color) Location 0
+ Decorate 24(samp) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeFloat 32
+ 7: TypeVector 6(float) 2
+ 8: TypePointer Input 7(fvec2)
+9(gl_SamplePosition): 8(ptr) Variable Input
+ 10: TypeInt 32 0
+ 11: 10(int) Constant 1
+ 12: TypePointer Input 6(float)
+ 15: 6(float) Constant 1056964608
+ 16: TypeBool
+ 20: TypeVector 6(float) 4
+ 21: TypePointer Output 20(fvec4)
+ 22(color): 21(ptr) Variable Output
+ 23: TypePointer Input 20(fvec4)
+ 24(samp): 23(ptr) Variable Input
+ 27: 6(float) Constant 1073741824
+ 4(main): 2 Function None 3
+ 5: Label
+ 13: 12(ptr) AccessChain 9(gl_SamplePosition) 11
+ 14: 6(float) Load 13
+ 17: 16(bool) FOrdLessThan 14 15
+ SelectionMerge 19 None
+ BranchConditional 17 18 26
+ 18: Label
+ 25: 20(fvec4) Load 24(samp)
+ Store 22(color) 25
+ Branch 19
+ 26: Label
+ 28: 20(fvec4) Load 24(samp)
+ 29: 20(fvec4) VectorTimesScalar 28 27
+ Store 22(color) 29
+ Branch 19
+ 19: Label
+ Return
+ FunctionEnd
--- /dev/null
+#version 450
+
+layout(location = 0) in sample vec4 samp;
+layout(location = 0) out vec4 color;
+
+void main()
+{
+ color = samp;
+}
\ No newline at end of file
--- /dev/null
+#version 450
+
+layout(location = 0) in vec4 samp;
+layout(location = 0) out vec4 color;
+
+void main()
+{
+ if (gl_SampleID < 3)
+ color = samp;
+ else
+ color = 2 * samp;
+}
\ No newline at end of file
--- /dev/null
+#version 450
+
+layout(location = 0) in vec4 samp;
+layout(location = 0) out vec4 color;
+
+void main()
+{
+ if (gl_SamplePosition.y < 0.5)
+ color = samp;
+ else
+ color = 2 * samp;
+}
\ No newline at end of file
"spv.precisionNonESSamp.frag",
"spv.prepost.frag",
"spv.qualifiers.vert",
+ "spv.sample.frag",
+ "spv.sampleId.frag",
+ "spv.samplePosition.frag",
"spv.sampleMaskOverrideCoverage.frag",
"spv.shaderBallot.comp",
"spv.shaderDrawParams.vert",