Skip to content

Commit 0fa68c9

Browse files
committed
Clean up existing shaders
Remove attributes not required by Slang
1 parent 7b7a8b2 commit 0fa68c9

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

shaders/profiles/slang/profiles.frag.slang

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
*/
1717

1818
[[vk::binding(1, 0)]]
19-
Sampler2D textures[] : register(t1, space0);
19+
Sampler2D textures[];
2020

2121
struct VSOutput
2222
{
2323
float4 Pos : SV_POSITION;
24-
[[vk::location(0)]] float2 UV : TEXCOORD0;
25-
[[vk::location(1)]] nointerpolation int TexIndex : TEXCOORD1;
24+
float2 UV;
25+
nointerpolation int TexIndex;
2626
};
2727

2828
[shader("fragment")]
29-
float4 main(VSOutput input) : SV_TARGET
29+
float4 main(VSOutput input)
3030
{
3131
return textures[NonUniformResourceIndex(input.TexIndex)].Sample(input.UV);
3232
}

shaders/profiles/slang/profiles.vert.slang

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,28 @@
1919
struct VSInput
2020
{
2121
[[vk::location(0)]] float3 Pos : POSITION0;
22-
[[vk::location(1)]] float2 UV : TEXCOORD0;
23-
[[vk::location(2)]] int TexIndex : TEXCOORD1;
22+
[[vk::location(1)]] float2 UV;
23+
[[vk::location(2)]] int TexIndex;
2424
};
2525

2626
struct UBO
2727
{
2828
float4x4 projection;
2929
float4x4 view;
3030
};
31-
[[vk::binding(0, 0)]]
32-
ConstantBuffer<UBO> ubo : register(b0, space0);
31+
ConstantBuffer<UBO> ubo;
3332

3433
struct VSOutput
3534
{
3635
float4 Pos : SV_POSITION;
37-
[[vk::location(0)]] float2 UV : TEXCOORD0;
38-
[[vk::location(1)]] nointerpolation int TexIndex : TEXCOORD1;
36+
[[vk::location(0)]] float2 UV;
37+
[[vk::location(1)]] nointerpolation int TexIndex;
3938
};
4039

4140
[shader("vertex")]
4241
VSOutput main(VSInput input)
4342
{
44-
VSOutput output = (VSOutput) 0;
43+
VSOutput output;
4544
output.UV = input.UV;
4645
output.TexIndex = input.TexIndex;
4746
output.Pos = mul(ubo.projection, mul(ubo.view, float4(input.Pos.xyz, 1.0)));
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)