llvmpipe: resize arrays to handle mesh shaders.

This just bumps some limits.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
This commit is contained in:
Dave Airlie
2023-05-29 16:30:24 +10:00
parent 7f1151d90d
commit b0b81b279c
4 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -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);
}
+8 -8
View File
@@ -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;
+1 -1
View File
@@ -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 */
@@ -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);