Shaders now compile all the way to OpenGL

This commit is contained in:
2024-12-24 16:06:55 -06:00
parent e10aea20a1
commit f5958f2879
19 changed files with 190 additions and 35 deletions

View File

@ -1,11 +1,7 @@
struct MVP {
struct Uniforms {
float4x4 projection;
float4x4 view;
float4x4 model;
}
struct Uniforms {
MVP mvp;
float4 u_Color;
bool u_HasTexture;
Sampler2D u_Texture;
@ -29,9 +25,10 @@ float4 someFunction(float4 color) {
return color * float4(0.5, 0.5, 0.5, 1.0);
}
uniform ParameterBlock<Uniforms> uniforms;
[shader("vertex")]
VertexStageOutput vertexMain(
uniform ParameterBlock<Uniforms> uniforms,
AssembledVertex assembledVertex
) {
VertexStageOutput output;
@ -42,7 +39,7 @@ VertexStageOutput vertexMain(
output.sv_position = mul(
float4(position, 1.0),
mul(uniforms.mvp.model, mul(uniforms.mvp.view, uniforms.mvp.projection))
mul(uniforms.model, mul(uniforms.view, uniforms.projection))
);
return output;
@ -50,7 +47,6 @@ VertexStageOutput vertexMain(
[shader("fragment")]
Fragment fragmentMain(
uniform ParameterBlock<Uniforms> uniforms,
float2 uv: UV
) : SV_Target {
Fragment output;