Code cleanup, simplified descriptor setup

This commit is contained in:
Sascha Willems 2024-01-15 19:12:06 +01:00
parent 53bb3d63f0
commit 668b9c9b57
13 changed files with 102 additions and 195 deletions

View file

@ -1,6 +1,6 @@
#version 450
layout (binding = 2) uniform sampler2D colorMap;
layout (binding = 1) uniform sampler2D colorMap;
layout (location = 0) in vec3 inNormal;
layout (location = 1) in vec2 inUV;

View file

@ -2,6 +2,11 @@
layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 modelview;
vec4 lightPos;
float tessAlpha;
float tessStrength;
float tessLevel;
} ubo;

View file

@ -1,15 +1,16 @@
#version 450
layout (binding = 1) uniform UBO
layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 modelview;
vec4 lightPos;
float tessAlpha;
float tessStrength;
float tessLevel;
} ubo;
layout (binding = 2) uniform sampler2D displacementMap;
layout (binding = 1) uniform sampler2D displacementMap;
layout(triangles, equal_spacing, cw) in;

View file

@ -1,7 +1,8 @@
// Copyright 2020 Google LLC
// Copyright 2023 Sascha Willems
Texture2D textureColorMap : register(t2);
SamplerState samplerColorMap : register(s2);
Texture2D textureColorMap : register(t1);
SamplerState samplerColorMap : register(s1);
struct DSOutput
{

View file

@ -1,7 +1,13 @@
// Copyright 2020 Google LLC
// Copyright 2023 Sascha Willems
struct UBO
{
float4x4 projection;
float4x4 model;
float4 lightPos;
float tessAlpha;
float tessStrength;
float tessLevel;
};

View file

@ -1,4 +1,5 @@
// Copyright 2020 Google LLC
// Copyright 2023 Sascha Willems
struct UBO
{
@ -7,12 +8,13 @@ struct UBO
float4 lightPos;
float tessAlpha;
float tessStrength;
float tessLevel;
};
cbuffer ubo : register(b1) { UBO ubo; }
cbuffer ubo : register(b0) { UBO ubo; }
Texture2D textureDisplacementMap : register(t2);
SamplerState samplerDisplacementMap : register(s2);
Texture2D textureDisplacementMap : register(t1);
SamplerState samplerDisplacementMap : register(s1);
struct HSOutput
{