anv,hasvk,iris: sampler_prog_key::swizzles is only used on crocus

The field is no longer consumed by brw_complie_* and is instead handled
directly by the crocus driver.  Therefore, it's safe to leave it zero
and not even bother setting it.  This removes our reliance on the
SWIZZLE_* macros in prog_instructions.h.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24288>
This commit is contained in:
Faith Ekstrand
2023-07-21 14:52:41 -05:00
committed by Marge Bot
parent 1e29b3cee8
commit 079e8a9674
4 changed files with 5 additions and 25 deletions

View File

@@ -53,8 +53,7 @@
.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.tex.swizzles[0 ... BRW_MAX_SAMPLERS - 1] = 0x688
.base.limit_trig_input_range = limit_trig_input
struct iris_threaded_compile_job {
struct iris_screen *screen;

View File

@@ -209,6 +209,9 @@ PRAGMA_DIAGNOSTIC_ERROR(-Wpadded)
struct brw_sampler_prog_key_data {
/**
* EXT_texture_swizzle and DEPTH_TEXTURE_MODE swizzles.
*
* This field is not consumed by the back-end compiler and is only relevant
* for the crocus OpenGL driver for Broadwell and earlier hardware.
*/
uint16_t swizzles[BRW_MAX_SAMPLERS];

View File

@@ -44,9 +44,6 @@
#include "vk_render_pass.h"
#include "vk_util.h"
/* Needed for SWIZZLE macros */
#include "program/prog_instruction.h"
struct lower_set_vtx_and_prim_count_state {
nir_variable *primitive_count;
};
@@ -382,16 +379,6 @@ void anv_DestroyPipeline(
vk_free2(&device->vk.alloc, pAllocator, pipeline);
}
static void
populate_sampler_prog_key(const struct intel_device_info *devinfo,
struct brw_sampler_prog_key_data *key)
{
for (int i = 0; i < BRW_MAX_SAMPLERS; i++) {
/* Assume color sampler, no swizzling. (Works for BDW+) */
key->swizzles[i] = SWIZZLE_XYZW;
}
}
static void
populate_base_prog_key(const struct anv_device *device,
bool robust_buffer_acccess,
@@ -400,8 +387,6 @@ populate_base_prog_key(const struct anv_device *device,
key->robust_buffer_access = robust_buffer_acccess;
key->limit_trig_input_range =
device->physical->instance->limit_trig_input_range;
populate_sampler_prog_key(device->info, &key->tex);
}
static void

View File

@@ -42,9 +42,6 @@
#include "vk_render_pass.h"
#include "vk_util.h"
/* Needed for SWIZZLE macros */
#include "program/prog_instruction.h"
/* Eventually, this will become part of anv_CreateShader. Unfortunately,
* we can't do that yet because we don't have the ability to copy nir.
*/
@@ -261,11 +258,7 @@ static void
populate_sampler_prog_key(const struct intel_device_info *devinfo,
struct brw_sampler_prog_key_data *key)
{
/* XXX: Handle texture swizzle on HSW- */
for (int i = 0; i < BRW_MAX_SAMPLERS; i++) {
/* Assume color sampler, no swizzling. (Works for BDW+) */
key->swizzles[i] = SWIZZLE_XYZW;
}
/* XXX: Handle texture swizzle Pre-HSW */
}
static void