This commit is contained in:
Bill Hollings 2016-05-04 12:02:45 -04:00
commit 2b1e6a8706
5 changed files with 33 additions and 0 deletions

View File

@ -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");

View 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)));
}

View 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);
}

View File

@ -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;
};

View File

@ -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;
}
}