Implement the extension GL_AMD_shader_fragment_mask
This commit is contained in:
123
Test/baseResults/spv.shaderFragMaskAMD.frag.out
Normal file
123
Test/baseResults/spv.shaderFragMaskAMD.frag.out
Normal file
@@ -0,0 +1,123 @@
|
||||
spv.shaderFragMaskAMD.frag
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 80
|
||||
|
||||
Capability Shader
|
||||
Capability StorageImageMultisample
|
||||
Capability InputAttachment
|
||||
Capability FragmentMaskAMD
|
||||
Extension "SPV_AMD_shader_fragment_mask"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 78
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source GLSL 450
|
||||
SourceExtension "GL_AMD_shader_fragment_mask"
|
||||
Name 4 "main"
|
||||
Name 9 "f4"
|
||||
Name 14 "fragMask"
|
||||
Name 18 "s2DMS"
|
||||
Name 27 "fragIndex"
|
||||
Name 42 "is2DMSArray"
|
||||
Name 62 "usubpassMS"
|
||||
Name 78 "fragColor"
|
||||
Decorate 18(s2DMS) DescriptorSet 0
|
||||
Decorate 18(s2DMS) Binding 0
|
||||
Decorate 42(is2DMSArray) DescriptorSet 0
|
||||
Decorate 42(is2DMSArray) Binding 1
|
||||
Decorate 62(usubpassMS) DescriptorSet 0
|
||||
Decorate 62(usubpassMS) Binding 2
|
||||
Decorate 62(usubpassMS) InputAttachmentIndex 0
|
||||
Decorate 78(fragColor) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypePointer Function 7(fvec4)
|
||||
10: 6(float) Constant 0
|
||||
11: 7(fvec4) ConstantComposite 10 10 10 10
|
||||
12: TypeInt 32 0
|
||||
13: TypePointer Function 12(int)
|
||||
15: TypeImage 6(float) 2D multi-sampled sampled format:Unknown
|
||||
16: TypeSampledImage 15
|
||||
17: TypePointer UniformConstant 16
|
||||
18(s2DMS): 17(ptr) Variable UniformConstant
|
||||
20: TypeInt 32 1
|
||||
21: TypeVector 20(int) 2
|
||||
22: 20(int) Constant 2
|
||||
23: 20(int) Constant 3
|
||||
24: 21(ivec2) ConstantComposite 22 23
|
||||
29: 12(int) Constant 240
|
||||
31: 20(int) Constant 4
|
||||
34: 12(int) Constant 1
|
||||
39: TypeImage 20(int) 2D array multi-sampled sampled format:Unknown
|
||||
40: TypeSampledImage 39
|
||||
41: TypePointer UniformConstant 40
|
||||
42(is2DMSArray): 41(ptr) Variable UniformConstant
|
||||
44: TypeVector 20(int) 3
|
||||
45: 20(int) Constant 1
|
||||
46: 44(ivec3) ConstantComposite 22 23 45
|
||||
55: TypeVector 20(int) 4
|
||||
60: TypeImage 12(int) SubpassData multi-sampled nonsampled format:Unknown
|
||||
61: TypePointer UniformConstant 60
|
||||
62(usubpassMS): 61(ptr) Variable UniformConstant
|
||||
64: 20(int) Constant 0
|
||||
65: 21(ivec2) ConstantComposite 64 64
|
||||
72: TypeVector 12(int) 4
|
||||
77: TypePointer Output 7(fvec4)
|
||||
78(fragColor): 77(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
9(f4): 8(ptr) Variable Function
|
||||
14(fragMask): 13(ptr) Variable Function
|
||||
27(fragIndex): 13(ptr) Variable Function
|
||||
Store 9(f4) 11
|
||||
19: 16 Load 18(s2DMS)
|
||||
25: 15 Image 19
|
||||
26: 12(int) FragmentMaskFetchAMD 25 24
|
||||
Store 14(fragMask) 26
|
||||
28: 12(int) Load 14(fragMask)
|
||||
30: 12(int) BitwiseAnd 28 29
|
||||
32: 12(int) ShiftRightLogical 30 31
|
||||
Store 27(fragIndex) 32
|
||||
33: 16 Load 18(s2DMS)
|
||||
35: 15 Image 33
|
||||
36: 7(fvec4) FragmentFetchAMD 35 24 34
|
||||
37: 7(fvec4) Load 9(f4)
|
||||
38: 7(fvec4) FAdd 37 36
|
||||
Store 9(f4) 38
|
||||
43: 40 Load 42(is2DMSArray)
|
||||
47: 39 Image 43
|
||||
48: 12(int) FragmentMaskFetchAMD 47 46
|
||||
Store 14(fragMask) 48
|
||||
49: 12(int) Load 14(fragMask)
|
||||
50: 12(int) BitwiseAnd 49 29
|
||||
51: 12(int) ShiftRightLogical 50 31
|
||||
Store 27(fragIndex) 51
|
||||
52: 40 Load 42(is2DMSArray)
|
||||
53: 12(int) Load 27(fragIndex)
|
||||
54: 39 Image 52
|
||||
56: 55(ivec4) FragmentFetchAMD 54 46 53
|
||||
57: 7(fvec4) ConvertSToF 56
|
||||
58: 7(fvec4) Load 9(f4)
|
||||
59: 7(fvec4) FAdd 58 57
|
||||
Store 9(f4) 59
|
||||
63: 60 Load 62(usubpassMS)
|
||||
66: 12(int) FragmentMaskFetchAMD 63 65
|
||||
Store 14(fragMask) 66
|
||||
67: 12(int) Load 14(fragMask)
|
||||
68: 12(int) BitwiseAnd 67 29
|
||||
69: 12(int) ShiftRightLogical 68 31
|
||||
Store 27(fragIndex) 69
|
||||
70: 60 Load 62(usubpassMS)
|
||||
71: 12(int) Load 27(fragIndex)
|
||||
73: 72(ivec4) FragmentFetchAMD 70 65 71
|
||||
74: 7(fvec4) ConvertUToF 73
|
||||
75: 7(fvec4) Load 9(f4)
|
||||
76: 7(fvec4) FAdd 75 74
|
||||
Store 9(f4) 76
|
||||
79: 7(fvec4) Load 9(f4)
|
||||
Store 78(fragColor) 79
|
||||
Return
|
||||
FunctionEnd
|
||||
29
Test/spv.shaderFragMaskAMD.frag
Normal file
29
Test/spv.shaderFragMaskAMD.frag
Normal file
@@ -0,0 +1,29 @@
|
||||
#version 450 core
|
||||
|
||||
#extension GL_AMD_shader_fragment_mask: enable
|
||||
|
||||
layout(binding = 0) uniform sampler2DMS s2DMS;
|
||||
layout(binding = 1) uniform isampler2DMSArray is2DMSArray;
|
||||
|
||||
layout(binding = 2, input_attachment_index = 0) uniform usubpassInputMS usubpassMS;
|
||||
|
||||
layout(location = 0) out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 f4 = vec4(0.0);
|
||||
|
||||
uint fragMask = fragmentMaskFetchAMD(s2DMS, ivec2(2, 3));
|
||||
uint fragIndex = (fragMask & 0xF0) >> 4;
|
||||
f4 += fragmentFetchAMD(s2DMS, ivec2(2, 3), 1);
|
||||
|
||||
fragMask = fragmentMaskFetchAMD(is2DMSArray, ivec3(2, 3, 1));
|
||||
fragIndex = (fragMask & 0xF0) >> 4;
|
||||
f4 += fragmentFetchAMD(is2DMSArray, ivec3(2, 3, 1), fragIndex);
|
||||
|
||||
fragMask = fragmentMaskFetchAMD(usubpassMS);
|
||||
fragIndex = (fragMask & 0xF0) >> 4;
|
||||
f4 += fragmentFetchAMD(usubpassMS, fragIndex);
|
||||
|
||||
fragColor = f4;
|
||||
}
|
||||
Reference in New Issue
Block a user