lavapipe: Bump maxPrimitiveCount

The vulkan spec requires at least 2^29-1.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14212
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38197>
This commit is contained in:
Konstantin Seurer 2025-10-31 09:11:17 +01:00
parent 9334b5659c
commit ff145d2ddc
5 changed files with 9 additions and 5 deletions

View file

@ -574,7 +574,7 @@ lvp_encode_as(struct vk_acceleration_structure *dst, VkDeviceAddress intermediat
/* The BVH exceeds the maximum depth supported by the traversal stack,
* flatten the offending parts of the tree.
*/
if (max_node_depth >= 24)
if (max_node_depth >= (geometry_type == VK_GEOMETRY_TYPE_INSTANCES_KHR ? LVP_MAX_TLAS_DEPTH : LVP_MAX_BLAS_DEPTH))
lvp_flatten_as(header, ir_box_nodes, root_offset, node_depth, output);
free(node_depth);

View file

@ -1274,8 +1274,8 @@ lvp_get_properties(const struct lvp_physical_device *device, struct vk_propertie
/* VK_KHR_acceleration_structure */
.maxGeometryCount = (1 << 24) - 1,
.maxInstanceCount = (1 << 24) - 1,
.maxPrimitiveCount = (1 << 24) - 1,
.maxInstanceCount = (1 << LVP_MAX_TLAS_DEPTH) - 1,
.maxPrimitiveCount = (1 << LVP_MAX_BLAS_DEPTH) - 1,
.maxPerStageDescriptorAccelerationStructures = MAX_DESCRIPTORS,
.maxPerStageDescriptorUpdateAfterBindAccelerationStructures = MAX_DESCRIPTORS,
.maxDescriptorSetAccelerationStructures = MAX_DESCRIPTORS,

View file

@ -108,6 +108,9 @@ extern "C" {
/* Currently lavapipe does not support more than 1 image plane */
#define LVP_MAX_PLANE_COUNT 1
#define LVP_MAX_TLAS_DEPTH 24
#define LVP_MAX_BLAS_DEPTH 29
#ifdef _WIN32
#define lvp_printflike(a, b)
#else

View file

@ -358,7 +358,7 @@ lvp_ray_traversal_state_init(nir_function_impl *impl, struct lvp_ray_traversal_s
state->current_node = nir_local_variable_create(impl, glsl_uint_type(), "traversal.current_node");
state->stack_base = nir_local_variable_create(impl, glsl_uint_type(), "traversal.stack_base");
state->stack_ptr = nir_local_variable_create(impl, glsl_uint_type(), "traversal.stack_ptr");
state->stack = nir_local_variable_create(impl, glsl_array_type(glsl_uint_type(), 24 * 2, 0), "traversal.stack");
state->stack = nir_local_variable_create(impl, glsl_array_type(glsl_uint_type(), LVP_MAX_TLAS_DEPTH + LVP_MAX_BLAS_DEPTH, 0), "traversal.stack");
state->hit = nir_local_variable_create(impl, glsl_bool_type(), "traversal.hit");
state->instance_addr = nir_local_variable_create(impl, glsl_uint64_t_type(), "traversal.instance_addr");

View file

@ -171,7 +171,8 @@ init_ray_query_traversal_vars(void *ctx, nir_shader *shader, unsigned array_leng
result.stack_base =
rq_variable_create(ctx, shader, array_length, glsl_uint_type(), VAR_NAME("_stack_base"));
result.stack_ptr = rq_variable_create(ctx, shader, array_length, glsl_uint_type(), VAR_NAME("_stack_ptr"));
result.stack = rq_variable_create(ctx, shader, array_length, glsl_array_type(glsl_uint_type(), 24 * 2, 0), VAR_NAME("_stack"));
result.stack = rq_variable_create(ctx, shader, array_length,
glsl_array_type(glsl_uint_type(), LVP_MAX_TLAS_DEPTH + LVP_MAX_BLAS_DEPTH, 0), VAR_NAME("_stack"));
return result;
}