| … | … | @@ -269,10 +269,10 @@ layout(location = 0) rayPayloadInEXT PathPayload payload; |
| 269 | 269 | // the 2D table -- the only one that needs to scale -- stays unbounded and last. |
| 270 | 270 | // Keep these sizes in sync with BindlessBlock::TYPED_TABLE_CAPACITY, and the |
| 271 | 271 | // binding numbers with BindlessBlock::TextureKind. |
| 272 | | layout(set = 1, binding = 0) uniform texture2DArray bindless_textures_2d_array[256]; |
| 273 | | layout(set = 1, binding = 1) uniform texture3D bindless_textures_3d[256]; |
| 274 | | layout(set = 1, binding = 2) uniform textureCube bindless_textures_cube[256]; |
| 275 | | layout(set = 1, binding = 3) uniform textureCubeArray bindless_textures_cube_array[256]; |
| 272 | layout(set = 1, binding = 0) uniform texture2DArray bindless_textures_2d_array[32]; |
| 273 | layout(set = 1, binding = 1) uniform texture3D bindless_textures_3d[32]; |
| 274 | layout(set = 1, binding = 2) uniform textureCube bindless_textures_cube[32]; |
| 275 | layout(set = 1, binding = 3) uniform textureCubeArray bindless_textures_cube_array[32]; |
| 276 | 276 | layout(set = 1, binding = 4) uniform texture2D bindless_textures[]; |
| 277 | 277 | |
| 278 | 278 | #include "raytracing_samplers_inc.glsl" |
| … | … | @@ -327,10 +327,19 @@ void main() { |
| 327 | 327 | vec3 rt_hit_pos = h.hit_pos; |
| 328 | 328 | vec2 rt_uv = h.uv; |
| 329 | 329 | vec4 rt_color = h.color; |
| 330 | | vec4 rt_custom0 = h.custom[0]; |
| 331 | | vec4 rt_custom1 = h.custom[1]; |
| 332 | | vec4 rt_custom2 = h.custom[2]; |
| 333 | | vec4 rt_custom3 = h.custom[3]; |
| 330 | // Fetched here rather than carried through HitData/VertexAttributes: those |
| 331 | // structs are shared with the DEFAULT hit group, and four extra vec4s of |
| 332 | // live state cost register pressure (and so occupancy) on every hit shader, |
| 333 | // including the ones that never touch CUSTOM. fetch_custom early-outs on |
| 334 | // surfaces without the array, so this is cheap when unused. |
| 335 | GeometryData rt_cgeom = geometries[h.geometry_idx]; |
| 336 | uint rt_ci0, rt_ci1, rt_ci2; |
| 337 | get_triangle_indices(rt_cgeom, rt_ci0, rt_ci1, rt_ci2); |
| 338 | vec3 rt_cbary = vec3(1.0 - attribs.x - attribs.y, attribs.x, attribs.y); |
| 339 | vec4 rt_custom0 = fetch_custom(rt_cgeom, 0u, rt_ci0, rt_ci1, rt_ci2, rt_cbary); |
| 340 | vec4 rt_custom1 = fetch_custom(rt_cgeom, 1u, rt_ci0, rt_ci1, rt_ci2, rt_cbary); |
| 341 | vec4 rt_custom2 = fetch_custom(rt_cgeom, 2u, rt_ci0, rt_ci1, rt_ci2, rt_cbary); |
| 342 | vec4 rt_custom3 = fetch_custom(rt_cgeom, 3u, rt_ci0, rt_ci1, rt_ci2, rt_cbary); |
| 334 | 343 | vec3 rt_normal = h.geometry_normal; |
| 335 | 344 | vec3 rt_tangent = h.tangent; |
| 336 | 345 | vec3 rt_bitangent = h.bitangent; |
| … | … | @@ -477,10 +486,10 @@ layout(set = 0, binding = 5, std430) readonly buffer MaterialBuffer { |
| 477 | 486 | // the 2D table -- the only one that needs to scale -- stays unbounded and last. |
| 478 | 487 | // Keep these sizes in sync with BindlessBlock::TYPED_TABLE_CAPACITY, and the |
| 479 | 488 | // binding numbers with BindlessBlock::TextureKind. |
| 480 | | layout(set = 1, binding = 0) uniform texture2DArray bindless_textures_2d_array[256]; |
| 481 | | layout(set = 1, binding = 1) uniform texture3D bindless_textures_3d[256]; |
| 482 | | layout(set = 1, binding = 2) uniform textureCube bindless_textures_cube[256]; |
| 483 | | layout(set = 1, binding = 3) uniform textureCubeArray bindless_textures_cube_array[256]; |
| 489 | layout(set = 1, binding = 0) uniform texture2DArray bindless_textures_2d_array[32]; |
| 490 | layout(set = 1, binding = 1) uniform texture3D bindless_textures_3d[32]; |
| 491 | layout(set = 1, binding = 2) uniform textureCube bindless_textures_cube[32]; |
| 492 | layout(set = 1, binding = 3) uniform textureCubeArray bindless_textures_cube_array[32]; |
| 484 | 493 | layout(set = 1, binding = 4) uniform texture2D bindless_textures[]; |
| 485 | 494 | |
| 486 | 495 | #include "raytracing_samplers_inc.glsl" |
| … | … | @@ -614,10 +623,10 @@ layout(set = 0, binding = 5, std430) readonly buffer MaterialBuffer { |
| 614 | 623 | // the 2D table -- the only one that needs to scale -- stays unbounded and last. |
| 615 | 624 | // Keep these sizes in sync with BindlessBlock::TYPED_TABLE_CAPACITY, and the |
| 616 | 625 | // binding numbers with BindlessBlock::TextureKind. |
| 617 | | layout(set = 1, binding = 0) uniform texture2DArray bindless_textures_2d_array[256]; |
| 618 | | layout(set = 1, binding = 1) uniform texture3D bindless_textures_3d[256]; |
| 619 | | layout(set = 1, binding = 2) uniform textureCube bindless_textures_cube[256]; |
| 620 | | layout(set = 1, binding = 3) uniform textureCubeArray bindless_textures_cube_array[256]; |
| 626 | layout(set = 1, binding = 0) uniform texture2DArray bindless_textures_2d_array[32]; |
| 627 | layout(set = 1, binding = 1) uniform texture3D bindless_textures_3d[32]; |
| 628 | layout(set = 1, binding = 2) uniform textureCube bindless_textures_cube[32]; |
| 629 | layout(set = 1, binding = 3) uniform textureCubeArray bindless_textures_cube_array[32]; |
| 621 | 630 | layout(set = 1, binding = 4) uniform texture2D bindless_textures[]; |
| 622 | 631 | |
| 623 | 632 | #include "raytracing_samplers_inc.glsl" |