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,
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:
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],
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];
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)
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, "");
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)
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]);
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;
static void
generate_viewport(struct draw_llvm *llvm,
LLVMBuilderRef builder,
- LLVMValueRef (*outputs)[NUM_CHANNELS],
+ LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS],
LLVMValueRef context_ptr)
{
int i;
*/
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,
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;
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;
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,
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,
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;
}
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);
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]]);
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",
/* 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);
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);
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);
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];
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);
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);
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);
default:
assert(0);
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
chan->u[i] = 0;
}
}
/* 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;
}
/* 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;
}
/* 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;
}
#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");
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);
}
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;
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;
{
/* 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) {
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) {
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);
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);
}
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);
}
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];
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);
}
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);
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);
}
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);
}
{
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];
}
}
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 {
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);
{
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;
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);
}
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;
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);
}
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);
}
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];
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);
}
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];
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
#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 */
/**
*/
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];
};
/**
*/
struct tgsi_exec_vector
{
- union tgsi_exec_channel xyzw[NUM_CHANNELS];
+ union tgsi_exec_channel xyzw[TGSI_NUM_CHANNELS];
};
/**
*/
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 {
{
/** 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
for (attrib = 0; attrib < bld->num_attribs; ++attrib) {
const unsigned mask = bld->mask[attrib];
const unsigned interp = bld->interp[attrib];
- for (chan = 0; chan < NUM_CHANNELS; ++chan) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; ++chan) {
if (mask & (1 << chan)) {
LLVMValueRef index = lp_build_const_int32(gallivm,
- attrib * NUM_CHANNELS + chan);
+ attrib * TGSI_NUM_CHANNELS + chan);
LLVMValueRef a0 = zero;
LLVMValueRef dadx = zero;
LLVMValueRef dady = zero;
for(attrib = start; attrib < end; ++attrib) {
const unsigned mask = bld->mask[attrib];
const unsigned interp = bld->interp[attrib];
- for(chan = 0; chan < NUM_CHANNELS; ++chan) {
+ for(chan = 0; chan < TGSI_NUM_CHANNELS; ++chan) {
if(mask & (1 << chan)) {
LLVMValueRef a;
if (interp == LP_INTERP_CONSTANT ||
coeff_type.floating = TRUE;
coeff_type.sign = TRUE;
coeff_type.width = 32;
- coeff_type.length = QUAD_SIZE;
+ coeff_type.length = TGSI_QUAD_SIZE;
/* XXX: we don't support interpolating into any other types */
assert(memcmp(&coeff_type, &type, sizeof coeff_type) == 0);
/* For convenience */
bld->pos = bld->attribs[0];
- bld->inputs = (const LLVMValueRef (*)[NUM_CHANNELS]) bld->attribs[1];
+ bld->inputs = (const LLVMValueRef (*)[TGSI_NUM_CHANNELS]) bld->attribs[1];
/* Position */
bld->num_attribs = 1;
/* Ensure all masked out input channels have a valid value */
for (attrib = 0; attrib < bld->num_attribs; ++attrib) {
- for (chan = 0; chan < NUM_CHANNELS; ++chan) {
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; ++chan) {
bld->attribs[attrib][chan] = bld->coeff_bld.undef;
}
}
struct lp_build_interp_soa_context
{
- /* QUAD_SIZE x float */
+ /* TGSI_QUAD_SIZE x float */
struct lp_build_context coeff_bld;
unsigned num_attribs;
LLVMValueRef x;
LLVMValueRef y;
- LLVMValueRef a [1 + PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
- LLVMValueRef dadq[1 + PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
+ LLVMValueRef a [1 + PIPE_MAX_SHADER_INPUTS][TGSI_NUM_CHANNELS];
+ LLVMValueRef dadq[1 + PIPE_MAX_SHADER_INPUTS][TGSI_NUM_CHANNELS];
LLVMValueRef oow;
- LLVMValueRef attribs[1 + PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
+ LLVMValueRef attribs[1 + PIPE_MAX_SHADER_INPUTS][TGSI_NUM_CHANNELS];
/*
* Convenience pointers. Callers may access this one.
*/
const LLVMValueRef *pos;
- const LLVMValueRef (*inputs)[NUM_CHANNELS];
+ const LLVMValueRef (*inputs)[TGSI_NUM_CHANNELS];
};
const struct tgsi_token *tokens = shader->base.tokens;
LLVMTypeRef vec_type;
LLVMValueRef consts_ptr;
- LLVMValueRef outputs[PIPE_MAX_SHADER_OUTPUTS][NUM_CHANNELS];
+ LLVMValueRef outputs[PIPE_MAX_SHADER_OUTPUTS][TGSI_NUM_CHANNELS];
LLVMValueRef z;
LLVMValueRef zs_value = NULL;
LLVMValueRef stencil_refs[2];
/* Declare the color and z variables */
for(cbuf = 0; cbuf < key->nr_cbufs; cbuf++) {
- for(chan = 0; chan < NUM_CHANNELS; ++chan) {
+ for(chan = 0; chan < TGSI_NUM_CHANNELS; ++chan) {
color[cbuf][chan] = lp_build_alloca(gallivm, vec_type, "color");
}
}
shader->info.base.output_semantic_index[attrib] < key->nr_cbufs)
{
unsigned cbuf = shader->info.base.output_semantic_index[attrib];
- for(chan = 0; chan < NUM_CHANNELS; ++chan) {
+ for(chan = 0; chan < TGSI_NUM_CHANNELS; ++chan) {
if(outputs[attrib][chan]) {
/* XXX: just initialize outputs to point at colors[] and
* skip this.
struct lp_build_sampler_soa *sampler;
struct lp_build_interp_soa_context interp;
LLVMValueRef fs_mask[LP_MAX_VECTOR_LENGTH];
- LLVMValueRef fs_out_color[PIPE_MAX_COLOR_BUFS][NUM_CHANNELS][LP_MAX_VECTOR_LENGTH];
+ LLVMValueRef fs_out_color[PIPE_MAX_COLOR_BUFS][TGSI_NUM_CHANNELS][LP_MAX_VECTOR_LENGTH];
LLVMValueRef blend_mask;
LLVMValueRef function;
LLVMValueRef facing;
LLVMValueRef depth_offset = LLVMConstInt(int32_type,
i*fs_type.length*zs_format_desc->block.bits/8,
0);
- LLVMValueRef out_color[PIPE_MAX_COLOR_BUFS][NUM_CHANNELS];
+ LLVMValueRef out_color[PIPE_MAX_COLOR_BUFS][TGSI_NUM_CHANNELS];
LLVMValueRef depth_ptr_i;
depth_ptr_i = LLVMBuildGEP(builder, depth_ptr, &depth_offset, 1, "");
counter);
for (cbuf = 0; cbuf < key->nr_cbufs; cbuf++)
- for (chan = 0; chan < NUM_CHANNELS; ++chan)
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; ++chan)
fs_out_color[cbuf][chan][i] =
out_color[cbuf * !cbuf0_write_all][chan];
}
for(cbuf = 0; cbuf < key->nr_cbufs; cbuf++) {
LLVMValueRef color_ptr;
LLVMValueRef index = lp_build_const_int32(gallivm, cbuf);
- LLVMValueRef blend_in_color[NUM_CHANNELS];
+ LLVMValueRef blend_in_color[TGSI_NUM_CHANNELS];
unsigned rt;
/*
* Convert the fs's output color and mask to fit to the blending type.
*/
- for(chan = 0; chan < NUM_CHANNELS; ++chan) {
+ for(chan = 0; chan < TGSI_NUM_CHANNELS; ++chan) {
LLVMValueRef fs_color_vals[LP_MAX_VECTOR_LENGTH];
for (i = 0; i < num_fs; i++) {
{
int i, slot;
- for (i = 0; i < NUM_CHANNELS; i++) {
+ for (i = 0; i < TGSI_NUM_CHANNELS; i++) {
float a0 = sa0 [0][i];
float dadx = sdadx[0][i];
float dady = sdady[0][i];
for (slot = 0; slot < key->num_inputs; slot++) {
unsigned usage_mask = key->inputs[slot].usage_mask;
- for (i = 0; i < NUM_CHANNELS; i++) {
+ for (i = 0; i < TGSI_NUM_CHANNELS; i++) {
if (usage_mask & (1 << i)) {
float a0 = sa0 [1 + slot][i];
float dadx = sdadx[1 + slot][i];
#define LP_TILE_SOA_H
#include "pipe/p_compiler.h"
-#include "tgsi/tgsi_exec.h" /* for NUM_CHANNELS */
+#include "tgsi/tgsi_exec.h" /* for TGSI_NUM_CHANNELS */
#include "lp_limits.h"
#ifdef __cplusplus
tile_offset[TILE_VECTOR_HEIGHT][TILE_VECTOR_WIDTH];
#define TILE_C_STRIDE (TILE_VECTOR_HEIGHT * TILE_VECTOR_WIDTH) //16
-#define TILE_X_STRIDE (NUM_CHANNELS * TILE_C_STRIDE) //64
-#define TILE_Y_STRIDE (TILE_VECTOR_HEIGHT * TILE_SIZE * NUM_CHANNELS) //1024
+#define TILE_X_STRIDE (TGSI_NUM_CHANNELS * TILE_C_STRIDE) //64
+#define TILE_Y_STRIDE (TILE_VECTOR_HEIGHT * TILE_SIZE * TGSI_NUM_CHANNELS) //1024
#ifdef DEBUG
struct quad_header_input
{
int x0, y0; /**< quad window pos, always even */
- float coverage[QUAD_SIZE]; /**< fragment coverage for antialiasing */
+ float coverage[TGSI_QUAD_SIZE]; /**< fragment coverage for antialiasing */
unsigned facing:1; /**< Front (0) or back (1) facing? */
unsigned prim:2; /**< QUAD_PRIM_POINT, LINE, TRI */
};
struct quad_header_output
{
/** colors in SOA format (rrrr, gggg, bbbb, aaaa) */
- float color[PIPE_MAX_COLOR_BUFS][NUM_CHANNELS][QUAD_SIZE];
- float depth[QUAD_SIZE];
- uint8_t stencil[QUAD_SIZE];
+ float color[PIPE_MAX_COLOR_BUFS][TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE];
+ float depth[TGSI_QUAD_SIZE];
+ uint8_t stencil[TGSI_QUAD_SIZE];
};
static const float zero[4] = { 0, 0, 0, 0 };
static const float one[4] = { 1, 1, 1, 1 };
struct softpipe_context *softpipe = qs->softpipe;
- float source[4][QUAD_SIZE] = { { 0 } };
- float blend_dest[4][QUAD_SIZE];
+ float source[4][TGSI_QUAD_SIZE] = { { 0 } };
+ float blend_dest[4][TGSI_QUAD_SIZE];
/*
* Compute src/first term RGB
break;
case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
{
- float one_minus_alpha[QUAD_SIZE];
+ float one_minus_alpha[TGSI_QUAD_SIZE];
VEC4_SUB(one_minus_alpha, one, quadColor[3]);
VEC4_MUL(blend_dest[0], blend_dest[0], one_minus_alpha); /* R */
VEC4_MUL(blend_dest[1], blend_dest[1], one_minus_alpha); /* G */
/* fall-through */
case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
{
- float one_minus_alpha[QUAD_SIZE];
+ float one_minus_alpha[TGSI_QUAD_SIZE];
VEC4_SUB(one_minus_alpha, one, quadColor[3]);
VEC4_MUL(blend_dest[3], blend_dest[3], one_minus_alpha); /* A */
}
{
unsigned i, j;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
for (i = 0; i < 4; i++) {
quadColor[i][j] = CLAMP(quadColor[i][j], 0.0F, 1.0F);
}
{
/* which blend/mask state index to use: */
const uint blend_buf = blend->independent_blend_enable ? cbuf : 0;
- float dest[4][QUAD_SIZE];
+ float dest[4][TGSI_QUAD_SIZE];
struct softpipe_cached_tile *tile
= sp_get_cached_tile(softpipe->cbuf_cache[cbuf],
quads[0]->input.x0,
for (q = 0; q < nr; q++) {
struct quad_header *quad = quads[q];
float (*quadColor)[4];
- float temp_quad_color[QUAD_SIZE][4];
+ float temp_quad_color[TGSI_QUAD_SIZE][4];
const int itx = (quad->input.x0 & (TILE_SIZE-1));
const int ity = (quad->input.y0 & (TILE_SIZE-1));
if (write_all) {
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
for (i = 0; i < 4; i++) {
temp_quad_color[i][j] = quad->output.color[0][i][j];
}
/* get/swizzle dest colors
*/
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = itx + (j & 1);
int y = ity + (j >> 1);
for (i = 0; i < 4; i++) {
/* Output color values
*/
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (quad->inout.mask & (1 << j)) {
int x = itx + (j & 1);
int y = ity + (j >> 1);
{
const struct blend_quad_stage *bqs = blend_quad_stage(qs);
static const float one[4] = { 1, 1, 1, 1 };
- float one_minus_alpha[QUAD_SIZE];
- float dest[4][QUAD_SIZE];
- float source[4][QUAD_SIZE];
+ float one_minus_alpha[TGSI_QUAD_SIZE];
+ float dest[4][TGSI_QUAD_SIZE];
+ float source[4][TGSI_QUAD_SIZE];
uint i, j, q;
struct softpipe_cached_tile *tile
const int ity = (quad->input.y0 & (TILE_SIZE-1));
/* get/swizzle dest colors */
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = itx + (j & 1);
int y = ity + (j >> 1);
for (i = 0; i < 4; i++) {
rebase_colors(bqs->base_format[0], quadColor);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (quad->inout.mask & (1 << j)) {
int x = itx + (j & 1);
int y = ity + (j >> 1);
unsigned nr)
{
const struct blend_quad_stage *bqs = blend_quad_stage(qs);
- float dest[4][QUAD_SIZE];
+ float dest[4][TGSI_QUAD_SIZE];
uint i, j, q;
struct softpipe_cached_tile *tile
const int ity = (quad->input.y0 & (TILE_SIZE-1));
/* get/swizzle dest colors */
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = itx + (j & 1);
int y = ity + (j >> 1);
for (i = 0; i < 4; i++) {
rebase_colors(bqs->base_format[0], quadColor);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (quad->inout.mask & (1 << j)) {
int x = itx + (j & 1);
int y = ity + (j >> 1);
rebase_colors(bqs->base_format[0], quadColor);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (quad->inout.mask & (1 << j)) {
int x = itx + (j & 1);
int y = ity + (j >> 1);
struct depth_data {
struct pipe_surface *ps;
enum pipe_format format;
- unsigned bzzzz[QUAD_SIZE]; /**< Z values fetched from depth buffer */
- unsigned qzzzz[QUAD_SIZE]; /**< Z values from the quad */
- ubyte stencilVals[QUAD_SIZE];
+ unsigned bzzzz[TGSI_QUAD_SIZE]; /**< Z values fetched from depth buffer */
+ unsigned qzzzz[TGSI_QUAD_SIZE]; /**< Z values from the quad */
+ ubyte stencilVals[TGSI_QUAD_SIZE];
boolean use_shader_stencil_refs;
- ubyte shader_stencil_refs[QUAD_SIZE];
+ ubyte shader_stencil_refs[TGSI_QUAD_SIZE];
struct softpipe_cached_tile *tile;
};
switch (data->format) {
case PIPE_FORMAT_Z16_UNORM:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
data->bzzzz[j] = tile->data.depth16[y][x];
}
break;
case PIPE_FORMAT_Z32_UNORM:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
data->bzzzz[j] = tile->data.depth32[y][x];
break;
case PIPE_FORMAT_Z24X8_UNORM:
case PIPE_FORMAT_Z24_UNORM_S8_UINT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
data->bzzzz[j] = tile->data.depth32[y][x] & 0xffffff;
break;
case PIPE_FORMAT_X8Z24_UNORM:
case PIPE_FORMAT_S8_UINT_Z24_UNORM:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
data->bzzzz[j] = tile->data.depth32[y][x] >> 8;
}
break;
case PIPE_FORMAT_S8_UINT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
data->bzzzz[j] = 0;
}
break;
case PIPE_FORMAT_Z32_FLOAT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
data->bzzzz[j] = tile->data.depth32[y][x];
}
break;
case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
data->bzzzz[j] = tile->data.depth64[y][x] & 0xffffffff;
{
float scale = 65535.0;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
data->qzzzz[j] = (unsigned) (quad->output.depth[j] * scale);
}
}
{
double scale = (double) (uint) ~0UL;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
data->qzzzz[j] = (unsigned) (quad->output.depth[j] * scale);
}
}
{
float scale = (float) ((1 << 24) - 1);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
data->qzzzz[j] = (unsigned) (quad->output.depth[j] * scale);
}
}
{
float scale = (float) ((1 << 24) - 1);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
data->qzzzz[j] = (unsigned) (quad->output.depth[j] * scale);
}
}
{
union fi fui;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
fui.f = quad->output.depth[j];
data->qzzzz[j] = fui.ui;
}
case PIPE_FORMAT_S8_UINT:
case PIPE_FORMAT_Z32_FLOAT:
case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
data->shader_stencil_refs[j] = ((unsigned)(quad->output.stencil[j]));
}
break;
/* put updated Z values back into cached tile */
switch (data->format) {
case PIPE_FORMAT_Z16_UNORM:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
tile->data.depth16[y][x] = (ushort) data->bzzzz[j];
break;
case PIPE_FORMAT_Z24X8_UNORM:
case PIPE_FORMAT_Z32_UNORM:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
tile->data.depth32[y][x] = data->bzzzz[j];
}
break;
case PIPE_FORMAT_Z24_UNORM_S8_UINT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
tile->data.depth32[y][x] = (data->stencilVals[j] << 24) | data->bzzzz[j];
}
break;
case PIPE_FORMAT_S8_UINT_Z24_UNORM:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
tile->data.depth32[y][x] = (data->bzzzz[j] << 8) | data->stencilVals[j];
}
break;
case PIPE_FORMAT_X8Z24_UNORM:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
tile->data.depth32[y][x] = data->bzzzz[j] << 8;
}
break;
case PIPE_FORMAT_S8_UINT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
tile->data.stencil8[y][x] = data->stencilVals[j];
}
break;
case PIPE_FORMAT_Z32_FLOAT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
tile->data.depth32[y][x] = data->bzzzz[j];
}
break;
case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int x = quad->input.x0 % TILE_SIZE + (j & 1);
int y = quad->input.y0 % TILE_SIZE + (j >> 1);
tile->data.depth64[y][x] = (uint64_t)data->bzzzz[j] | ((uint64_t)data->stencilVals[j] << 32);
{
unsigned passMask = 0x0;
unsigned j;
- ubyte refs[QUAD_SIZE];
+ ubyte refs[TGSI_QUAD_SIZE];
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (data->use_shader_stencil_refs)
refs[j] = data->shader_stencil_refs[j] & valMask;
else
/* passMask = 0x0 */
break;
case PIPE_FUNC_LESS:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (refs[j] < (data->stencilVals[j] & valMask)) {
passMask |= (1 << j);
}
}
break;
case PIPE_FUNC_EQUAL:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (refs[j] == (data->stencilVals[j] & valMask)) {
passMask |= (1 << j);
}
}
break;
case PIPE_FUNC_LEQUAL:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (refs[j] <= (data->stencilVals[j] & valMask)) {
passMask |= (1 << j);
}
}
break;
case PIPE_FUNC_GREATER:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (refs[j] > (data->stencilVals[j] & valMask)) {
passMask |= (1 << j);
}
}
break;
case PIPE_FUNC_NOTEQUAL:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (refs[j] != (data->stencilVals[j] & valMask)) {
passMask |= (1 << j);
}
}
break;
case PIPE_FUNC_GEQUAL:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (refs[j] >= (data->stencilVals[j] & valMask)) {
passMask |= (1 << j);
}
unsigned mask, unsigned op, ubyte ref, ubyte wrtMask)
{
unsigned j;
- ubyte newstencil[QUAD_SIZE];
- ubyte refs[QUAD_SIZE];
+ ubyte newstencil[TGSI_QUAD_SIZE];
+ ubyte refs[TGSI_QUAD_SIZE];
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
newstencil[j] = data->stencilVals[j];
if (data->use_shader_stencil_refs)
refs[j] = data->shader_stencil_refs[j];
/* no-op */
break;
case PIPE_STENCIL_OP_ZERO:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (mask & (1 << j)) {
newstencil[j] = 0;
}
}
break;
case PIPE_STENCIL_OP_REPLACE:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (mask & (1 << j)) {
newstencil[j] = refs[j];
}
}
break;
case PIPE_STENCIL_OP_INCR:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (mask & (1 << j)) {
if (data->stencilVals[j] < STENCIL_MAX) {
newstencil[j] = data->stencilVals[j] + 1;
}
break;
case PIPE_STENCIL_OP_DECR:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (mask & (1 << j)) {
if (data->stencilVals[j] > 0) {
newstencil[j] = data->stencilVals[j] - 1;
}
break;
case PIPE_STENCIL_OP_INCR_WRAP:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (mask & (1 << j)) {
newstencil[j] = data->stencilVals[j] + 1;
}
}
break;
case PIPE_STENCIL_OP_DECR_WRAP:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (mask & (1 << j)) {
newstencil[j] = data->stencilVals[j] - 1;
}
}
break;
case PIPE_STENCIL_OP_INVERT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (mask & (1 << j)) {
newstencil[j] = ~data->stencilVals[j];
}
*/
if (wrtMask != STENCIL_MAX) {
/* apply bit-wise stencil buffer writemask */
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
data->stencilVals[j] = (wrtMask & newstencil[j]) | (~wrtMask & data->stencilVals[j]);
}
}
else {
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
data->stencilVals[j] = newstencil[j];
}
}
/* Note this is pretty much a single sse or cell instruction.
* Like this: quad->mask &= (quad->outputs.depth < zzzz);
*/
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (data->qzzzz[j] < data->bzzzz[j])
zmask |= 1 << j;
}
break;
case PIPE_FUNC_EQUAL:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (data->qzzzz[j] == data->bzzzz[j])
zmask |= 1 << j;
}
break;
case PIPE_FUNC_LEQUAL:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (data->qzzzz[j] <= data->bzzzz[j])
zmask |= (1 << j);
}
break;
case PIPE_FUNC_GREATER:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (data->qzzzz[j] > data->bzzzz[j])
zmask |= (1 << j);
}
break;
case PIPE_FUNC_NOTEQUAL:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (data->qzzzz[j] != data->bzzzz[j])
zmask |= (1 << j);
}
break;
case PIPE_FUNC_GEQUAL:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (data->qzzzz[j] >= data->bzzzz[j])
zmask |= (1 << j);
}
* data due to stencil changes.
*/
if (softpipe->depth_stencil->depth.writemask) {
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
if (quad->inout.mask & (1 << j)) {
data->bzzzz[j] = data->qzzzz[j];
}
for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) {
float (*quadColor)[4] = quad->output.color[cbuf];
unsigned j;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
assert(quad->input.coverage[j] >= 0.0);
assert(quad->input.coverage[j] <= 1.0);
quadColor[3][j] *= quad->input.coverage[j];
switch (vinfo->attrib[fragSlot].interp_mode) {
case INTERP_CONSTANT:
- for (j = 0; j < NUM_CHANNELS; j++)
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++)
const_coeff(setup, &setup->coef[fragSlot], vertSlot, j);
break;
case INTERP_LINEAR:
- for (j = 0; j < NUM_CHANNELS; j++) {
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++) {
tri_apply_cylindrical_wrap(setup->vmin[vertSlot][j],
setup->vmid[vertSlot][j],
setup->vmax[vertSlot][j],
}
break;
case INTERP_PERSPECTIVE:
- for (j = 0; j < NUM_CHANNELS; j++) {
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++) {
tri_apply_cylindrical_wrap(setup->vmin[vertSlot][j],
setup->vmid[vertSlot][j],
setup->vmax[vertSlot][j],
switch (vinfo->attrib[fragSlot].interp_mode) {
case INTERP_CONSTANT:
- for (j = 0; j < NUM_CHANNELS; j++)
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++)
const_coeff(setup, &setup->coef[fragSlot], vertSlot, j);
break;
case INTERP_LINEAR:
- for (j = 0; j < NUM_CHANNELS; j++) {
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++) {
line_apply_cylindrical_wrap(setup->vmin[vertSlot][j],
setup->vmax[vertSlot][j],
fsInfo->input_cylindrical_wrap[fragSlot] & (1 << j),
}
break;
case INTERP_PERSPECTIVE:
- for (j = 0; j < NUM_CHANNELS; j++) {
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++) {
line_apply_cylindrical_wrap(setup->vmin[vertSlot][j],
setup->vmax[vertSlot][j],
fsInfo->input_cylindrical_wrap[fragSlot] & (1 << j),
case INTERP_CONSTANT:
/* fall-through */
case INTERP_LINEAR:
- for (j = 0; j < NUM_CHANNELS; j++)
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++)
const_coeff(setup, &setup->coef[fragSlot], vertSlot, j);
break;
case INTERP_PERSPECTIVE:
- for (j = 0; j < NUM_CHANNELS; j++)
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++)
point_persp_coeff(setup, setup->vprovoke,
&setup->coef[fragSlot], vertSlot, j);
break;
*/
static float
compute_lambda_1d(const struct sp_sampler_variant *samp,
- const float s[QUAD_SIZE],
- const float t[QUAD_SIZE],
- const float p[QUAD_SIZE])
+ const float s[TGSI_QUAD_SIZE],
+ const float t[TGSI_QUAD_SIZE],
+ const float p[TGSI_QUAD_SIZE])
{
const struct pipe_resource *texture = samp->view->texture;
float dsdx = fabsf(s[QUAD_BOTTOM_RIGHT] - s[QUAD_BOTTOM_LEFT]);
static float
compute_lambda_2d(const struct sp_sampler_variant *samp,
- const float s[QUAD_SIZE],
- const float t[QUAD_SIZE],
- const float p[QUAD_SIZE])
+ const float s[TGSI_QUAD_SIZE],
+ const float t[TGSI_QUAD_SIZE],
+ const float p[TGSI_QUAD_SIZE])
{
const struct pipe_resource *texture = samp->view->texture;
float dsdx = fabsf(s[QUAD_BOTTOM_RIGHT] - s[QUAD_BOTTOM_LEFT]);
static float
compute_lambda_3d(const struct sp_sampler_variant *samp,
- const float s[QUAD_SIZE],
- const float t[QUAD_SIZE],
- const float p[QUAD_SIZE])
+ const float s[TGSI_QUAD_SIZE],
+ const float t[TGSI_QUAD_SIZE],
+ const float p[TGSI_QUAD_SIZE])
{
const struct pipe_resource *texture = samp->view->texture;
float dsdx = fabsf(s[QUAD_BOTTOM_RIGHT] - s[QUAD_BOTTOM_LEFT]);
*/
static float
compute_lambda_vert(const struct sp_sampler_variant *samp,
- const float s[QUAD_SIZE],
- const float t[QUAD_SIZE],
- const float p[QUAD_SIZE])
+ const float s[TGSI_QUAD_SIZE],
+ const float t[TGSI_QUAD_SIZE],
+ const float p[TGSI_QUAD_SIZE])
{
return 0.0f;
}
static void
-print_sample(const char *function, float rgba[NUM_CHANNELS][QUAD_SIZE])
+print_sample(const char *function, float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE])
{
debug_printf("%s %g %g %g %g, %g %g %g %g, %g %g %g %g, %g %g %g %g\n",
function,
*/
static INLINE void
img_filter_2d_linear_repeat_POT(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
unsigned j;
addr.value = 0;
addr.bits.level = samp->level;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int c;
float u = s[j] * xpot - 0.5F;
static INLINE void
img_filter_2d_nearest_repeat_POT(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
unsigned j;
addr.value = 0;
addr.bits.level = samp->level;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int c;
float u = s[j] * xpot;
static INLINE void
img_filter_2d_nearest_clamp_POT(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
unsigned j;
addr.value = 0;
addr.bits.level = samp->level;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int c;
float u = s[j] * xpot;
static void
img_filter_1d_nearest(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->nearest_texcoord_s(s, width, x);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *out = get_texel_2d(samp, addr, x[j], 0);
int c;
for (c = 0; c < 4; c++) {
static void
img_filter_1d_array_nearest(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->nearest_texcoord_s(s, width, x);
wrap_array_layer(t, texture->array_size, layer);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *out = get_texel_1d_array(samp, addr, x[j], layer[j]);
int c;
for (c = 0; c < 4; c++) {
static void
img_filter_2d_nearest(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->nearest_texcoord_s(s, width, x);
samp->nearest_texcoord_t(t, height, y);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *out = get_texel_2d(samp, addr, x[j], y[j]);
int c;
for (c = 0; c < 4; c++) {
static void
img_filter_2d_array_nearest(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->nearest_texcoord_t(t, height, y);
wrap_array_layer(p, texture->array_size, layer);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *out = get_texel_2d_array(samp, addr, x[j], y[j], layer[j]);
int c;
for (c = 0; c < 4; c++) {
static void
img_filter_cube_nearest(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->nearest_texcoord_s(s, width, x);
samp->nearest_texcoord_t(t, height, y);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *out = get_texel_2d(samp, face(addr, faces[j]), x[j], y[j]);
int c;
for (c = 0; c < 4; c++) {
static void
img_filter_3d_nearest(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
addr.value = 0;
addr.bits.level = samp->level;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *out = get_texel_3d(samp, addr, x[j], y[j], z[j]);
int c;
for (c = 0; c < 4; c++) {
static void
img_filter_1d_linear(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->linear_texcoord_s(s, width, x0, x1, xw);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *tx0 = get_texel_2d(samp, addr, x0[j], 0);
const float *tx1 = get_texel_2d(samp, addr, x1[j], 0);
int c;
static void
img_filter_1d_array_linear(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->linear_texcoord_s(s, width, x0, x1, xw);
wrap_array_layer(t, texture->array_size, layer);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *tx0 = get_texel_1d_array(samp, addr, x0[j], layer[j]);
const float *tx1 = get_texel_1d_array(samp, addr, x1[j], layer[j]);
int c;
static void
img_filter_2d_linear(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->linear_texcoord_s(s, width, x0, x1, xw);
samp->linear_texcoord_t(t, height, y0, y1, yw);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *tx0 = get_texel_2d(samp, addr, x0[j], y0[j]);
const float *tx1 = get_texel_2d(samp, addr, x1[j], y0[j]);
const float *tx2 = get_texel_2d(samp, addr, x0[j], y1[j]);
static void
img_filter_2d_array_linear(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->linear_texcoord_t(t, height, y0, y1, yw);
wrap_array_layer(p, texture->array_size, layer);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float *tx0 = get_texel_2d_array(samp, addr, x0[j], y0[j], layer[j]);
const float *tx1 = get_texel_2d_array(samp, addr, x1[j], y0[j], layer[j]);
const float *tx2 = get_texel_2d_array(samp, addr, x0[j], y1[j], layer[j]);
static void
img_filter_cube_linear(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->linear_texcoord_s(s, width, x0, x1, xw);
samp->linear_texcoord_t(t, height, y0, y1, yw);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
union tex_tile_address addrj = face(addr, faces[j]);
const float *tx0 = get_texel_2d(samp, addrj, x0[j], y0[j]);
const float *tx1 = get_texel_2d(samp, addrj, x1[j], y0[j]);
static void
img_filter_3d_linear(struct tgsi_sampler *tgsi_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])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
samp->linear_texcoord_t(t, height, y0, y1, yw);
samp->linear_texcoord_p(p, depth, z0, z1, zw);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
int c;
const float *tx00 = get_texel_3d(samp, addr, x0[j], y0[j], z0[j]);
static INLINE void
compute_lod(const struct pipe_sampler_state *sampler,
const float biased_lambda,
- const float lodbias[QUAD_SIZE],
- float lod[QUAD_SIZE])
+ const float lodbias[TGSI_QUAD_SIZE],
+ float lod[TGSI_QUAD_SIZE])
{
uint i;
- for (i = 0; i < QUAD_SIZE; i++) {
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
lod[i] = biased_lambda + lodbias[i];
lod[i] = CLAMP(lod[i], sampler->min_lod, sampler->max_lod);
}
static void
mip_filter_linear(struct tgsi_sampler *tgsi_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])
{
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
int level0;
float lambda;
- float lod[QUAD_SIZE];
+ float lod[TGSI_QUAD_SIZE];
if (control == tgsi_sampler_lod_bias) {
lambda = samp->compute_lambda(samp, s, t, p) + samp->sampler->lod_bias;
samp->level = level0+1;
samp->min_img_filter(tgsi_sampler, s, t, p, NULL, tgsi_sampler_lod_bias, rgba1);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
for (c = 0; c < 4; c++) {
rgba[c][j] = lerp(levelBlend, rgba0[c][j], rgba1[c][j]);
}
*/
static void
mip_filter_nearest(struct tgsi_sampler *tgsi_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])
{
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
float lambda;
- float lod[QUAD_SIZE];
+ float lod[TGSI_QUAD_SIZE];
if (control == tgsi_sampler_lod_bias) {
lambda = samp->compute_lambda(samp, s, t, p) + samp->sampler->lod_bias;
static void
mip_filter_none(struct tgsi_sampler *tgsi_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])
{
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
float lambda;
- float lod[QUAD_SIZE];
+ float lod[TGSI_QUAD_SIZE];
if (control == tgsi_sampler_lod_bias) {
lambda = samp->compute_lambda(samp, s, t, p) + samp->sampler->lod_bias;
*/
static void
img_filter_2d_ewa(struct tgsi_sampler *tgsi_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,
const float dudx, const float dvdx,
const float dudy, const float dvdy,
- float rgba[NUM_CHANNELS][QUAD_SIZE])
+ float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
float box_u = 2.0 / d * sqrt(d*C*F); /* box_u -> half of bbox with */
float box_v = 2.0 / d * sqrt(A*d*F); /* box_v -> half of bbox height */
- float rgba_temp[NUM_CHANNELS][QUAD_SIZE];
- float s_buffer[QUAD_SIZE];
- float t_buffer[QUAD_SIZE];
- float weight_buffer[QUAD_SIZE];
+ float rgba_temp[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE];
+ float s_buffer[TGSI_QUAD_SIZE];
+ float t_buffer[TGSI_QUAD_SIZE];
+ float weight_buffer[TGSI_QUAD_SIZE];
unsigned buffer_next;
int j;
float den;// = 0.0F;
*/
ddq = 2 * A;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
/* Heckbert MS thesis, p. 59; scan over the bounding box of the ellipse
* and incrementally update the value of Ax^2+Bxy*Cy^2; when this
* value, q, is less than F, we're inside the ellipse
t_buffer[buffer_next] = v / ((float) height);
buffer_next++;
- if (buffer_next == QUAD_SIZE) {
+ if (buffer_next == TGSI_QUAD_SIZE) {
/* 4 texel coords are in the buffer -> read it now */
unsigned jj;
/* it is assumed that samp->min_img_filter is set to
*/
static void
mip_filter_linear_aniso(struct tgsi_sampler *tgsi_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])
{
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
int level0;
float lambda;
- float lod[QUAD_SIZE];
+ float lod[TGSI_QUAD_SIZE];
float s_to_u = u_minify(texture->width0, samp->view->u.tex.first_level);
float t_to_v = u_minify(texture->height0, samp->view->u.tex.first_level);
static void
mip_filter_linear_2d_linear_repeat_POT(
struct tgsi_sampler *tgsi_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])
{
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_resource *texture = samp->view->texture;
int level0;
float lambda;
- float lod[QUAD_SIZE];
+ float lod[TGSI_QUAD_SIZE];
if (control == tgsi_sampler_lod_bias) {
lambda = samp->compute_lambda(samp, s, t, p) + samp->sampler->lod_bias;
samp->level = level0+1;
img_filter_2d_linear_repeat_POT(tgsi_sampler, s, t, p, NULL, tgsi_sampler_lod_bias, rgba1);
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
for (c = 0; c < 4; c++) {
rgba[c][j] = lerp(levelBlend, rgba0[c][j], rgba1[c][j]);
}
*/
static void
sample_compare(struct tgsi_sampler *tgsi_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])
{
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
const struct pipe_sampler_state *sampler = samp->sampler;
*/
static void
sample_cube(struct tgsi_sampler *tgsi_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])
{
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
unsigned j;
if (arx >= ary && arx >= arz) {
float sign = (rx >= 0.0F) ? 1.0F : -1.0F;
uint face = (rx >= 0.0F) ? PIPE_TEX_FACE_POS_X : PIPE_TEX_FACE_NEG_X;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float ima = -0.5F / fabsf(s[j]);
ssss[j] = sign * p[j] * ima + 0.5F;
tttt[j] = t[j] * ima + 0.5F;
else if (ary >= arx && ary >= arz) {
float sign = (ry >= 0.0F) ? 1.0F : -1.0F;
uint face = (ry >= 0.0F) ? PIPE_TEX_FACE_POS_Y : PIPE_TEX_FACE_NEG_Y;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float ima = -0.5F / fabsf(t[j]);
ssss[j] = -s[j] * ima + 0.5F;
tttt[j] = sign * -p[j] * ima + 0.5F;
else {
float sign = (rz >= 0.0F) ? 1.0F : -1.0F;
uint face = (rz >= 0.0F) ? PIPE_TEX_FACE_POS_Z : PIPE_TEX_FACE_NEG_Z;
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
const float ima = -0.5F / fabsf(p[j]);
ssss[j] = sign * -s[j] * ima + 0.5F;
tttt[j] = t[j] * ima + 0.5F;
}
static void do_swizzling(const struct sp_sampler_variant *samp,
- float in[NUM_CHANNELS][QUAD_SIZE],
- float out[NUM_CHANNELS][QUAD_SIZE])
+ float in[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE],
+ float out[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE])
{
int j;
const unsigned swizzle_r = samp->key.bits.swizzle_r;
static void
sample_swizzle(struct tgsi_sampler *tgsi_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])
{
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
- float rgba_temp[NUM_CHANNELS][QUAD_SIZE];
+ float rgba_temp[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE];
samp->sample_target(tgsi_sampler, s, t, p, c0, control, rgba_temp);
via the TGSI TXF opcode. */
static void
sample_get_texels(struct tgsi_sampler *tgsi_sampler,
- const int v_i[QUAD_SIZE],
- const int v_j[QUAD_SIZE],
- const int v_k[QUAD_SIZE],
- const int lod[QUAD_SIZE],
+ const int v_i[TGSI_QUAD_SIZE],
+ const int v_j[TGSI_QUAD_SIZE],
+ const int v_k[TGSI_QUAD_SIZE],
+ const int lod[TGSI_QUAD_SIZE],
const int8_t offset[3],
- float rgba[NUM_CHANNELS][QUAD_SIZE])
+ float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE])
{
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
union tex_tile_address addr;
switch(texture->target) {
case PIPE_TEXTURE_1D:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
tx = get_texel_2d(samp, addr, v_i[j] + offset[0], 0);
for (c = 0; c < 4; c++) {
rgba[c][j] = tx[c];
}
break;
case PIPE_TEXTURE_1D_ARRAY:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
tx = get_texel_1d_array(samp, addr, v_i[j] + offset[0],
v_j[j] + offset[1]);
for (c = 0; c < 4; c++) {
break;
case PIPE_TEXTURE_2D:
case PIPE_TEXTURE_RECT:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
tx = get_texel_2d(samp, addr, v_i[j] + offset[0],
v_j[j] + offset[1]);
for (c = 0; c < 4; c++) {
}
break;
case PIPE_TEXTURE_2D_ARRAY:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
tx = get_texel_2d_array(samp, addr, v_i[j] + offset[0],
v_j[j] + offset[1],
v_k[j] + offset[2]);
}
break;
case PIPE_TEXTURE_3D:
- for (j = 0; j < QUAD_SIZE; j++) {
+ for (j = 0; j < TGSI_QUAD_SIZE; j++) {
tx = get_texel_3d(samp, addr, v_i[j] + offset[0],
v_j[j] + offset[1],
v_k[j] + offset[2]);
}
if (need_swizzle) {
- float rgba_temp[NUM_CHANNELS][QUAD_SIZE];
+ float rgba_temp[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE];
memcpy(rgba_temp, rgba, sizeof(rgba_temp));
do_swizzling(samp, rgba_temp, rgba);
}
float w[4]);
typedef float (*compute_lambda_func)(const struct sp_sampler_variant *sampler,
- const float s[QUAD_SIZE],
- const float t[QUAD_SIZE],
- const float p[QUAD_SIZE]);
+ const float s[TGSI_QUAD_SIZE],
+ const float t[TGSI_QUAD_SIZE],
+ const float p[TGSI_QUAD_SIZE]);
typedef void (*filter_func)(struct tgsi_sampler *tgsi_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]);
union sp_sampler_key {
extern void
sp_get_samples(struct tgsi_sampler *tgsi_sampler,
- const float s[QUAD_SIZE],
- const float t[QUAD_SIZE],
- const float p[QUAD_SIZE],
+ const float s[TGSI_QUAD_SIZE],
+ const float t[TGSI_QUAD_SIZE],
+ const float p[TGSI_QUAD_SIZE],
float lodbias,
- float rgba[NUM_CHANNELS][QUAD_SIZE]);
+ float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE]);
#endif /* SP_TEX_SAMPLE_H */