[Mesa-dev] [PATCH 04/19] st_glsl_to_tgsi: rename st_translate::arrays to temp_arrays
Nicolai Hähnle
nhaehnle at gmail.com
Tue Aug 9 10:36:33 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
Analogous to {input,output}_arrays.
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 1df4864..aa83f0a 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5128,21 +5128,21 @@ struct label {
/**
* Intermediate state used during shader translation.
*/
struct st_translate {
struct ureg_program *ureg;
unsigned temps_size;
struct ureg_dst *temps;
- struct ureg_dst *arrays;
+ struct ureg_dst *temp_arrays;
unsigned num_temp_arrays;
struct ureg_src *constants;
int num_constants;
struct ureg_src *immediates;
int num_immediates;
struct ureg_dst outputs[PIPE_MAX_SHADER_OUTPUTS];
struct ureg_src inputs[PIPE_MAX_SHADER_INPUTS];
struct ureg_dst address[3];
struct ureg_src samplers[PIPE_MAX_SAMPLERS];
struct ureg_src buffers[PIPE_MAX_SHADER_BUFFERS];
@@ -5349,21 +5349,21 @@ dst_register(struct st_translate *t, gl_register_file file, unsigned index,
if (ureg_dst_is_undef(t->temps[index]))
t->temps[index] = ureg_DECL_local_temporary(t->ureg);
return t->temps[index];
case PROGRAM_ARRAY:
array = index >> 16;
assert(array < t->num_temp_arrays);
- return ureg_dst_array_offset(t->arrays[array],
+ return ureg_dst_array_offset(t->temp_arrays[array],
(int)(index & 0xFFFF) - 0x8000);
case PROGRAM_OUTPUT:
if (!array_id) {
if (t->procType == PIPE_SHADER_FRAGMENT)
assert(index < FRAG_RESULT_MAX);
else if (t->procType == PIPE_SHADER_TESS_CTRL ||
t->procType == PIPE_SHADER_TESS_EVAL)
assert(index < VARYING_SLOT_TESS_MAX);
else
@@ -5568,21 +5568,21 @@ translate_tex_offset(struct st_translate *t,
offset.SwizzleY = GET_SWZ(in_offset->swizzle, 1);
offset.SwizzleZ = GET_SWZ(in_offset->swizzle, 2);
offset.Padding = 0;
break;
case PROGRAM_ARRAY:
array = in_offset->index >> 16;
assert(array >= 0);
assert(array < (int)t->num_temp_arrays);
- dst = t->arrays[array];
+ dst = t->temp_arrays[array];
offset.File = dst.File;
offset.Index = dst.Index + (in_offset->index & 0xFFFF) - 0x8000;
offset.SwizzleX = GET_SWZ(in_offset->swizzle, 0);
offset.SwizzleY = GET_SWZ(in_offset->swizzle, 1);
offset.SwizzleZ = GET_SWZ(in_offset->swizzle, 2);
offset.Padding = 0;
break;
default:
break;
}
@@ -6029,24 +6029,24 @@ st_translate_program(
t->procType = procType;
t->inputMapping = inputMapping;
t->outputMapping = outputMapping;
t->ureg = ureg;
/*
* Declare temporary arrays.
*/
t->num_temp_arrays = program->next_array;
if (t->num_temp_arrays) {
- t->arrays = (struct ureg_dst*)
- calloc(1, sizeof(t->arrays[0]) * t->num_temp_arrays);
+ t->temp_arrays = (struct ureg_dst*)
+ calloc(1, sizeof(t->temp_arrays[0]) * t->num_temp_arrays);
for (i = 0; i < t->num_temp_arrays; ++i)
- t->arrays[i] = ureg_DECL_array_temporary(
+ t->temp_arrays[i] = ureg_DECL_array_temporary(
t->ureg, program->array_sizes[i], TGSI_WRITEMASK_XYZW, TRUE);
}
/*
* Declare input attributes.
*/
switch (procType) {
case PIPE_SHADER_FRAGMENT:
for (i = 0; i < numInputs; i++) {
unsigned array_id = 0;
@@ -6423,21 +6423,21 @@ st_translate_program(
ureg_set_next_shader_processor(ureg, next);
break;
}
}
break;
}
out:
if (t) {
- free(t->arrays);
+ free(t->temp_arrays);
free(t->temps);
free(t->insn);
free(t->labels);
free(t->constants);
t->num_constants = 0;
free(t->immediates);
t->num_immediates = 0;
if (t->error) {
debug_printf("%s: translate error flag set\n", __func__);
--
2.7.4
More information about the mesa-dev
mailing list