mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-26 08:44:08 +00:00
92287c30b5
Make the HLSL backend more like other backends by using `back::Baked` to generate names for baked expression identifiers. This removes the final uses of `Handle::index` from the HLSL backend. This is separated out from the previous commit because it changes lots of snapshot tests, whereas the previous commit has no effect on Naga's output.
34 lines
811 B
HLSL
34 lines
811 B
HLSL
struct NagaConstants {
|
|
int first_vertex;
|
|
int first_instance;
|
|
uint other;
|
|
};
|
|
ConstantBuffer<NagaConstants> _NagaConstants: register(b0, space1);
|
|
|
|
struct PushConstants {
|
|
float multiplier;
|
|
};
|
|
|
|
struct FragmentIn {
|
|
float4 color : LOC0;
|
|
};
|
|
|
|
ConstantBuffer<PushConstants> pc: register(b0);
|
|
|
|
struct FragmentInput_main {
|
|
float4 color : LOC0;
|
|
};
|
|
|
|
float4 vert_main(float2 pos : LOC0, uint ii : SV_InstanceID, uint vi : SV_VertexID) : SV_Position
|
|
{
|
|
float _e8 = pc.multiplier;
|
|
return float4((((float((_NagaConstants.first_instance + ii)) * float((_NagaConstants.first_vertex + vi))) * _e8) * pos), 0.0, 1.0);
|
|
}
|
|
|
|
float4 main(FragmentInput_main fragmentinput_main) : SV_Target0
|
|
{
|
|
FragmentIn in_ = { fragmentinput_main.color };
|
|
float _e4 = pc.multiplier;
|
|
return (in_.color * _e4);
|
|
}
|