Code cleanup, fixed HLSL shaders

This commit is contained in:
Sascha Willems 2024-01-14 10:24:55 +01:00
parent 6444281e34
commit 7ad9ee1dc3
16 changed files with 274 additions and 408 deletions

View file

@ -2,11 +2,12 @@
layout (triangles, fractional_odd_spacing, cw) in;
layout (binding = 1) uniform UBO
layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 model;
float tessAlpha;
float tessLevel;
} ubo;
layout (location = 0) in vec3 inNormal[];

View file

@ -18,7 +18,10 @@ struct PnPatch
// tessellation levels
layout (binding = 0) uniform UBO
{
float tessLevel;
mat4 projection;
mat4 model;
float tessAlpha;
float tessLevel;
} ubo;
layout(vertices=3) out;

View file

@ -15,11 +15,12 @@ struct PnPatch
float n101;
};
layout (binding = 1) uniform UBO
layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 model;
float tessAlpha;
float tessLevel;
} ubo;
layout(triangles, fractional_odd_spacing, cw) in;

View file

@ -1,7 +1,7 @@
// Copyright 2020 Google LLC
Texture2D textureColorMap : register(t2);
SamplerState samplerColorMap : register(s2);
Texture2D textureColorMap : register(t0, space1);
SamplerState samplerColorMap : register(s0, space1);
struct DSOutput
{

View file

@ -2,12 +2,13 @@
struct UBO
{
float4x4 projection;
float4x4 model;
float tessAlpha;
float4x4 projection;
float4x4 model;
float tessAlpha;
float tessLevel;
};
cbuffer ubo : register(b1) { UBO ubo; }
cbuffer ubo : register(b0) { UBO ubo; }
struct HSOutput
{

View file

@ -18,7 +18,10 @@ struct PnPatch
// tessellation levels
struct UBO
{
float tessLevel;
float4x4 projection;
float4x4 model;
float tessAlpha;
float tessLevel;
};
cbuffer ubo : register(b0) { UBO ubo; }
@ -83,7 +86,7 @@ ConstantsHSOutput ConstantsHS(InputPatch<VSOutput, 3> patch, uint InvocationID :
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_ccw")]
[outputtopology("triangle_cw")]
[outputcontrolpoints(3)]
[patchconstantfunc("ConstantsHS")]
[maxtessfactor(20.0f)]

View file

@ -20,9 +20,10 @@ struct UBO
float4x4 projection;
float4x4 model;
float tessAlpha;
float tessLevel;
};
cbuffer ubo : register(b1) { UBO ubo; }
cbuffer ubo : register(b0) { UBO ubo; }
struct HSOutput
{