Skip to content

Commit 7379bc3

Browse files
[Rendering] WIP Slang support;
1 parent 31fe935 commit 7379bc3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3316
-767
lines changed

BuiltinResources/Hidden/Shaders/Default/SolidColor.shader

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,49 @@ End Parameters
99
Begin Instancing
1010
End Instancing
1111

12-
Begin Vertex
12+
Begin Common
1313

14-
struct Input
14+
cbuffer Uniforms
1515
{
16-
float3 Position : TEXCOORD0;
16+
float4 mainColor;
1717
};
1818

19-
struct Output
19+
struct VertexOutput
2020
{
21-
float4 Position : SV_Position;
22-
}
21+
float4 position : SV_Position;
22+
float4 color;
23+
};
24+
25+
End Common
26+
27+
Begin Vertex
28+
29+
struct Input
30+
{
31+
float3 position : POSITION;
32+
};
2333

24-
Output main(Input input)
34+
[shader("vertex")]
35+
VertexOutput VertexMain(Input input)
2536
{
26-
Output output;
27-
28-
float4x4 model = StapleModelMatrix;
37+
VertexOutput output;
2938

30-
float4x4 projViewWorld = mul(mul(u_proj, u_view), model);
39+
float3 position = input.position;
40+
float4 color = mainColor;
3141

32-
float4 v_pos = mul(projViewWorld, float4(a_position, 1.0));
42+
output.color = color;
43+
output.position = mul(mul(mul(projection, view), world), float4(position, 1.0));
3344

34-
output.position = v_pos;
45+
return output;
3546
}
36-
3747
End Vertex
3848

3949
Begin Fragment
4050

41-
float4 main() : SV_Target0
51+
[shader("fragment")]
52+
float4 FragmentMain(VertexOutput input) : SV_Target
4253
{
43-
return mainColor;
54+
return input.color;
4455
}
4556

4657
End Fragment

Dependencies/slang/Windows/gfx.dll

2.12 MB
Binary file not shown.

0 commit comments

Comments
 (0)