Fixed most vulkan validation layers

This commit is contained in:
antopilo
2025-04-15 19:33:46 -04:00
parent 710d63ad98
commit a46ee129f0
23 changed files with 59 additions and 50 deletions

View File

@@ -80,7 +80,8 @@ struct CameraView {
[[vk::binding(0, 6)]]
StructuredBuffer<CameraView> cameras;
struct PSInput {
struct PSInput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};

View File

@@ -90,7 +90,8 @@ struct CopyPushConstant
CopyPushConstant pushConstants;
// Outputs
struct VSOutput {
struct VSOutput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};

View File

@@ -80,12 +80,14 @@ struct CameraView {
[[vk::binding(0, 6)]]
StructuredBuffer<CameraView> cameras;
struct PSInput {
struct PSInput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};
struct PSOutput {
struct PSOutput
{
float4 oColor0 : SV_TARGET;
float4 oEntityID : SV_TARGET1;
};

View File

@@ -92,7 +92,8 @@ struct DebugConstant
DebugConstant pushConstants;
// Outputs
struct VSOutput {
struct VSOutput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};

View File

@@ -80,12 +80,14 @@ struct CameraView {
[[vk::binding(0, 6)]]
StructuredBuffer<CameraView> cameras;
struct PSInput {
struct PSInput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};
struct PSOutput {
struct PSOutput
{
float4 oColor0 : SV_TARGET;
};

View File

@@ -90,7 +90,8 @@ struct LineConstant
LineConstant pushConstants;
// Outputs
struct VSOutput {
struct VSOutput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};

View File

@@ -80,7 +80,8 @@ struct CameraView {
[[vk::binding(0, 6)]]
StructuredBuffer<CameraView> cameras;
struct PSInput {
struct PSInput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};

View File

@@ -94,7 +94,8 @@ struct OutlinePushConstant
OutlinePushConstant pushConstants;
// Outputs
struct VSOutput {
struct VSOutput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};

View File

@@ -80,7 +80,8 @@ struct CameraView {
[[vk::binding(0, 6)]]
StructuredBuffer<CameraView> cameras;
struct PSInput {
struct PSInput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};

View File

@@ -97,7 +97,8 @@ struct ShadingPushConstant
ShadingPushConstant pushConstants;
// Outputs
struct VSOutput {
struct VSOutput
{
float4 Position : SV_Position;
float2 UV : TEXCOORD0;
};

View File

@@ -80,14 +80,11 @@ struct CameraView {
[[vk::binding(0, 6)]]
StructuredBuffer<CameraView> cameras;
struct PSInput {
struct PSInput
{
float4 Position : SV_Position;
};
struct PSOutput {
float4 oColor0 : SV_TARGET;
};
struct ModelPushConstant
{
int modelIndex; // Push constant data
@@ -98,8 +95,6 @@ struct ModelPushConstant
[[vk::push_constant]]
ModelPushConstant pushConstants;
PSOutput main(PSInput input)
void main(PSInput input)
{
PSOutput output;
return output;
}

View File

@@ -91,7 +91,8 @@ struct ModelPushConstant
ModelPushConstant pushConstants;
// Outputs
struct VSOutput {
struct VSOutput
{
float4 Position : SV_Position;
};

View File

@@ -16,7 +16,7 @@ cbuffer ubo : register(b0, space0) { UBO ubo; }
struct VSOutput
{
float4 Pos : SV_POSITION;
[[vk::location(0)]] float3 Color : COLOR0;
[[vk::location(0)]] float3 Color : COLOR0;
};
VSOutput main(VSInput input, uint VertexIndex : SV_VertexID)

View File

@@ -80,12 +80,13 @@ struct CameraView {
[[vk::binding(0, 6)]]
StructuredBuffer<CameraView> cameras;
struct PSInput {
struct PSInput
{
float4 Position : SV_Position;
float3 Color : TEXCOORD0;
float2 UV : TEXCOORD1;
float3 Normal : TEXCOORD2;
float3x3 TBN : TEXCOORD3;
//float3x3 TBN : TEXCOORD3;
};
struct PSOutput {
@@ -118,7 +119,7 @@ PSOutput main(PSInput input)
{
// Sample from texture.
}
normal = mul(input.TBN, normal);
//normal = mul(input.TBN, normal);
normal = input.Normal / 2.0f + 0.5f;
output.oNormal = float4(normal, 1.0f);

View File

@@ -92,12 +92,13 @@ struct ModelPushConstant
ModelPushConstant pushConstants;
// Outputs
struct VSOutput {
struct VSOutput
{
float4 Position : SV_Position;
float3 Color : TEXCOORD0;
float2 UV : TEXCOORD1;
float3 Normal : TEXCOORD2;
float3x3 TBN : TEXCOORD3;
//float3x3 TBN : TEXCOORD3;
};
// Main vertex shader
@@ -117,9 +118,9 @@ VSOutput main(uint vertexIndex : SV_VertexID)
output.UV = float2(v.uv_x, v.uv_y);
output.Normal = normalize(v.normal);
float3 T = normalize(mul((float3x3)modelData.model, normalize(v.tangent.xyz)));
float3 B = normalize(mul((float3x3)modelData.model, normalize(v.bitangent.xyz)));
float3 N = normalize(mul((float3x3)modelData.model, normalize(v.normal)).xyz);
output.TBN = transpose(float3x3(T, B, N));
//float3 T = normalize(mul((float3x3)modelData.model, normalize(v.tangent.xyz)));
//float3 B = normalize(mul((float3x3)modelData.model, normalize(v.bitangent.xyz)));
//float3 N = normalize(mul((float3x3)modelData.model, normalize(v.normal)).xyz);
//output.TBN = transpose(float3x3(T, B, N));
return output;
}