summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-04-16 14:05:47 +0200
committerMarek Olšák <[email protected]>2016-04-22 01:30:39 +0200
commitfb523cb6ad3ffef22ab4b9cce9e53859c17c5739 (patch)
tree45b67da368c4c387329e5887ab6d49d61f0b85a9 /src/gallium/drivers/nouveau
parented23335a313dfc9cec26999c0adffe3ab3a73a58 (diff)
gallium: merge PIPE_SWIZZLE_* and UTIL_FORMAT_SWIZZLE_*
Use PIPE_SWIZZLE_* everywhere. Use X/Y/Z/W/0/1 instead of RED, GREEN, BLUE, ALPHA, ZERO, ONE. The new enum is called pipe_swizzle. Acked-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/nouveau_video.c6
-rw-r--r--src/gallium/drivers/nouveau/nouveau_vp3_video.c4
-rw-r--r--src/gallium/drivers/nouveau/nv30/nv30_texture.c2
-rw-r--r--src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c8
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_surface.c8
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_tex.c12
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv84_video.c4
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_surface.c8
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_tex.c12
9 files changed, 32 insertions, 32 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_video.c b/src/gallium/drivers/nouveau/nouveau_video.c
index 8bb12b22ac1..bb3aad784c5 100644
--- a/src/gallium/drivers/nouveau/nouveau_video.c
+++ b/src/gallium/drivers/nouveau/nouveau_video.c
@@ -657,7 +657,7 @@ nouveau_video_buffer_sampler_view_planes(struct pipe_video_buffer *buffer)
u_sampler_view_default_template(&sv_templ, buf->resources[i], buf->resources[i]->format);
if (util_format_get_nr_components(buf->resources[i]->format) == 1)
- sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = sv_templ.swizzle_a = PIPE_SWIZZLE_RED;
+ sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = sv_templ.swizzle_a = PIPE_SWIZZLE_X;
buf->sampler_view_planes[i] = pipe->create_sampler_view(pipe, buf->resources[i], &sv_templ);
if (!buf->sampler_view_planes[i])
@@ -695,8 +695,8 @@ nouveau_video_buffer_sampler_view_components(struct pipe_video_buffer *buffer)
if (!buf->sampler_view_components[component]) {
memset(&sv_templ, 0, sizeof(sv_templ));
u_sampler_view_default_template(&sv_templ, buf->resources[i], buf->resources[i]->format);
- sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = PIPE_SWIZZLE_RED + j;
- sv_templ.swizzle_a = PIPE_SWIZZLE_ONE;
+ sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = PIPE_SWIZZLE_X + j;
+ sv_templ.swizzle_a = PIPE_SWIZZLE_1;
buf->sampler_view_components[component] = pipe->create_sampler_view(pipe, buf->resources[i], &sv_templ);
if (!buf->sampler_view_components[component])
goto error;
diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.c b/src/gallium/drivers/nouveau/nouveau_vp3_video.c
index d76d93241f4..172d80c44c2 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video.c
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.c
@@ -139,8 +139,8 @@ nouveau_vp3_video_buffer_create(struct pipe_context *pipe,
goto error;
for (j = 0; j < nr_components; ++j, ++component) {
- sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = PIPE_SWIZZLE_RED + j;
- sv_templ.swizzle_a = PIPE_SWIZZLE_ONE;
+ sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = PIPE_SWIZZLE_X + j;
+ sv_templ.swizzle_a = PIPE_SWIZZLE_1;
buffer->sampler_view_components[component] = pipe->create_sampler_view(pipe, res, &sv_templ);
if (!buffer->sampler_view_components[component])
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_texture.c b/src/gallium/drivers/nouveau/nv30/nv30_texture.c
index bfe21cceaa2..4f4f87e2ce9 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_texture.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_texture.c
@@ -205,7 +205,7 @@ static inline uint32_t
swizzle(const struct nv30_texfmt *fmt, unsigned cmp, unsigned swz)
{
uint32_t data = fmt->swz[swz].src << 8;
- if (swz <= PIPE_SWIZZLE_ALPHA)
+ if (swz <= PIPE_SWIZZLE_W)
data |= fmt->swz[swz].cmp;
else
data |= fmt->swz[cmp].cmp;
diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
index b9cfb313fb5..89ac208c155 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
@@ -474,10 +474,10 @@ nvfx_fragprog_parse_instruction(struct nvfx_fpc *fpc,
switch (fsrc->Register.File) {
case TGSI_FILE_INPUT:
if(fpc->fp->info.input_semantic_name[fsrc->Register.Index] == TGSI_SEMANTIC_FOG && (0
- || fsrc->Register.SwizzleX == PIPE_SWIZZLE_ALPHA
- || fsrc->Register.SwizzleY == PIPE_SWIZZLE_ALPHA
- || fsrc->Register.SwizzleZ == PIPE_SWIZZLE_ALPHA
- || fsrc->Register.SwizzleW == PIPE_SWIZZLE_ALPHA
+ || fsrc->Register.SwizzleX == PIPE_SWIZZLE_W
+ || fsrc->Register.SwizzleY == PIPE_SWIZZLE_W
+ || fsrc->Register.SwizzleZ == PIPE_SWIZZLE_W
+ || fsrc->Register.SwizzleW == PIPE_SWIZZLE_W
)) {
/* hardware puts 0 in fogcoord.w, but GL/Gallium want 1 there */
struct nvfx_src addend = nvfx_src(nvfx_fp_imm(fpc, 0, 0, 0, 1));
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
index 68b0e18ef8f..a284f27c366 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
@@ -1122,10 +1122,10 @@ nv50_blit_set_src(struct nv50_blitctx *blit,
templ.format = format;
templ.u.tex.first_level = templ.u.tex.last_level = level;
templ.u.tex.first_layer = templ.u.tex.last_layer = layer;
- templ.swizzle_r = PIPE_SWIZZLE_RED;
- templ.swizzle_g = PIPE_SWIZZLE_GREEN;
- templ.swizzle_b = PIPE_SWIZZLE_BLUE;
- templ.swizzle_a = PIPE_SWIZZLE_ALPHA;
+ templ.swizzle_r = PIPE_SWIZZLE_X;
+ templ.swizzle_g = PIPE_SWIZZLE_Y;
+ templ.swizzle_b = PIPE_SWIZZLE_Z;
+ templ.swizzle_a = PIPE_SWIZZLE_W;
if (layer == -1) {
templ.u.tex.first_layer = 0;
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_tex.c b/src/gallium/drivers/nouveau/nv50/nv50_tex.c
index 414d326eeed..36c07bc4fc3 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_tex.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_tex.c
@@ -31,13 +31,13 @@ static inline uint32_t
nv50_tic_swizzle(const struct nv50_format *fmt, unsigned swz, bool tex_int)
{
switch (swz) {
- case PIPE_SWIZZLE_RED : return fmt->tic.src_x;
- case PIPE_SWIZZLE_GREEN: return fmt->tic.src_y;
- case PIPE_SWIZZLE_BLUE : return fmt->tic.src_z;
- case PIPE_SWIZZLE_ALPHA: return fmt->tic.src_w;
- case PIPE_SWIZZLE_ONE:
+ case PIPE_SWIZZLE_X : return fmt->tic.src_x;
+ case PIPE_SWIZZLE_Y: return fmt->tic.src_y;
+ case PIPE_SWIZZLE_Z : return fmt->tic.src_z;
+ case PIPE_SWIZZLE_W: return fmt->tic.src_w;
+ case PIPE_SWIZZLE_1:
return tex_int ? G80_TIC_SOURCE_ONE_INT : G80_TIC_SOURCE_ONE_FLOAT;
- case PIPE_SWIZZLE_ZERO:
+ case PIPE_SWIZZLE_0:
default:
return G80_TIC_SOURCE_ZERO;
}
diff --git a/src/gallium/drivers/nouveau/nv50/nv84_video.c b/src/gallium/drivers/nouveau/nv50/nv84_video.c
index 88655dbfae5..1b1f31ac485 100644
--- a/src/gallium/drivers/nouveau/nv50/nv84_video.c
+++ b/src/gallium/drivers/nouveau/nv50/nv84_video.c
@@ -705,8 +705,8 @@ nv84_video_buffer_create(struct pipe_context *pipe,
for (j = 0; j < nr_components; ++j, ++component) {
sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b =
- PIPE_SWIZZLE_RED + j;
- sv_templ.swizzle_a = PIPE_SWIZZLE_ONE;
+ PIPE_SWIZZLE_X + j;
+ sv_templ.swizzle_a = PIPE_SWIZZLE_1;
buffer->sampler_view_components[component] =
pipe->create_sampler_view(pipe, res, &sv_templ);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
index e108590e215..a1775698a3d 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
@@ -959,10 +959,10 @@ nvc0_blit_set_src(struct nvc0_blitctx *ctx,
templ.format = format;
templ.u.tex.first_layer = templ.u.tex.last_layer = layer;
templ.u.tex.first_level = templ.u.tex.last_level = level;
- templ.swizzle_r = PIPE_SWIZZLE_RED;
- templ.swizzle_g = PIPE_SWIZZLE_GREEN;
- templ.swizzle_b = PIPE_SWIZZLE_BLUE;
- templ.swizzle_a = PIPE_SWIZZLE_ALPHA;
+ templ.swizzle_r = PIPE_SWIZZLE_X;
+ templ.swizzle_g = PIPE_SWIZZLE_Y;
+ templ.swizzle_b = PIPE_SWIZZLE_Z;
+ templ.swizzle_a = PIPE_SWIZZLE_W;
if (layer == -1) {
templ.u.tex.first_layer = 0;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
index e04573f8249..21618468bef 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
@@ -36,13 +36,13 @@ static inline uint32_t
nv50_tic_swizzle(const struct nvc0_format *fmt, unsigned swz, bool tex_int)
{
switch (swz) {
- case PIPE_SWIZZLE_RED : return fmt->tic.src_x;
- case PIPE_SWIZZLE_GREEN: return fmt->tic.src_y;
- case PIPE_SWIZZLE_BLUE : return fmt->tic.src_z;
- case PIPE_SWIZZLE_ALPHA: return fmt->tic.src_w;
- case PIPE_SWIZZLE_ONE:
+ case PIPE_SWIZZLE_X : return fmt->tic.src_x;
+ case PIPE_SWIZZLE_Y: return fmt->tic.src_y;
+ case PIPE_SWIZZLE_Z : return fmt->tic.src_z;
+ case PIPE_SWIZZLE_W: return fmt->tic.src_w;
+ case PIPE_SWIZZLE_1:
return tex_int ? G80_TIC_SOURCE_ONE_INT : G80_TIC_SOURCE_ONE_FLOAT;
- case PIPE_SWIZZLE_ZERO:
+ case PIPE_SWIZZLE_0:
default:
return G80_TIC_SOURCE_ZERO;
}