diff --git a/src/gallium/drivers/crocus/crocus_program.c b/src/gallium/drivers/crocus/crocus_program.c index b07a4ceb20f..54c1434b061 100644 --- a/src/gallium/drivers/crocus/crocus_program.c +++ b/src/gallium/drivers/crocus/crocus_program.c @@ -49,7 +49,7 @@ #define KEY_INIT_NO_ID() \ .base.subgroup_size_type = BRW_SUBGROUP_SIZE_UNIFORM, \ - .base.tex.swizzles[0 ... MAX_SAMPLERS - 1] = 0x688, \ + .base.tex.swizzles[0 ... BRW_MAX_SAMPLERS - 1] = 0x688, \ .base.tex.compressed_multisample_layout_mask = ~0 #define KEY_INIT() \ .base.program_string_id = ish->program_id, \ @@ -60,7 +60,7 @@ static void crocus_sanitize_tex_key(struct brw_sampler_prog_key_data *key) { key->gather_channel_quirk_mask = 0; - for (unsigned s = 0; s < MAX_SAMPLERS; s++) { + for (unsigned s = 0; s < BRW_MAX_SAMPLERS; s++) { key->swizzles[s] = SWIZZLE_NOOP; key->gfx6_gather_wa[s] = 0; } diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 64097d87de2..df0cd178312 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -50,12 +50,12 @@ #define KEY_INIT(prefix) \ .prefix.program_string_id = ish->program_id, \ .prefix.limit_trig_input_range = screen->driconf.limit_trig_input_range -#define BRW_KEY_INIT(gen, prog_id, limit_trig_input) \ - .base.program_string_id = prog_id, \ - .base.limit_trig_input_range = limit_trig_input, \ - .base.subgroup_size_type = BRW_SUBGROUP_SIZE_UNIFORM, \ - .base.tex.swizzles[0 ... MAX_SAMPLERS - 1] = 0x688, \ - .base.tex.compressed_multisample_layout_mask = ~0, \ +#define BRW_KEY_INIT(gen, prog_id, limit_trig_input) \ + .base.program_string_id = prog_id, \ + .base.limit_trig_input_range = limit_trig_input, \ + .base.subgroup_size_type = BRW_SUBGROUP_SIZE_UNIFORM, \ + .base.tex.swizzles[0 ... BRW_MAX_SAMPLERS - 1] = 0x688, \ + .base.tex.compressed_multisample_layout_mask = ~0, \ .base.tex.msaa_16 = (gen >= 9 ? ~0 : 0) struct iris_threaded_compile_job { diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c index 9a6e1dd754e..118e71627eb 100644 --- a/src/intel/blorp/blorp.c +++ b/src/intel/blorp/blorp.c @@ -203,7 +203,7 @@ blorp_params_init(struct blorp_params *params) static void blorp_init_base_prog_key(struct brw_base_prog_key *key) { - for (int i = 0; i < MAX_SAMPLERS; i++) + for (int i = 0; i < BRW_MAX_SAMPLERS; i++) key->tex.swizzles[i] = SWIZZLE_XYZW; } diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index 3f1743aaaec..aa2e062a18e 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -27,7 +27,6 @@ #include #include "c11/threads.h" #include "dev/intel_device_info.h" -#include "main/config.h" #include "util/ralloc.h" #include "util/u_math.h" @@ -177,6 +176,8 @@ enum PACKED gfx6_gather_sampler_wa { WA_16BIT = 4, /* if we have a 16bit format needing wa */ }; +#define BRW_MAX_SAMPLERS 32 + /** * Sampler information needed by VS, WM, and GS program cache keys. */ @@ -184,7 +185,7 @@ struct brw_sampler_prog_key_data { /** * EXT_texture_swizzle and DEPTH_TEXTURE_MODE swizzles. */ - uint16_t swizzles[MAX_SAMPLERS]; + uint16_t swizzles[BRW_MAX_SAMPLERS]; uint32_t gl_clamp_mask[3]; @@ -208,7 +209,7 @@ struct brw_sampler_prog_key_data { /** * For Sandybridge, which shader w/a we need for gather quirks. */ - enum gfx6_gather_sampler_wa gfx6_gather_wa[MAX_SAMPLERS]; + enum gfx6_gather_sampler_wa gfx6_gather_wa[BRW_MAX_SAMPLERS]; /** * Texture units that have a YUV image bound. @@ -223,7 +224,7 @@ struct brw_sampler_prog_key_data { uint32_t bt2020_mask; /* Scale factor for each texture. */ - float scale_factors[32]; + float scale_factors[BRW_MAX_SAMPLERS]; }; /** An enum representing what kind of input gl_SubgroupSize is. */ diff --git a/src/intel/compiler/brw_debug_recompile.c b/src/intel/compiler/brw_debug_recompile.c index b10842326f3..8aa6c202c11 100644 --- a/src/intel/compiler/brw_debug_recompile.c +++ b/src/intel/compiler/brw_debug_recompile.c @@ -73,7 +73,7 @@ debug_sampler_recompile(const struct brw_compiler *c, void *log, found |= check("ayuv image bound", ayuv_image_mask); found |= check("xyuv image bound", xyuv_image_mask); - for (unsigned i = 0; i < MAX_SAMPLERS; i++) { + for (unsigned i = 0; i < BRW_MAX_SAMPLERS; i++) { found |= check("EXT_texture_swizzle or DEPTH_TEXTURE_MODE", swizzles[i]); found |= check("textureGather workarounds", gfx6_gather_wa[i]); found |= check_float("scale factor", scale_factors[i]); diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 38bf9d2a646..bcc172fb416 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -308,7 +308,7 @@ populate_sampler_prog_key(const struct intel_device_info *devinfo, key->msaa_16 = ~0; /* XXX: Handle texture swizzle on HSW- */ - for (int i = 0; i < MAX_SAMPLERS; i++) { + for (int i = 0; i < BRW_MAX_SAMPLERS; i++) { /* Assume color sampler, no swizzling. (Works for BDW+) */ key->swizzles[i] = SWIZZLE_XYZW; }