Fix some vulkan warnings
This commit is contained in:
@@ -23,7 +23,7 @@ struct RayPayload {
|
||||
float3 ray_dir;
|
||||
};
|
||||
|
||||
RWTexture2D<float4> render_target : register(u0);
|
||||
RWTexture2D<half4> render_target : register(u0);
|
||||
RaytracingAccelerationStructure scene : register(t0);
|
||||
ByteAddressBuffer indices : register(t1);
|
||||
StructuredBuffer<Vertex> vertices : register(t2);
|
||||
@@ -45,7 +45,7 @@ void raygeneration() {
|
||||
float2 xy = DispatchRaysIndex().xy + 0.5f;
|
||||
float4 tex0 = mytexture0.Load(uint3(xy, 0));
|
||||
if (tex0.a == 0.0) {
|
||||
render_target[DispatchRaysIndex().xy] = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
return;
|
||||
}
|
||||
float3 pos = tex0.rgb;
|
||||
@@ -78,7 +78,7 @@ void raygeneration() {
|
||||
float b = 1.0 - a;
|
||||
color = color * b + accum.xyz * a;
|
||||
}
|
||||
render_target[DispatchRaysIndex().xy] = float4(color.xyz, 1.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(color.xyz, 1.0f);
|
||||
}
|
||||
|
||||
[shader("closesthit")]
|
||||
|
||||
@@ -23,7 +23,7 @@ struct RayPayload {
|
||||
float3 ray_dir;
|
||||
};
|
||||
|
||||
RWTexture2D<float4> render_target : register(u0);
|
||||
RWTexture2D<half4> render_target : register(u0);
|
||||
RaytracingAccelerationStructure scene : register(t0);
|
||||
ByteAddressBuffer indices : register(t1);
|
||||
StructuredBuffer<Vertex> vertices : register(t2);
|
||||
@@ -45,7 +45,7 @@ void raygeneration() {
|
||||
float2 xy = DispatchRaysIndex().xy + 0.5f;
|
||||
float4 tex0 = mytexture0.Load(uint3(xy, 0));
|
||||
if (tex0.a == 0.0) {
|
||||
render_target[DispatchRaysIndex().xy] = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
return;
|
||||
}
|
||||
float3 pos = tex0.rgb;
|
||||
@@ -80,7 +80,7 @@ void raygeneration() {
|
||||
float b = 1.0 - a;
|
||||
color = color * b + accum.xyz * a;
|
||||
}
|
||||
render_target[DispatchRaysIndex().xy] = float4(color.xyz, 1.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(color.xyz, 1.0f);
|
||||
}
|
||||
|
||||
[shader("closesthit")]
|
||||
|
||||
@@ -24,7 +24,7 @@ struct RayPayload {
|
||||
float3 ray_dir;
|
||||
};
|
||||
|
||||
RWTexture2D<float4> render_target : register(u0);
|
||||
RWTexture2D<half4> render_target : register(u0);
|
||||
RaytracingAccelerationStructure scene : register(t0);
|
||||
ByteAddressBuffer indices : register(t1);
|
||||
StructuredBuffer<Vertex> vertices : register(t2);
|
||||
@@ -46,7 +46,7 @@ void raygeneration() {
|
||||
float2 xy = DispatchRaysIndex().xy + 0.5f;
|
||||
float4 tex0 = mytexture0.Load(uint3(xy, 0));
|
||||
if (tex0.a == 0.0) {
|
||||
render_target[DispatchRaysIndex().xy] = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
return;
|
||||
}
|
||||
float3 pos = tex0.rgb;
|
||||
@@ -82,7 +82,7 @@ void raygeneration() {
|
||||
float b = 1.0 - a;
|
||||
color = color * b + accum.xyz * a;
|
||||
}
|
||||
render_target[DispatchRaysIndex().xy] = float4(color.xyz, 1.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(color.xyz, 1.0f);
|
||||
}
|
||||
|
||||
[shader("closesthit")]
|
||||
|
||||
@@ -23,7 +23,7 @@ struct RayPayload {
|
||||
float3 ray_dir;
|
||||
};
|
||||
|
||||
RWTexture2D<float4> render_target : register(u0);
|
||||
RWTexture2D<half4> render_target : register(u0);
|
||||
RaytracingAccelerationStructure scene : register(t0);
|
||||
ByteAddressBuffer indices : register(t1);
|
||||
StructuredBuffer<Vertex> vertices : register(t2);
|
||||
@@ -45,7 +45,7 @@ void raygeneration() {
|
||||
float2 xy = DispatchRaysIndex().xy + 0.5f;
|
||||
float4 tex0 = mytexture0.Load(uint3(xy, 0));
|
||||
if (tex0.a == 0.0) {
|
||||
render_target[DispatchRaysIndex().xy] = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
return;
|
||||
}
|
||||
float3 pos = tex0.rgb;
|
||||
@@ -79,7 +79,7 @@ void raygeneration() {
|
||||
float b = 1.0 - a;
|
||||
color = color * b + accum.xyz * a;
|
||||
}
|
||||
render_target[DispatchRaysIndex().xy] = float4(color.xyz, 1.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(color.xyz, 1.0f);
|
||||
}
|
||||
|
||||
[shader("closesthit")]
|
||||
|
||||
@@ -32,7 +32,7 @@ struct RayPayload {
|
||||
float3 ray_dir;
|
||||
};
|
||||
|
||||
RWTexture2D<float4> render_target : register(u0);
|
||||
RWTexture2D<half4> render_target : register(u0);
|
||||
RaytracingAccelerationStructure scene : register(t0);
|
||||
ByteAddressBuffer indices : register(t1);
|
||||
StructuredBuffer<Vertex> vertices : register(t2);
|
||||
@@ -145,14 +145,14 @@ void raygeneration() {
|
||||
float a = 1.0 / (constant_buffer.eye.w + 1);
|
||||
float b = 1.0 - a;
|
||||
color = color * b + accum * a;
|
||||
render_target[DispatchRaysIndex().xy] = float4(color, 0.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(color, 0.0f);
|
||||
|
||||
#else
|
||||
|
||||
if (constant_buffer.eye.w == 0) {
|
||||
color = accum;
|
||||
}
|
||||
render_target[DispatchRaysIndex().xy] = float4(lerp(color, accum, 1.0 / 4.0), 0.0f);
|
||||
render_target[DispatchRaysIndex().xy] = half4(lerp(color, accum, 1.0 / 4.0), 0.0f);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user