Skip to content

Commit 41cc14e

Browse files
Tutorial 22: fixed Vulkan validation errors
1 parent e77b05d commit 41cc14e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Tutorials/Tutorial22_HybridRendering/assets/RayTracing.csh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
# define TEXTURE(Name) const texture2d<float> Name
2525
# define TEXTURE_ARRAY(Name, Size) const array<texture2d<float>, Size> Name
26-
# define WTEXTURE(Name) texture2d<float, access::write> Name
26+
# define WTEXTURE(Name, Format) texture2d<float, access::write> Name
2727
# define SAMPLER_ARRAY(Name, Size) const array<sampler, Size> Name
2828
# define BUFFER(Name, Type) const device Type* Name
2929
# define CONSTANT_BUFFER(Name, Type) constant GlobalConstants& Name
@@ -33,12 +33,12 @@
3333
# define TextureStore(Texture, u2Coord, f4Value) Texture[u2Coord] = f4Value
3434
# define TextureDimensions(Texture, Dim) Texture.GetDimensions(Dim.x, Dim.y)
3535

36-
# define TEXTURE(Name) Texture2D<float4> Name
37-
# define TEXTURE_ARRAY(Name, Size) Texture2D<float4> Name[Size]
38-
# define WTEXTURE(Name) RWTexture2D<float4> Name
39-
# define SAMPLER_ARRAY(Name, Size) SamplerState Name[Size]
40-
# define BUFFER(Name, Type) StructuredBuffer<Type> Name
41-
# define CONSTANT_BUFFER(Name, Type) ConstantBuffer<Type> Name
36+
# define TEXTURE(Name) Texture2D<float4> Name
37+
# define TEXTURE_ARRAY(Name, Size) Texture2D<float4> Name[Size]
38+
# define WTEXTURE(Name, Format) VK_IMAGE_FORMAT(Format) RWTexture2D<float4> Name
39+
# define SAMPLER_ARRAY(Name, Size) SamplerState Name[Size]
40+
# define BUFFER(Name, Type) StructuredBuffer<Type> Name
41+
# define CONSTANT_BUFFER(Name, Type) ConstantBuffer<Type> Name
4242
#endif
4343

4444
// Returns 0 when occluder is found, and 1 otherwise
@@ -213,7 +213,7 @@ BEGIN_SHADER_DECLARATION(CSMain)
213213
SAMPLER_ARRAY( g_Samplers, NUM_SAMPLERS) MTL_BINDING(sampler, 0) END_ARG
214214
215215
// m_pRayTracingScreenResourcesSign
216-
WTEXTURE( g_RayTracedTex) MTL_BINDING(texture, 5) END_ARG
216+
WTEXTURE( g_RayTracedTex, "rgba16f") MTL_BINDING(texture, 5) END_ARG
217217
TEXTURE( g_GBuffer_Normal) MTL_BINDING(texture, 6) END_ARG
218218
TEXTURE( g_GBuffer_Depth) MTL_BINDING(texture, 7) END_ARG
219219

0 commit comments

Comments
 (0)