mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 04:30:10 +01:00
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>
(cherry picked from commit ff145d2ddc)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38268>
This commit is contained in:
parent
7c18540961
commit
d527eedb15
6 changed files with 10 additions and 6 deletions
|
|
@ -304,7 +304,7 @@
|
|||
"description": "lavapipe: Bump maxPrimitiveCount",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1271,8 +1271,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,
|
||||
|
|
|
|||
|
|
@ -107,6 +107,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
|
||||
|
|
|
|||
|
|
@ -356,7 +356,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");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue