iris: Split max #defines for textures/samplers/images

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16442>
This commit is contained in:
Jason Ekstrand
2022-04-15 16:29:52 -05:00
committed by Marge Bot
parent c9c8134d76
commit c4ff82d958
4 changed files with 10 additions and 7 deletions

View File

@@ -48,7 +48,6 @@ struct blorp_batch;
struct blorp_params;
#define IRIS_MAX_TEXTURE_BUFFER_SIZE (1 << 27)
#define IRIS_MAX_TEXTURE_SAMPLERS 32
/* IRIS_MAX_ABOS and IRIS_MAX_SSBOS must be the same. */
#define IRIS_MAX_ABOS 16
#define IRIS_MAX_SSBOS 16
@@ -559,8 +558,8 @@ struct iris_shader_state {
struct iris_image_view image[PIPE_MAX_SHADER_IMAGES];
struct iris_state_ref sampler_table;
struct iris_sampler_state *samplers[IRIS_MAX_TEXTURE_SAMPLERS];
struct iris_sampler_view *textures[IRIS_MAX_TEXTURE_SAMPLERS];
struct iris_sampler_state *samplers[IRIS_MAX_SAMPLERS];
struct iris_sampler_view *textures[IRIS_MAX_TEXTURES];
/** Bitfield of which constant buffers are bound (non-null). */
uint32_t bound_cbufs;

View File

@@ -503,9 +503,11 @@ iris_get_shader_param(struct pipe_screen *pscreen,
case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
return 0;
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
return IRIS_MAX_SAMPLERS;
case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
return IRIS_MAX_TEXTURES;
case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
return IRIS_MAX_TEXTURE_SAMPLERS;
return IRIS_MAX_IMAGES;
case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
return IRIS_MAX_ABOS + IRIS_MAX_SSBOS;
case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:

View File

@@ -50,7 +50,9 @@ struct u_trace;
#define READ_ONCE(x) (*(volatile __typeof__(x) *)&(x))
#define WRITE_ONCE(x, v) *(volatile __typeof__(x) *)&(x) = (v)
#define IRIS_MAX_TEXTURE_SAMPLERS 32
#define IRIS_MAX_TEXTURES 32
#define IRIS_MAX_SAMPLERS 32
#define IRIS_MAX_IMAGES 32
#define IRIS_MAX_SOL_BUFFERS 4
#define IRIS_MAP_BUFFER_ALIGNMENT 64

View File

@@ -2175,7 +2175,7 @@ iris_bind_sampler_states(struct pipe_context *ctx,
gl_shader_stage stage = stage_from_pipe(p_stage);
struct iris_shader_state *shs = &ice->state.shaders[stage];
assert(start + count <= IRIS_MAX_TEXTURE_SAMPLERS);
assert(start + count <= IRIS_MAX_SAMPLERS);
bool dirty = false;
@@ -7432,7 +7432,7 @@ iris_destroy_state(struct iris_context *ice)
pipe_resource_reference(&shs->ssbo[i].buffer, NULL);
pipe_resource_reference(&shs->ssbo_surf_state[i].res, NULL);
}
for (int i = 0; i < IRIS_MAX_TEXTURE_SAMPLERS; i++) {
for (int i = 0; i < IRIS_MAX_TEXTURES; i++) {
pipe_sampler_view_reference((struct pipe_sampler_view **)
&shs->textures[i], NULL);
}