From b0b81b279cfa7134f5dd708898b26b8bf0cca2bf Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 29 May 2023 16:30:24 +1000 Subject: [PATCH] llvmpipe: resize arrays to handle mesh shaders. This just bumps some limits. Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/drivers/llvmpipe/lp_context.c | 2 +- src/gallium/drivers/llvmpipe/lp_context.h | 16 ++++++++-------- src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 +- src/gallium/drivers/llvmpipe/lp_state_sampler.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c index 301a132c9c0..967c23e04cd 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.c +++ b/src/gallium/drivers/llvmpipe/lp_context.c @@ -78,7 +78,7 @@ llvmpipe_destroy(struct pipe_context *pipe) util_unreference_framebuffer_state(&llvmpipe->framebuffer); - for (enum pipe_shader_type s = PIPE_SHADER_VERTEX; s < PIPE_SHADER_TYPES; s++) { + for (enum pipe_shader_type s = PIPE_SHADER_VERTEX; s < PIPE_SHADER_MESH_TYPES; s++) { for (i = 0; i < ARRAY_SIZE(llvmpipe->sampler_views[0]); i++) { pipe_sampler_view_reference(&llvmpipe->sampler_views[s][i], NULL); } diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index 95e9a1e9709..0b77fa3aa53 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -61,7 +61,7 @@ struct llvmpipe_context { struct list_head list; /** Constant state objects */ const struct pipe_blend_state *blend; - struct pipe_sampler_state *samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; + struct pipe_sampler_state *samplers[PIPE_SHADER_MESH_TYPES][PIPE_MAX_SAMPLERS]; const struct pipe_depth_stencil_alpha_state *depth_stencil; const struct pipe_rasterizer_state *rasterizer; @@ -80,21 +80,21 @@ struct llvmpipe_context { struct pipe_blend_color blend_color; struct pipe_stencil_ref stencil_ref; struct pipe_clip_state clip; - struct pipe_constant_buffer constants[PIPE_SHADER_TYPES][LP_MAX_TGSI_CONST_BUFFERS]; + struct pipe_constant_buffer constants[PIPE_SHADER_MESH_TYPES][LP_MAX_TGSI_CONST_BUFFERS]; struct pipe_framebuffer_state framebuffer; struct pipe_poly_stipple poly_stipple; struct pipe_scissor_state scissors[PIPE_MAX_VIEWPORTS]; - struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS]; + struct pipe_sampler_view *sampler_views[PIPE_SHADER_MESH_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS]; struct pipe_viewport_state viewports[PIPE_MAX_VIEWPORTS]; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; - struct pipe_shader_buffer ssbos[PIPE_SHADER_TYPES][LP_MAX_TGSI_SHADER_BUFFERS]; - struct pipe_image_view images[PIPE_SHADER_TYPES][LP_MAX_TGSI_SHADER_IMAGES]; + struct pipe_shader_buffer ssbos[PIPE_SHADER_MESH_TYPES][LP_MAX_TGSI_SHADER_BUFFERS]; + struct pipe_image_view images[PIPE_SHADER_MESH_TYPES][LP_MAX_TGSI_SHADER_IMAGES]; uint32_t fs_ssbo_write_mask; - unsigned num_samplers[PIPE_SHADER_TYPES]; - unsigned num_sampler_views[PIPE_SHADER_TYPES]; - unsigned num_images[PIPE_SHADER_TYPES]; + unsigned num_samplers[PIPE_SHADER_MESH_TYPES]; + unsigned num_sampler_views[PIPE_SHADER_MESH_TYPES]; + unsigned num_images[PIPE_SHADER_MESH_TYPES]; unsigned num_vertex_buffers; diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 31d5db0d6e5..8517703da1d 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -4173,7 +4173,7 @@ llvmpipe_set_constant_buffer(struct pipe_context *pipe, struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); struct pipe_constant_buffer *constants = &llvmpipe->constants[shader][index]; - assert(shader < PIPE_SHADER_TYPES); + assert(shader < PIPE_SHADER_MESH_TYPES); assert(index < ARRAY_SIZE(llvmpipe->constants[shader])); /* note: reference counting */ diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c index 785f0f16c24..733595938d2 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c +++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c @@ -74,7 +74,7 @@ llvmpipe_bind_sampler_states(struct pipe_context *pipe, { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); - assert(shader < PIPE_SHADER_TYPES); + assert(shader < PIPE_SHADER_MESH_TYPES); assert(start + num <= ARRAY_SIZE(llvmpipe->samplers[shader])); draw_flush(llvmpipe->draw); @@ -133,7 +133,7 @@ llvmpipe_set_sampler_views(struct pipe_context *pipe, assert(num <= PIPE_MAX_SHADER_SAMPLER_VIEWS); - assert(shader < PIPE_SHADER_TYPES); + assert(shader < PIPE_SHADER_MESH_TYPES); assert(start + num <= ARRAY_SIZE(llvmpipe->sampler_views[shader])); draw_flush(llvmpipe->draw);