Files
glslang/Test/baseResults/spv.register.subpass.frag.out
LoopDawg 7f93d56ef2 HLSL: add subpass input types and methods
Add support for Subpass Input proposal of issue #1069.

Subpass input types are given as:

    layout(input_attachment_index = 1) SubpassInput<float4> subpass_f;
    layout(input_attachment_index = 2) SubpassInput<int4>   subpass_i;
    layout(input_attachment_index = 3) SubpassInput<uint4>  subpass_u;

    layout(input_attachment_index = 1) SubpassInputMS<float4> subpass_ms_f;
    layout(input_attachment_index = 2) SubpassInputMS<int4>   subpass_ms_i;
    layout(input_attachment_index = 3) SubpassInputMS<uint4>  subpass_ms_u;

The input attachment may also be specified using attribute syntax:

    [[vk::input_attachment_index(7)]] SubpassInput subpass_2;

The template type may be a shorter-than-vec4 vector, but currently user
structs are not supported.  (An unimplemented error will be issued).

The load operations are methods on objects of the above type:

    float4 result = subpass_f.SubpassLoad();
    int4   result = subpass_i.SubpassLoad();
    uint4  result = subpass_u.SubpassLoad();

    float4 result = subpass_ms_f.SubpassLoad(samp);
    int4   result = subpass_ms_i.SubpassLoad(samp);
    uint4  result = subpass_ms_u.SubpassLoad(samp);

Additionally, the AST printer could not print EOpSubpass* nodes.  Now it can.

Fixes #1069
2017-10-02 12:46:55 -06:00

77 lines
3.9 KiB
Plaintext

spv.register.subpass.frag
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 40
Capability Shader
Capability StorageImageMultisample
Capability InputAttachment
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 38
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 9 "@main("
Name 12 "result00"
Name 15 "subpass_f4"
Name 22 "result10"
Name 25 "subpass_ms_f4"
Name 29 "result73"
Name 30 "subpass_2"
Name 38 "@entryPointOutput"
Decorate 15(subpass_f4) DescriptorSet 0
Decorate 15(subpass_f4) Binding 21
Decorate 15(subpass_f4) InputAttachmentIndex 1
Decorate 25(subpass_ms_f4) DescriptorSet 0
Decorate 25(subpass_ms_f4) Binding 20
Decorate 25(subpass_ms_f4) InputAttachmentIndex 4
Decorate 30(subpass_2) DescriptorSet 0
Decorate 30(subpass_2) Binding 22
Decorate 30(subpass_2) InputAttachmentIndex 7
Decorate 38(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeFunction 7(fvec4)
11: TypePointer Function 7(fvec4)
13: TypeImage 6(float) SubpassData nonsampled format:Unknown
14: TypePointer UniformConstant 13
15(subpass_f4): 14(ptr) Variable UniformConstant
17: TypeInt 32 1
18: 17(int) Constant 0
19: TypeVector 17(int) 2
20: 19(ivec2) ConstantComposite 18 18
23: TypeImage 6(float) SubpassData multi-sampled nonsampled format:Unknown
24: TypePointer UniformConstant 23
25(subpass_ms_f4): 24(ptr) Variable UniformConstant
27: 17(int) Constant 3
30(subpass_2): 14(ptr) Variable UniformConstant
33: 6(float) Constant 0
34: 7(fvec4) ConstantComposite 33 33 33 33
37: TypePointer Output 7(fvec4)
38(@entryPointOutput): 37(ptr) Variable Output
4(main): 2 Function None 3
5: Label
39: 7(fvec4) FunctionCall 9(@main()
Store 38(@entryPointOutput) 39
Return
FunctionEnd
9(@main(): 7(fvec4) Function None 8
10: Label
12(result00): 11(ptr) Variable Function
22(result10): 11(ptr) Variable Function
29(result73): 11(ptr) Variable Function
16: 13 Load 15(subpass_f4)
21: 7(fvec4) ImageRead 16 20
Store 12(result00) 21
26: 23 Load 25(subpass_ms_f4)
28: 7(fvec4) ImageRead 26 20 Sample 27
Store 22(result10) 28
31: 13 Load 30(subpass_2)
32: 7(fvec4) ImageRead 31 20
Store 29(result73) 32
ReturnValue 34
FunctionEnd