|
1 | 1 | /* |
2 | | - * Copyright 2019-2022 Diligent Graphics LLC |
| 2 | + * Copyright 2019-2025 Diligent Graphics LLC |
3 | 3 | * Copyright 2015-2019 Egor Yusov |
4 | 4 | * |
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -44,8 +44,12 @@ struct RTPayload |
44 | 44 | // clang-format off |
45 | 45 | const std::string RayTracingTest1_RG = RayTracingTest_Payload + |
46 | 46 | R"hlsl( |
47 | | -RaytracingAccelerationStructure g_TLAS : register(t0); |
48 | | -RWTexture2D<float4> g_ColorBuffer : register(u0); |
| 47 | +RaytracingAccelerationStructure g_TLAS : register(t0); |
| 48 | +
|
| 49 | +#ifdef VULKAN |
| 50 | +[[vk::image_format("rgba8")]] |
| 51 | +#endif |
| 52 | +RWTexture2D<float4> g_ColorBuffer : register(u0); |
49 | 53 |
|
50 | 54 | [shader("raygeneration")] |
51 | 55 | void main() |
@@ -94,8 +98,12 @@ void main(inout RTPayload payload, in BuiltInTriangleIntersectionAttributes attr |
94 | 98 |
|
95 | 99 | const std::string RayTracingTest2_RG = RayTracingTest_Payload + |
96 | 100 | R"hlsl( |
97 | | -RaytracingAccelerationStructure g_TLAS : register(t0); |
98 | | -RWTexture2D<float4> g_ColorBuffer : register(u0); |
| 101 | +RaytracingAccelerationStructure g_TLAS : register(t0); |
| 102 | +
|
| 103 | +#ifdef VULKAN |
| 104 | +[[vk::image_format("rgba8")]] |
| 105 | +#endif |
| 106 | +RWTexture2D<float4> g_ColorBuffer : register(u0); |
99 | 107 |
|
100 | 108 | [shader("raygeneration")] |
101 | 109 | void main() |
@@ -156,8 +164,12 @@ void main(inout RTPayload payload, in BuiltInTriangleIntersectionAttributes attr |
156 | 164 |
|
157 | 165 | const std::string RayTracingTest3_RG = RayTracingTest_Payload + |
158 | 166 | R"hlsl( |
159 | | -RaytracingAccelerationStructure g_TLAS : register(t0); |
160 | | -RWTexture2D<float4> g_ColorBuffer : register(u0); |
| 167 | +RaytracingAccelerationStructure g_TLAS : register(t0); |
| 168 | +
|
| 169 | +#ifdef VULKAN |
| 170 | +[[vk::image_format("rgba8")]] |
| 171 | +#endif |
| 172 | +RWTexture2D<float4> g_ColorBuffer : register(u0); |
161 | 173 |
|
162 | 174 | [shader("raygeneration")] |
163 | 175 | void main() |
@@ -239,8 +251,12 @@ void main() |
239 | 251 |
|
240 | 252 | const std::string RayTracingTest4_RG = RayTracingTest_Payload + |
241 | 253 | R"hlsl( |
242 | | -RaytracingAccelerationStructure g_TLAS : register(t0); |
243 | | -RWTexture2D<float4> g_ColorBuffer : register(u0); |
| 254 | +RaytracingAccelerationStructure g_TLAS : register(t0); |
| 255 | +
|
| 256 | +#ifdef VULKAN |
| 257 | +[[vk::image_format("rgba8")]] |
| 258 | +#endif |
| 259 | +RWTexture2D<float4> g_ColorBuffer : register(u0); |
244 | 260 |
|
245 | 261 | [shader("raygeneration")] |
246 | 262 | void main() |
@@ -336,7 +352,11 @@ void main(inout RTPayload payload, in BuiltInTriangleIntersectionAttributes attr |
336 | 352 | const std::string RayTracingTest5_RG = RayTracingTest_Payload + |
337 | 353 | R"hlsl( |
338 | 354 | RaytracingAccelerationStructure g_TLAS; |
339 | | -RWTexture2D<float4> g_ColorBuffer; |
| 355 | +
|
| 356 | +#ifdef VULKAN |
| 357 | +[[vk::image_format("rgba8")]] |
| 358 | +#endif |
| 359 | +RWTexture2D<float4> g_ColorBuffer; |
340 | 360 |
|
341 | 361 | [shader("raygeneration")] |
342 | 362 | void main() |
@@ -421,7 +441,11 @@ void main(inout RTPayload payload, in BuiltInTriangleIntersectionAttributes attr |
421 | 441 |
|
422 | 442 | const std::string RayTracingTest6_RG{R"hlsl( |
423 | 443 | RaytracingAccelerationStructure g_TLAS; |
424 | | -RWTexture2D<float4> g_ColorBuffer; |
| 444 | +
|
| 445 | +#ifdef VULKAN |
| 446 | +[[vk::image_format("rgba8")]] |
| 447 | +#endif |
| 448 | +RWTexture2D<float4> g_ColorBuffer; |
425 | 449 |
|
426 | 450 | float4 HitShader(float2 attrBarycentrics) |
427 | 451 | { |
@@ -538,7 +562,11 @@ float4 main(in PSInput PSIn) : SV_Target |
538 | 562 |
|
539 | 563 | const std::string RayTracingTest8_CS{R"hlsl( |
540 | 564 | RaytracingAccelerationStructure g_TLAS; |
541 | | -RWTexture2D<float4> g_ColorBuffer; |
| 565 | +
|
| 566 | +#ifdef VULKAN |
| 567 | +[[vk::image_format("rgba8")]] |
| 568 | +#endif |
| 569 | +RWTexture2D<float4> g_ColorBuffer; |
542 | 570 |
|
543 | 571 | float4 HitShader(float2 attrBarycentrics) |
544 | 572 | { |
|
0 commit comments