gallium/tgsi_exec: Stop doing the weird allocation of the Addrs array.
Saves an indirection on referencing the address regs, and also my sanity. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8283>
This commit is contained in:
@@ -1264,7 +1264,6 @@ tgsi_exec_machine_create(enum pipe_shader_type shader_type)
|
||||
memset(mach, 0, sizeof(*mach));
|
||||
|
||||
mach->ShaderType = shader_type;
|
||||
mach->Addrs = &mach->Temps[TGSI_EXEC_TEMP_ADDR];
|
||||
mach->MaxGeometryShaderOutputs = TGSI_MAX_TOTAL_VERTICES;
|
||||
|
||||
if (shader_type != PIPE_SHADER_COMPUTE) {
|
||||
@@ -1528,7 +1527,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
|
||||
|
||||
case TGSI_FILE_ADDRESS:
|
||||
for (i = 0; i < TGSI_QUAD_SIZE; i++) {
|
||||
assert(index->i[i] >= 0);
|
||||
assert(index->i[i] >= 0 && index->i[i] < ARRAY_SIZE(mach->Addrs));
|
||||
assert(index2D->i[i] == 0);
|
||||
|
||||
chan->u[i] = mach->Addrs[index->i[i]].xyzw[swizzle].u[i];
|
||||
@@ -1893,6 +1892,7 @@ store_dest_dstret(struct tgsi_exec_machine *mach,
|
||||
|
||||
case TGSI_FILE_ADDRESS:
|
||||
index = reg->Register.Index;
|
||||
assert(index >= 0 && index < ARRAY_SIZE(mach->Addrs));
|
||||
dst = &mach->Addrs[index].xyzw[chan_index];
|
||||
break;
|
||||
|
||||
|
||||
@@ -224,10 +224,7 @@ struct tgsi_sampler
|
||||
#define TGSI_EXEC_TEMP_R0 (TGSI_EXEC_NUM_TEMPS + 1)
|
||||
#define TGSI_EXEC_NUM_TEMP_R 4
|
||||
|
||||
#define TGSI_EXEC_TEMP_ADDR (TGSI_EXEC_NUM_TEMPS + 5)
|
||||
#define TGSI_EXEC_NUM_ADDRS 3
|
||||
|
||||
#define TGSI_EXEC_NUM_TEMP_EXTRAS 8
|
||||
#define TGSI_EXEC_NUM_TEMP_EXTRAS 5
|
||||
|
||||
|
||||
|
||||
@@ -321,7 +318,7 @@ struct tgsi_exec_machine
|
||||
unsigned SysSemanticToIndex[TGSI_SEMANTIC_COUNT];
|
||||
struct tgsi_exec_vector SystemValue[TGSI_MAX_MISC_INPUTS];
|
||||
|
||||
struct tgsi_exec_vector *Addrs;
|
||||
struct tgsi_exec_vector Addrs[3];
|
||||
|
||||
struct tgsi_sampler *Sampler;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user