| 1 |
struct V2F |
| 2 |
{ |
| 3 |
float4 Position; |
| 4 |
float4 Color; |
| 5 |
}; |
| 6 |
|
| 7 |
struct InstanceData |
| 8 |
{ |
| 9 |
column_major float4x4 MATRIX_MVP; |
| 10 |
float4 Color; |
| 11 |
}; |
| 12 |
|
| 13 |
cbuffer gInstanceData : register(b0) |
| 14 |
{ |
| 15 |
InstanceData gInstanceData_1_data[32] : packoffset(c0); |
| 16 |
}; |
| 17 |
|
| 18 |
|
| 19 |
static float4 gl_Position; |
| 20 |
static int gl_InstanceIndex; |
| 21 |
static float3 PosL; |
| 22 |
static float4 _entryPointOutput_Color; |
| 23 |
|
| 24 |
struct SPIRV_Cross_Input |
| 25 |
{ |
| 26 |
float3 PosL : TEXCOORD0; |
| 27 |
uint gl_InstanceIndex : SV_InstanceID; |
| 28 |
}; |
| 29 |
|
| 30 |
struct SPIRV_Cross_Output |
| 31 |
{ |
| 32 |
float4 _entryPointOutput_Color : TEXCOORD0; |
| 33 |
float4 gl_Position : SV_Position; |
| 34 |
}; |
| 35 |
|
| 36 |
V2F _VS(float3 PosL_1, uint instanceID) |
| 37 |
{ |
| 38 |
InstanceData instData; |
| 39 |
instData.MATRIX_MVP = gInstanceData_1_data[instanceID].MATRIX_MVP; |
| 40 |
instData.Color = gInstanceData_1_data[instanceID].Color; |
| 41 |
V2F v2f; |
| 42 |
v2f.Position = mul(float4(PosL_1, 1.0f), instData.MATRIX_MVP); |
| 43 |
v2f.Color = instData.Color; |
| 44 |
return v2f; |
| 45 |
} |
| 46 |
|
| 47 |
void vert_main() |
| 48 |
{ |
| 49 |
float3 PosL_1 = PosL; |
| 50 |
uint instanceID = uint(gl_InstanceIndex); |
| 51 |
float3 param = PosL_1; |
| 52 |
uint param_1 = instanceID; |
| 53 |
V2F flattenTemp = _VS(param, param_1); |
| 54 |
gl_Position = flattenTemp.Position; |
| 55 |
_entryPointOutput_Color = flattenTemp.Color; |
| 56 |
} |
| 57 |
|
| 58 |
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) |
| 59 |
{ |
| 60 |
gl_InstanceIndex = int(stage_input.gl_InstanceIndex); |
| 61 |
PosL = stage_input.PosL; |
| 62 |
vert_main(); |
| 63 |
SPIRV_Cross_Output stage_output; |
| 64 |
stage_output.gl_Position = gl_Position; |
| 65 |
stage_output._entryPointOutput_Color = _entryPointOutput_Color; |
| 66 |
return stage_output; |
| 67 |
} |