summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-01-14 08:46:05 -0500
committerTom Stellard <[email protected]>2012-01-30 13:37:00 -0500
commit6b63e25b3d7a6ac0bd738c139ead0c7e7ad84368 (patch)
treecd2731a2d948eb1cd48e1783b4045e8f8fce4e3b /src/gallium/auxiliary
parent9ee1bcf7a5442ccb517a5cfbaf024755bd4d2738 (diff)
gallium: Prefix #defines in tgsi_exec.h with TGSI_
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c46
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_exec.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c100
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.h36
4 files changed, 92 insertions, 92 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index b81c72573bd..8a55e17920e 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -469,8 +469,8 @@ draw_llvm_create_variant(struct draw_llvm *llvm,
static void
generate_vs(struct draw_llvm *llvm,
LLVMBuilderRef builder,
- LLVMValueRef (*outputs)[NUM_CHANNELS],
- const LLVMValueRef (*inputs)[NUM_CHANNELS],
+ LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS],
+ const LLVMValueRef (*inputs)[TGSI_NUM_CHANNELS],
LLVMValueRef system_values_array,
LLVMValueRef context_ptr,
struct lp_build_sampler_soa *draw_sampler,
@@ -518,7 +518,7 @@ generate_vs(struct draw_llvm *llvm,
lp_build_context_init(&bld, llvm->gallivm, vs_type);
for (attrib = 0; attrib < info->num_outputs; ++attrib) {
- for (chan = 0; chan < NUM_CHANNELS; ++chan) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; ++chan) {
if (outputs[attrib][chan]) {
switch (info->output_semantic_name[attrib]) {
case TGSI_SEMANTIC_COLOR:
@@ -644,19 +644,19 @@ aos_to_soa(struct gallivm_state *gallivm,
static void
soa_to_aos(struct gallivm_state *gallivm,
- LLVMValueRef soa[NUM_CHANNELS],
- LLVMValueRef aos[NUM_CHANNELS])
+ LLVMValueRef soa[TGSI_NUM_CHANNELS],
+ LLVMValueRef aos[TGSI_NUM_CHANNELS])
{
LLVMBuilderRef builder = gallivm->builder;
LLVMValueRef comp;
int i = 0;
- debug_assert(NUM_CHANNELS == 4);
+ debug_assert(TGSI_NUM_CHANNELS == 4);
aos[0] = LLVMConstNull(LLVMTypeOf(soa[0]));
aos[1] = aos[2] = aos[3] = aos[0];
- for (i = 0; i < NUM_CHANNELS; ++i) {
+ for (i = 0; i < TGSI_NUM_CHANNELS; ++i) {
LLVMValueRef channel = lp_build_const_int32(gallivm, i);
comp = LLVMBuildExtractElement(builder, soa[i],
@@ -681,13 +681,13 @@ soa_to_aos(struct gallivm_state *gallivm,
static void
convert_to_soa(struct gallivm_state *gallivm,
- LLVMValueRef (*aos)[NUM_CHANNELS],
- LLVMValueRef (*soa)[NUM_CHANNELS],
+ LLVMValueRef (*aos)[TGSI_NUM_CHANNELS],
+ LLVMValueRef (*soa)[TGSI_NUM_CHANNELS],
int num_attribs)
{
int i;
- debug_assert(NUM_CHANNELS == 4);
+ debug_assert(TGSI_NUM_CHANNELS == 4);
for (i = 0; i < num_attribs; ++i) {
LLVMValueRef val0 = aos[i][0];
@@ -791,7 +791,7 @@ store_aos(struct gallivm_state *gallivm,
static void
store_aos_array(struct gallivm_state *gallivm,
LLVMValueRef io_ptr,
- LLVMValueRef aos[NUM_CHANNELS],
+ LLVMValueRef aos[TGSI_NUM_CHANNELS],
int attrib,
int num_outputs,
LLVMValueRef clipmask)
@@ -805,7 +805,7 @@ store_aos_array(struct gallivm_state *gallivm,
LLVMValueRef io0_ptr, io1_ptr, io2_ptr, io3_ptr;
LLVMValueRef clipmask0, clipmask1, clipmask2, clipmask3;
- debug_assert(NUM_CHANNELS == 4);
+ debug_assert(TGSI_NUM_CHANNELS == 4);
io0_ptr = LLVMBuildGEP(builder, io_ptr,
&ind0, 1, "");
@@ -840,7 +840,7 @@ store_aos_array(struct gallivm_state *gallivm,
static void
convert_to_aos(struct gallivm_state *gallivm,
LLVMValueRef io,
- LLVMValueRef (*outputs)[NUM_CHANNELS],
+ LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS],
LLVMValueRef clipmask,
int num_outputs,
int max_vertices)
@@ -854,7 +854,7 @@ convert_to_aos(struct gallivm_state *gallivm,
for (attrib = 0; attrib < num_outputs; ++attrib) {
LLVMValueRef soa[4];
LLVMValueRef aos[4];
- for (chan = 0; chan < NUM_CHANNELS; ++chan) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; ++chan) {
if (outputs[attrib][chan]) {
LLVMValueRef out = LLVMBuildLoad(builder, outputs[attrib][chan], "");
lp_build_name(out, "output%u.%c", attrib, "xyzw"[chan]);
@@ -890,7 +890,7 @@ convert_to_aos(struct gallivm_state *gallivm,
static void
store_clip(struct gallivm_state *gallivm,
LLVMValueRef io_ptr,
- LLVMValueRef (*outputs)[NUM_CHANNELS],
+ LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS],
boolean pre_clip_pos)
{
LLVMBuilderRef builder = gallivm->builder;
@@ -983,7 +983,7 @@ vec4f_from_scalar(struct gallivm_state *gallivm,
static void
generate_viewport(struct draw_llvm *llvm,
LLVMBuilderRef builder,
- LLVMValueRef (*outputs)[NUM_CHANNELS],
+ LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS],
LLVMValueRef context_ptr)
{
int i;
@@ -1034,7 +1034,7 @@ generate_viewport(struct draw_llvm *llvm,
*/
static LLVMValueRef
generate_clipmask(struct gallivm_state *gallivm,
- LLVMValueRef (*outputs)[NUM_CHANNELS],
+ LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS],
boolean clip_xy,
boolean clip_z,
boolean clip_user,
@@ -1212,7 +1212,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
struct lp_build_context bld;
struct lp_build_loop_state lp_loop;
const int max_vertices = 4;
- LLVMValueRef outputs[PIPE_MAX_SHADER_OUTPUTS][NUM_CHANNELS];
+ LLVMValueRef outputs[PIPE_MAX_SHADER_OUTPUTS][TGSI_NUM_CHANNELS];
LLVMValueRef fetch_max;
void *code;
struct lp_build_sampler_soa *sampler = 0;
@@ -1317,11 +1317,11 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
lp_build_loop_begin(&lp_loop, gallivm, start);
{
- LLVMValueRef inputs[PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
- LLVMValueRef aos_attribs[PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS] = { { 0 } };
+ LLVMValueRef inputs[PIPE_MAX_SHADER_INPUTS][TGSI_NUM_CHANNELS];
+ LLVMValueRef aos_attribs[PIPE_MAX_SHADER_INPUTS][TGSI_NUM_CHANNELS] = { { 0 } };
LLVMValueRef io;
LLVMValueRef clipmask; /* holds the clipmask value */
- const LLVMValueRef (*ptr_aos)[NUM_CHANNELS];
+ const LLVMValueRef (*ptr_aos)[TGSI_NUM_CHANNELS];
if (elts)
io_itr = lp_loop.counter;
@@ -1333,7 +1333,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
lp_build_printf(builder, " --- io %d = %p, loop counter %d\n",
io_itr, io, lp_loop.counter);
#endif
- for (i = 0; i < NUM_CHANNELS; ++i) {
+ for (i = 0; i < TGSI_NUM_CHANNELS; ++i) {
LLVMValueRef true_index =
LLVMBuildAdd(builder,
lp_loop.counter,
@@ -1364,7 +1364,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
convert_to_soa(gallivm, aos_attribs, inputs,
draw->pt.nr_vertex_elements);
- ptr_aos = (const LLVMValueRef (*)[NUM_CHANNELS]) inputs;
+ ptr_aos = (const LLVMValueRef (*)[TGSI_NUM_CHANNELS]) inputs;
generate_vs(llvm,
builder,
outputs,
diff --git a/src/gallium/auxiliary/draw/draw_vs_exec.c b/src/gallium/auxiliary/draw/draw_vs_exec.c
index bfe7aea737b..eaba4755f53 100644
--- a/src/gallium/auxiliary/draw/draw_vs_exec.c
+++ b/src/gallium/auxiliary/draw/draw_vs_exec.c
@@ -103,7 +103,7 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
if (shader->info.uses_instanceid) {
unsigned i = machine->SysSemanticToIndex[TGSI_SEMANTIC_INSTANCEID];
assert(i < Elements(machine->SystemValue));
- for (j = 0; j < QUAD_SIZE; j++)
+ for (j = 0; j < TGSI_QUAD_SIZE; j++)
machine->SystemValue[i].i[j] = shader->draw->instance_id;
}
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 3774b610aec..c4ad34b1e61 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -602,7 +602,7 @@ tgsi_check_soa_dependencies(const struct tgsi_full_instruction *inst)
inst->Dst[0].Register.Indirect)) {
/* loop over dest channels */
uint channelsWritten = 0x0;
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
/* check if we're reading a channel that's been written */
uint swizzle = tgsi_util_get_full_src_register_swizzle(&inst->Src[i], chan);
@@ -1055,7 +1055,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
switch (file) {
case TGSI_FILE_CONSTANT:
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
assert(index2D->i[i] >= 0 && index2D->i[i] < PIPE_MAX_CONSTANT_BUFFERS);
assert(mach->Consts[index2D->i[i]]);
@@ -1084,7 +1084,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
break;
case TGSI_FILE_INPUT:
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
/*
if (TGSI_PROCESSOR_GEOMETRY == mach->Processor) {
debug_printf("Fetching Input[%d] (2d=%d, 1d=%d)\n",
@@ -1102,13 +1102,13 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
/* XXX no swizzling at this point. Will be needed if we put
* gl_FragCoord, for example, in a sys value register.
*/
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
chan->u[i] = mach->SystemValue[index->i[i]].u[i];
}
break;
case TGSI_FILE_TEMPORARY:
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
assert(index->i[i] < TGSI_EXEC_NUM_TEMPS);
assert(index2D->i[i] == 0);
@@ -1117,7 +1117,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
break;
case TGSI_FILE_TEMPORARY_ARRAY:
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
assert(index->i[i] < TGSI_EXEC_NUM_TEMPS);
assert(index2D->i[i] < TGSI_EXEC_NUM_TEMP_ARRAYS);
@@ -1127,7 +1127,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
break;
case TGSI_FILE_IMMEDIATE:
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
assert(index->i[i] >= 0 && index->i[i] < (int)mach->ImmLimit);
assert(index2D->i[i] == 0);
@@ -1136,7 +1136,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
break;
case TGSI_FILE_IMMEDIATE_ARRAY:
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
assert(index2D->i[i] == 0);
chan->f[i] = mach->ImmArray[index->i[i]][swizzle];
@@ -1144,7 +1144,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
break;
case TGSI_FILE_ADDRESS:
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
assert(index->i[i] >= 0);
assert(index2D->i[i] == 0);
@@ -1153,7 +1153,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
break;
case TGSI_FILE_PREDICATE:
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
assert(index->i[i] >= 0 && index->i[i] < TGSI_EXEC_NUM_PREDS);
assert(index2D->i[i] == 0);
@@ -1163,7 +1163,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
case TGSI_FILE_OUTPUT:
/* vertex/fragment output vars can be read too */
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
assert(index->i[i] >= 0);
assert(index2D->i[i] == 0);
@@ -1173,7 +1173,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
default:
assert(0);
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
chan->u[i] = 0;
}
}
@@ -1243,7 +1243,7 @@ fetch_source(const struct tgsi_exec_machine *mach,
/* for disabled execution channels, zero-out the index to
* avoid using a potential garbage value.
*/
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
if ((execmask & (1 << i)) == 0)
index.i[i] = 0;
}
@@ -1302,7 +1302,7 @@ fetch_source(const struct tgsi_exec_machine *mach,
/* for disabled execution channels, zero-out the index to
* avoid using a potential garbage value.
*/
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
if ((execmask & (1 << i)) == 0) {
index2D.i[i] = 0;
}
@@ -1458,7 +1458,7 @@ store_dest(struct tgsi_exec_machine *mach,
/* for disabled execution channels, zero-out the index to
* avoid using a potential garbage value.
*/
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
if ((execmask & (1 << i)) == 0) {
index2D.i[i] = 0;
}
@@ -1488,7 +1488,7 @@ store_dest(struct tgsi_exec_machine *mach,
#if 0
if (TGSI_PROCESSOR_GEOMETRY == mach->Processor) {
fprintf(stderr, "STORING OUT[%d] mask(%d), = (", offset + index, execmask);
- for (i = 0; i < QUAD_SIZE; i++)
+ for (i = 0; i < TGSI_QUAD_SIZE; i++)
if (execmask & (1 << i))
fprintf(stderr, "%f, ", chan->f[i]);
fprintf(stderr, ")\n");
@@ -1555,13 +1555,13 @@ store_dest(struct tgsi_exec_machine *mach,
pred = &mach->Predicates[inst->Predicate.Index].xyzw[swizzle];
if (inst->Predicate.Negate) {
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
if (pred->u[i]) {
execmask &= ~(1 << i);
}
}
} else {
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
if (!pred->u[i]) {
execmask &= ~(1 << i);
}
@@ -1571,13 +1571,13 @@ store_dest(struct tgsi_exec_machine *mach,
switch (inst->Instruction.Saturate) {
case TGSI_SAT_NONE:
- for (i = 0; i < QUAD_SIZE; i++)
+ for (i = 0; i < TGSI_QUAD_SIZE; i++)
if (execmask & (1 << i))
dst->i[i] = chan->i[i];
break;
case TGSI_SAT_ZERO_ONE:
- for (i = 0; i < QUAD_SIZE; i++)
+ for (i = 0; i < TGSI_QUAD_SIZE; i++)
if (execmask & (1 << i)) {
if (chan->f[i] < 0.0f)
dst->f[i] = 0.0f;
@@ -1589,7 +1589,7 @@ store_dest(struct tgsi_exec_machine *mach,
break;
case TGSI_SAT_MINUS_PLUS_ONE:
- for (i = 0; i < QUAD_SIZE; i++)
+ for (i = 0; i < TGSI_QUAD_SIZE; i++)
if (execmask & (1 << i)) {
if (chan->f[i] < -1.0f)
dst->f[i] = -1.0f;
@@ -1672,7 +1672,7 @@ emit_vertex(struct tgsi_exec_machine *mach)
{
/* FIXME: check for exec mask correctly
unsigned i;
- for (i = 0; i < QUAD_SIZE; ++i) {
+ for (i = 0; i < TGSI_QUAD_SIZE; ++i) {
if ((mach->ExecMask & (1 << i)))
*/
if (mach->ExecMask) {
@@ -1687,7 +1687,7 @@ emit_primitive(struct tgsi_exec_machine *mach)
unsigned *prim_count = &mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0];
/* FIXME: check for exec mask correctly
unsigned i;
- for (i = 0; i < QUAD_SIZE; ++i) {
+ for (i = 0; i < TGSI_QUAD_SIZE; ++i) {
if ((mach->ExecMask & (1 << i)))
*/
if (mach->ExecMask) {
@@ -1726,7 +1726,7 @@ fetch_texel( struct tgsi_sampler *sampler,
union tgsi_exec_channel *a )
{
uint j;
- float rgba[NUM_CHANNELS][QUAD_SIZE];
+ float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE];
sampler->get_samples(sampler, s->f, t->f, p->f, c0->f, control, rgba);
@@ -1904,7 +1904,7 @@ exec_tex(struct tgsi_exec_machine *mach,
r[3].f[0], r[3].f[1], r[3].f[2], r[3].f[3]);
#endif
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
@@ -1983,7 +1983,7 @@ exec_txd(struct tgsi_exec_machine *mach,
assert(0);
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
@@ -2000,7 +2000,7 @@ exec_txf(struct tgsi_exec_machine *mach,
union tgsi_exec_channel r[4];
union tgsi_exec_channel offset[3];
uint chan;
- float rgba[NUM_CHANNELS][QUAD_SIZE];
+ float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE];
int j;
int8_t offsets[3];
@@ -2048,14 +2048,14 @@ exec_txf(struct tgsi_exec_machine *mach,
sampler->get_texel(sampler, r[0].i, r[1].i, r[2].i, r[3].i,
offsets, rgba);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
r[0].f[j] = rgba[0][j];
r[1].f[j] = rgba[1][j];
r[2].f[j] = rgba[2][j];
r[3].f[j] = rgba[3][j];
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
@@ -2078,13 +2078,13 @@ exec_txq(struct tgsi_exec_machine *mach,
sampler->get_dims(sampler, src.i[0], result);
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
for (j = 0; j < 4; j++) {
r[j].i[i] = result[j];
}
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &r[chan], &inst->Dst[0], inst, chan,
TGSI_EXEC_DATA_INT);
@@ -2196,7 +2196,7 @@ exec_sample(struct tgsi_exec_machine *mach,
assert(0);
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
@@ -2259,7 +2259,7 @@ exec_sample_d(struct tgsi_exec_machine *mach,
assert(0);
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
@@ -2279,7 +2279,7 @@ eval_constant_coef(
{
unsigned i;
- for( i = 0; i < QUAD_SIZE; i++ ) {
+ for( i = 0; i < TGSI_QUAD_SIZE; i++ ) {
mach->Inputs[attrib].xyzw[chan].f[i] = mach->InterpCoefs[attrib].a0[chan];
}
}
@@ -2364,7 +2364,7 @@ exec_declaration(struct tgsi_exec_machine *mach,
assert(decl->Semantic.Index == 0);
assert(first == last);
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
mach->Inputs[first].xyzw[0].f[i] = mach->Face;
}
} else {
@@ -2393,7 +2393,7 @@ exec_declaration(struct tgsi_exec_machine *mach,
return;
}
- for (j = 0; j < NUM_CHANNELS; j++) {
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++) {
if (mask & (1 << j)) {
for (i = first; i <= last; i++) {
eval(mach, i, j);
@@ -2420,7 +2420,7 @@ exec_vector(struct tgsi_exec_machine *mach,
{
unsigned int chan;
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
union tgsi_exec_channel dst;
@@ -2446,7 +2446,7 @@ exec_scalar_unary(struct tgsi_exec_machine *mach,
fetch_source(mach, &src, &inst->Src[0], TGSI_CHAN_X, src_datatype);
op(&dst, &src);
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &dst, &inst->Dst[0], inst, chan, dst_datatype);
}
@@ -2463,7 +2463,7 @@ exec_vector_unary(struct tgsi_exec_machine *mach,
unsigned int chan;
struct tgsi_exec_vector dst;
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
union tgsi_exec_channel src;
@@ -2471,7 +2471,7 @@ exec_vector_unary(struct tgsi_exec_machine *mach,
op(&dst.xyzw[chan], &src);
}
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &dst.xyzw[chan], &inst->Dst[0], inst, chan, dst_datatype);
}
@@ -2496,7 +2496,7 @@ exec_scalar_binary(struct tgsi_exec_machine *mach,
fetch_source(mach, &src[0], &inst->Src[0], TGSI_CHAN_X, src_datatype);
fetch_source(mach, &src[1], &inst->Src[1], TGSI_CHAN_Y, src_datatype);
op(&dst, &src[0], &src[1]);
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &dst, &inst->Dst[0], inst, chan, dst_datatype);
}
@@ -2513,7 +2513,7 @@ exec_vector_binary(struct tgsi_exec_machine *mach,
unsigned int chan;
struct tgsi_exec_vector dst;
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
union tgsi_exec_channel src[2];
@@ -2522,7 +2522,7 @@ exec_vector_binary(struct tgsi_exec_machine *mach,
op(&dst.xyzw[chan], &src[0], &src[1]);
}
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &dst.xyzw[chan], &inst->Dst[0], inst, chan, dst_datatype);
}
@@ -2544,7 +2544,7 @@ exec_vector_trinary(struct tgsi_exec_machine *mach,
unsigned int chan;
struct tgsi_exec_vector dst;
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
union tgsi_exec_channel src[3];
@@ -2554,7 +2554,7 @@ exec_vector_trinary(struct tgsi_exec_machine *mach,
op(&dst.xyzw[chan], &src[0], &src[1], &src[2]);
}
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &dst.xyzw[chan], &inst->Dst[0], inst, chan, dst_datatype);
}
@@ -2578,7 +2578,7 @@ exec_dp3(struct tgsi_exec_machine *mach,
micro_mad(&arg[2], &arg[0], &arg[1], &arg[2]);
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &arg[2], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
@@ -2602,7 +2602,7 @@ exec_dp4(struct tgsi_exec_machine *mach,
micro_mad(&arg[2], &arg[0], &arg[1], &arg[2]);
}
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &arg[2], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
@@ -2627,7 +2627,7 @@ exec_dp2a(struct tgsi_exec_machine *mach,
fetch_source(mach, &arg[1], &inst->Src[2], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT);
micro_add(&arg[0], &arg[0], &arg[1]);
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &arg[0], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
@@ -2656,7 +2656,7 @@ exec_dph(struct tgsi_exec_machine *mach,
fetch_source(mach, &arg[1], &inst->Src[1], TGSI_CHAN_W, TGSI_EXEC_DATA_FLOAT);
micro_add(&arg[0], &arg[0], &arg[1]);
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &arg[0], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
@@ -2678,7 +2678,7 @@ exec_dp2(struct tgsi_exec_machine *mach,
fetch_source(mach, &arg[1], &inst->Src[1], TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT);
micro_mad(&arg[2], &arg[0], &arg[1], &arg[2]);
- for (chan = 0; chan < NUM_CHANNELS; chan++) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
if (inst->Dst[0].Register.WriteMask & (1 << chan)) {
store_dest(mach, &arg[2], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT);
}
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index 63c7087856b..613b3837eb3 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -42,8 +42,8 @@ extern "C" {
#define TGSI_CHAN_Z 2
#define TGSI_CHAN_W 3
-#define NUM_CHANNELS 4 /* R,G,B,A */
-#define QUAD_SIZE 4 /* 4 pixel/quad */
+#define TGSI_NUM_CHANNELS 4 /* R,G,B,A */
+#define TGSI_QUAD_SIZE 4 /* 4 pixel/quad */
/**
@@ -51,9 +51,9 @@ extern "C" {
*/
union tgsi_exec_channel
{
- float f[QUAD_SIZE];
- int i[QUAD_SIZE];
- unsigned u[QUAD_SIZE];
+ float f[TGSI_QUAD_SIZE];
+ int i[TGSI_QUAD_SIZE];
+ unsigned u[TGSI_QUAD_SIZE];
};
/**
@@ -61,7 +61,7 @@ union tgsi_exec_channel
*/
struct tgsi_exec_vector
{
- union tgsi_exec_channel xyzw[NUM_CHANNELS];
+ union tgsi_exec_channel xyzw[TGSI_NUM_CHANNELS];
};
/**
@@ -70,9 +70,9 @@ struct tgsi_exec_vector
*/
struct tgsi_interp_coef
{
- float a0[NUM_CHANNELS]; /* in an xyzw layout */
- float dadx[NUM_CHANNELS];
- float dady[NUM_CHANNELS];
+ float a0[TGSI_NUM_CHANNELS]; /* in an xyzw layout */
+ float dadx[TGSI_NUM_CHANNELS];
+ float dady[TGSI_NUM_CHANNELS];
};
enum tgsi_sampler_control {
@@ -88,18 +88,18 @@ struct tgsi_sampler
{
/** Get samples for four fragments in a quad */
void (*get_samples)(struct tgsi_sampler *sampler,
- const float s[QUAD_SIZE],
- const float t[QUAD_SIZE],
- const float p[QUAD_SIZE],
- const float c0[QUAD_SIZE],
+ const float s[TGSI_QUAD_SIZE],
+ const float t[TGSI_QUAD_SIZE],
+ const float p[TGSI_QUAD_SIZE],
+ const float c0[TGSI_QUAD_SIZE],
enum tgsi_sampler_control control,
- float rgba[NUM_CHANNELS][QUAD_SIZE]);
+ float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE]);
void (*get_dims)(struct tgsi_sampler *sampler, int level,
int dims[4]);
- void (*get_texel)(struct tgsi_sampler *sampler, const int i[QUAD_SIZE],
- const int j[QUAD_SIZE], const int k[QUAD_SIZE],
- const int lod[QUAD_SIZE], const int8_t offset[3],
- float rgba[NUM_CHANNELS][QUAD_SIZE]);
+ void (*get_texel)(struct tgsi_sampler *sampler, const int i[TGSI_QUAD_SIZE],
+ const int j[TGSI_QUAD_SIZE], const int k[TGSI_QUAD_SIZE],
+ const int lod[TGSI_QUAD_SIZE], const int8_t offset[3],
+ float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE]);
};
#define TGSI_EXEC_NUM_TEMPS 128