summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_interp.c12
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_interp.h10
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c16
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_setup.c4
-rw-r--r--src/gallium/drivers/llvmpipe/lp_tile_soa.h6
-rw-r--r--src/gallium/drivers/softpipe/sp_quad.h8
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_blend.c38
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_depth_test.c104
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_fs.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.c16
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c362
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.h24
12 files changed, 301 insertions, 301 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.c b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
index 45ddf547bf0..0608ab0a2a7 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_interp.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
@@ -143,10 +143,10 @@ coeffs_init(struct lp_build_interp_soa_context *bld,
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;
@@ -292,7 +292,7 @@ attribs_update(struct lp_build_interp_soa_context *bld,
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 ||
@@ -418,7 +418,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld,
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);
@@ -427,7 +427,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld,
/* 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;
@@ -443,7 +443,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld,
/* 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;
}
}
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.h b/src/gallium/drivers/llvmpipe/lp_bld_interp.h
index b58b2dc1155..5f72b0b8953 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_interp.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.h
@@ -75,7 +75,7 @@ struct lp_shader_input {
struct lp_build_interp_soa_context
{
- /* QUAD_SIZE x float */
+ /* TGSI_QUAD_SIZE x float */
struct lp_build_context coeff_bld;
unsigned num_attribs;
@@ -85,18 +85,18 @@ struct lp_build_interp_soa_context
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];
};
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index c7bab82b088..482f4e38632 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -233,7 +233,7 @@ generate_fs(struct gallivm_state *gallivm,
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];
@@ -289,7 +289,7 @@ generate_fs(struct gallivm_state *gallivm,
/* 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");
}
}
@@ -406,7 +406,7 @@ generate_fs(struct gallivm_state *gallivm,
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.
@@ -536,7 +536,7 @@ generate_fragment(struct llvmpipe_context *lp,
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;
@@ -684,7 +684,7 @@ generate_fragment(struct llvmpipe_context *lp,
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, "");
@@ -706,7 +706,7 @@ generate_fragment(struct llvmpipe_context *lp,
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];
}
@@ -718,13 +718,13 @@ generate_fragment(struct llvmpipe_context *lp,
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++) {
diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c
index 3243abff6e0..ab38357872d 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c
@@ -911,7 +911,7 @@ lp_dump_setup_coef( const struct lp_setup_variant_key *key,
{
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];
@@ -923,7 +923,7 @@ lp_dump_setup_coef( const struct lp_setup_variant_key *key,
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];
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.h b/src/gallium/drivers/llvmpipe/lp_tile_soa.h
index 12dac1da6ca..6a5fc8dbfc9 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_soa.h
+++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.h
@@ -29,7 +29,7 @@
#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
@@ -47,8 +47,8 @@ extern const unsigned char
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
diff --git a/src/gallium/drivers/softpipe/sp_quad.h b/src/gallium/drivers/softpipe/sp_quad.h
index e745aa80619..9d456b5eb4d 100644
--- a/src/gallium/drivers/softpipe/sp_quad.h
+++ b/src/gallium/drivers/softpipe/sp_quad.h
@@ -62,7 +62,7 @@
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 */
};
@@ -83,9 +83,9 @@ struct quad_header_inout
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];
};
diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c
index d546b149573..3fa672ffa88 100644
--- a/src/gallium/drivers/softpipe/sp_quad_blend.c
+++ b/src/gallium/drivers/softpipe/sp_quad_blend.c
@@ -267,8 +267,8 @@ blend_quad(struct quad_stage *qs,
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
@@ -576,7 +576,7 @@ blend_quad(struct quad_stage *qs,
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 */
@@ -671,7 +671,7 @@ blend_quad(struct quad_stage *qs,
/* 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 */
}
@@ -786,7 +786,7 @@ clamp_colors(float (*quadColor)[4])
{
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);
}
@@ -859,7 +859,7 @@ blend_fallback(struct quad_stage *qs,
{
/* 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,
@@ -876,12 +876,12 @@ blend_fallback(struct quad_stage *qs,
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];
}
@@ -900,7 +900,7 @@ blend_fallback(struct quad_stage *qs,
/* 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++) {
@@ -932,7 +932,7 @@ blend_fallback(struct quad_stage *qs,
/* 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);
@@ -953,9 +953,9 @@ blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs,
{
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
@@ -971,7 +971,7 @@ blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs,
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++) {
@@ -1011,7 +1011,7 @@ blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs,
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);
@@ -1029,7 +1029,7 @@ blend_single_add_one_one(struct quad_stage *qs,
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
@@ -1044,7 +1044,7 @@ blend_single_add_one_one(struct quad_stage *qs,
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++) {
@@ -1073,7 +1073,7 @@ blend_single_add_one_one(struct quad_stage *qs,
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);
@@ -1116,7 +1116,7 @@ single_output_color(struct quad_stage *qs,
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);
diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index 529a5ad5a4e..0f5c77052af 100644
--- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
@@ -45,11 +45,11 @@
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;
};
@@ -64,14 +64,14 @@ get_depth_stencil_values( struct depth_data *data,
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];
@@ -79,7 +79,7 @@ get_depth_stencil_values( struct depth_data *data,
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;
@@ -88,7 +88,7 @@ get_depth_stencil_values( struct depth_data *data,
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;
@@ -96,7 +96,7 @@ get_depth_stencil_values( struct depth_data *data,
}
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;
@@ -104,14 +104,14 @@ get_depth_stencil_values( struct depth_data *data,
}
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;
@@ -164,7 +164,7 @@ convert_quad_depth( struct depth_data *data,
{
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);
}
}
@@ -173,7 +173,7 @@ convert_quad_depth( struct depth_data *data,
{
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);
}
}
@@ -183,7 +183,7 @@ convert_quad_depth( struct depth_data *data,
{
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);
}
}
@@ -193,7 +193,7 @@ convert_quad_depth( struct depth_data *data,
{
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);
}
}
@@ -203,7 +203,7 @@ convert_quad_depth( struct depth_data *data,
{
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;
}
@@ -236,7 +236,7 @@ convert_quad_stencil( struct depth_data *data,
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;
@@ -259,7 +259,7 @@ write_depth_stencil_values( struct depth_data *data,
/* 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];
@@ -267,49 +267,49 @@ write_depth_stencil_values( struct depth_data *data,
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);
@@ -344,9 +344,9 @@ do_stencil_test(struct depth_data *data,
{
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
@@ -358,42 +358,42 @@ do_stencil_test(struct depth_data *data,
/* 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);
}
@@ -425,10 +425,10 @@ apply_stencil_op(struct depth_data *data,
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];
@@ -441,21 +441,21 @@ apply_stencil_op(struct depth_data *data,
/* 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;
@@ -464,7 +464,7 @@ apply_stencil_op(struct depth_data *data,
}
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;
@@ -473,21 +473,21 @@ apply_stencil_op(struct depth_data *data,
}
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];
}
@@ -502,12 +502,12 @@ apply_stencil_op(struct depth_data *data,
*/
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];
}
}
@@ -537,37 +537,37 @@ depth_test_quad(struct quad_stage *qs,
/* 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);
}
@@ -588,7 +588,7 @@ depth_test_quad(struct quad_stage *qs,
* 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];
}
diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c
index 7800ba8442f..8ec1aa2fc63 100644
--- a/src/gallium/drivers/softpipe/sp_quad_fs.c
+++ b/src/gallium/drivers/softpipe/sp_quad_fs.c
@@ -90,7 +90,7 @@ coverage_quad(struct quad_stage *qs, struct quad_header *quad)
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];
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c
index 0d67af3eb74..6b15c876881 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -625,11 +625,11 @@ setup_tri_coefficients(struct setup_context *setup)
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],
@@ -639,7 +639,7 @@ setup_tri_coefficients(struct setup_context *setup)
}
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],
@@ -981,11 +981,11 @@ setup_line_coefficients(struct setup_context *setup,
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),
@@ -994,7 +994,7 @@ setup_line_coefficients(struct setup_context *setup,
}
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),
@@ -1241,11 +1241,11 @@ sp_setup_point(struct setup_context *setup,
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;
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index bd0546e0215..d54e02e40cd 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -559,9 +559,9 @@ wrap_array_layer(const float coord[4], unsigned size, int layer[4])
*/
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]);
@@ -574,9 +574,9 @@ compute_lambda_1d(const struct sp_sampler_variant *samp,
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]);
@@ -593,9 +593,9 @@ compute_lambda_2d(const struct sp_sampler_variant *samp,
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]);
@@ -622,9 +622,9 @@ compute_lambda_3d(const struct sp_sampler_variant *samp,
*/
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;
}
@@ -826,7 +826,7 @@ pot_level_size(unsigned base_pot, unsigned level)
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,
@@ -841,12 +841,12 @@ print_sample(const char *function, float rgba[NUM_CHANNELS][QUAD_SIZE])
*/
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;
@@ -860,7 +860,7 @@ img_filter_2d_linear_repeat_POT(struct tgsi_sampler *tgsi_sampler,
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;
@@ -904,12 +904,12 @@ img_filter_2d_linear_repeat_POT(struct tgsi_sampler *tgsi_sampler,
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;
@@ -921,7 +921,7 @@ img_filter_2d_nearest_repeat_POT(struct tgsi_sampler *tgsi_sampler,
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;
@@ -948,12 +948,12 @@ img_filter_2d_nearest_repeat_POT(struct tgsi_sampler *tgsi_sampler,
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;
@@ -965,7 +965,7 @@ img_filter_2d_nearest_clamp_POT(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1001,12 +1001,12 @@ img_filter_2d_nearest_clamp_POT(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1025,7 +1025,7 @@ img_filter_1d_nearest(struct tgsi_sampler *tgsi_sampler,
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++) {
@@ -1041,12 +1041,12 @@ img_filter_1d_nearest(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1066,7 +1066,7 @@ img_filter_1d_array_nearest(struct tgsi_sampler *tgsi_sampler,
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++) {
@@ -1082,12 +1082,12 @@ img_filter_1d_array_nearest(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1110,7 +1110,7 @@ img_filter_2d_nearest(struct tgsi_sampler *tgsi_sampler,
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++) {
@@ -1126,12 +1126,12 @@ img_filter_2d_nearest(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1154,7 +1154,7 @@ img_filter_2d_array_nearest(struct tgsi_sampler *tgsi_sampler,
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++) {
@@ -1178,12 +1178,12 @@ face(union tex_tile_address addr, unsigned face )
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;
@@ -1206,7 +1206,7 @@ img_filter_cube_nearest(struct tgsi_sampler *tgsi_sampler,
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++) {
@@ -1222,12 +1222,12 @@ img_filter_cube_nearest(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1252,7 +1252,7 @@ img_filter_3d_nearest(struct tgsi_sampler *tgsi_sampler,
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++) {
@@ -1264,12 +1264,12 @@ img_filter_3d_nearest(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1289,7 +1289,7 @@ img_filter_1d_linear(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1304,12 +1304,12 @@ img_filter_1d_linear(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1330,7 +1330,7 @@ img_filter_1d_array_linear(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1345,12 +1345,12 @@ img_filter_1d_array_linear(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1373,7 +1373,7 @@ img_filter_2d_linear(struct tgsi_sampler *tgsi_sampler,
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]);
@@ -1392,12 +1392,12 @@ img_filter_2d_linear(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1421,7 +1421,7 @@ img_filter_2d_array_linear(struct tgsi_sampler *tgsi_sampler,
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]);
@@ -1440,12 +1440,12 @@ img_filter_2d_array_linear(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1469,7 +1469,7 @@ img_filter_cube_linear(struct tgsi_sampler *tgsi_sampler,
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]);
@@ -1489,12 +1489,12 @@ img_filter_cube_linear(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1520,7 +1520,7 @@ img_filter_3d_linear(struct tgsi_sampler *tgsi_sampler,
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]);
@@ -1551,12 +1551,12 @@ img_filter_3d_linear(struct tgsi_sampler *tgsi_sampler,
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);
}
@@ -1565,18 +1565,18 @@ compute_lod(const struct pipe_sampler_state *sampler,
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;
@@ -1612,7 +1612,7 @@ mip_filter_linear(struct tgsi_sampler *tgsi_sampler,
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]);
}
@@ -1632,17 +1632,17 @@ mip_filter_linear(struct tgsi_sampler *tgsi_sampler,
*/
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;
@@ -1675,16 +1675,16 @@ mip_filter_nearest(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1743,14 +1743,14 @@ create_filter_table(void)
*/
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;
@@ -1781,10 +1781,10 @@ img_filter_2d_ewa(struct tgsi_sampler *tgsi_sampler,
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;
@@ -1810,7 +1810,7 @@ img_filter_2d_ewa(struct tgsi_sampler *tgsi_sampler,
*/
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
@@ -1847,7 +1847,7 @@ img_filter_2d_ewa(struct tgsi_sampler *tgsi_sampler,
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
@@ -1928,18 +1928,18 @@ img_filter_2d_ewa(struct tgsi_sampler *tgsi_sampler,
*/
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);
@@ -2028,18 +2028,18 @@ mip_filter_linear_aniso(struct tgsi_sampler *tgsi_sampler,
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;
@@ -2077,7 +2077,7 @@ mip_filter_linear_2d_linear_repeat_POT(
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]);
}
@@ -2096,12 +2096,12 @@ mip_filter_linear_2d_linear_repeat_POT(
*/
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;
@@ -2206,12 +2206,12 @@ sample_compare(struct tgsi_sampler *tgsi_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;
@@ -2251,7 +2251,7 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
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;
@@ -2261,7 +2261,7 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
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;
@@ -2271,7 +2271,7 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
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;
@@ -2288,8 +2288,8 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
}
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;
@@ -2360,15 +2360,15 @@ static void do_swizzling(const struct sp_sampler_variant *samp,
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);
@@ -2634,12 +2634,12 @@ sample_get_dims(struct tgsi_sampler *tgsi_sampler, int level,
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;
@@ -2657,7 +2657,7 @@ sample_get_texels(struct tgsi_sampler *tgsi_sampler,
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];
@@ -2665,7 +2665,7 @@ sample_get_texels(struct tgsi_sampler *tgsi_sampler,
}
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++) {
@@ -2675,7 +2675,7 @@ sample_get_texels(struct tgsi_sampler *tgsi_sampler,
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++) {
@@ -2684,7 +2684,7 @@ sample_get_texels(struct tgsi_sampler *tgsi_sampler,
}
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]);
@@ -2694,7 +2694,7 @@ sample_get_texels(struct tgsi_sampler *tgsi_sampler,
}
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]);
@@ -2710,7 +2710,7 @@ sample_get_texels(struct tgsi_sampler *tgsi_sampler,
}
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);
}
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.h b/src/gallium/drivers/softpipe/sp_tex_sample.h
index f0b867edc6e..7fdabd4fd99 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.h
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.h
@@ -45,17 +45,17 @@ typedef void (*wrap_linear_func)(const float s[4],
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 {
@@ -148,11 +148,11 @@ sp_sampler_variant(const struct tgsi_sampler *sampler)
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 */