I am extracting reflection data from an HLSL shader targetting vulkan using spirv-cross. This is the shader in question:
struct VSInput
{
[[vk::location(0)]] float2 Pos : POSITION0;
[[vk::location(1)]] float3 Color : COLOR0;
};
struct UBO
{
float2x2 transform;
};
cbuffer ubo : register(b0) { UBO ubo; }
struct VSOutput
{
float4 Pos : SV_POSITION;
[[vk::location(0)]] float3 Color : COLOR0;
};
VSOutput main(VSInput input)
{
VSOutput output = (VSOutput)0;
output.Color = input.Color;
output.Pos = float4(ubo.transform * input.Pos.xy, 0, 1);
return output;
}
Resource { id: 53, type_id: 52, base_type_id: 7, name: "input.Pos" }
Float { vecsize: 2, columns: 1, array: [] }
Location: Ok(0)
Binding: Ok(0)
Offset: Ok(0)
Resource { id: 57, type_id: 56, base_type_id: 8, name: "input.Color" }
Float { vecsize: 3, columns: 1, array: [] }
Location: Ok(1)
Binding: Ok(0)
Offset: Ok(0)
In particular the vertex input data, i.e. the position and the color, are in the same binding. Is there a way to tell hlsl (or shaderc, which is what I am compiling with) to separate both inputs into the different bindings?