Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross
This commit is contained in:
commit
2b1e6a8706
2
main.cpp
2
main.cpp
@ -203,6 +203,8 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
|
||||
fprintf(stderr, " (Set : %u)", compiler.get_decoration(res.id, DecorationDescriptorSet));
|
||||
if (mask & (1ull << DecorationBinding))
|
||||
fprintf(stderr, " (Binding : %u)", compiler.get_decoration(res.id, DecorationBinding));
|
||||
if (mask & (1ull << DecorationInputAttachmentIndex))
|
||||
fprintf(stderr, " (Attachment : %u)", compiler.get_decoration(res.id, DecorationInputAttachmentIndex));
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
fprintf(stderr, "=============\n\n");
|
||||
|
14
reference/shaders-vulkan/frag/input-attachment.frag
Normal file
14
reference/shaders-vulkan/frag/input-attachment.frag
Normal file
@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
precision highp int;
|
||||
|
||||
layout(binding = 0) uniform mediump sampler2D uSubpass0;
|
||||
layout(binding = 1) uniform mediump sampler2D uSubpass1;
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = (texture(uSubpass0, gl_FragCoord.xy / vec2(textureSize(uSubpass0, 0).xy)) + texture(uSubpass1, gl_FragCoord.xy / vec2(textureSize(uSubpass1, 0).xy)));
|
||||
}
|
||||
|
11
shaders-vulkan/frag/input-attachment.frag
Normal file
11
shaders-vulkan/frag/input-attachment.frag
Normal file
@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(input_attachment_index = 0, set = 0, binding = 0) uniform mediump subpassInput uSubpass0;
|
||||
layout(input_attachment_index = 1, set = 0, binding = 1) uniform mediump subpassInput uSubpass1;
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = subpassLoad(uSubpass0) + subpassLoad(uSubpass1);
|
||||
}
|
@ -638,6 +638,7 @@ namespace spirv_cross
|
||||
uint32_t binding = 0;
|
||||
uint32_t offset = 0;
|
||||
uint32_t array_stride = 0;
|
||||
uint32_t input_attachment = 0;
|
||||
bool builtin = false;
|
||||
bool per_instance = false;
|
||||
};
|
||||
|
@ -723,6 +723,10 @@ void Compiler::set_decoration(uint32_t id, Decoration decoration, uint32_t argum
|
||||
dec.set = argument;
|
||||
break;
|
||||
|
||||
case DecorationInputAttachmentIndex:
|
||||
dec.input_attachment = argument;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -757,6 +761,7 @@ uint32_t Compiler::get_decoration(uint32_t id, Decoration decoration) const
|
||||
case DecorationOffset: return dec.offset;
|
||||
case DecorationBinding: return dec.binding;
|
||||
case DecorationDescriptorSet: return dec.set;
|
||||
case DecorationInputAttachmentIndex: return dec.input_attachment;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user