summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-08-17 02:09:54 +0200
committerMarek Olšák <[email protected]>2017-09-11 02:10:23 +0200
commit7aaf4c73de1ad2526b5cd3ddbeecb687b66f6747 (patch)
treedde8b6e06845dd63acc01665902ef5f5e7e9172c /src/gallium/drivers
parente4c457f695c9be29eeacc2268d54bc405c8f1ad5 (diff)
gallium/u_blitter: add new union blitter_attrib to replace pipe_color_union
Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r300/r300_context.h2
-rw-r--r--src/gallium/drivers/r300/r300_render.c14
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.c20
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.h2
4 files changed, 19 insertions, 19 deletions
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index ce1fab48d5e..a99d50f76c0 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -746,7 +746,7 @@ void r300_blitter_draw_rectangle(struct blitter_context *blitter,
int x1, int y1, int x2, int y2,
float depth,
enum blitter_attrib_type type,
- const union pipe_color_union *attrib);
+ const union blitter_attrib *attrib);
/* r300_state.c */
enum r300_fb_state_change {
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 8eca1438603..e1fabe45035 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -1116,7 +1116,7 @@ void r300_blitter_draw_rectangle(struct blitter_context *blitter,
int x1, int y1, int x2, int y2,
float depth,
enum blitter_attrib_type type,
- const union pipe_color_union *attrib)
+ const union blitter_attrib *attrib)
{
struct r300_context *r300 = r300_context(util_blitter_get_pipe(blitter));
unsigned last_sprite_coord_enable = r300->sprite_coord_enable;
@@ -1126,7 +1126,7 @@ void r300_blitter_draw_rectangle(struct blitter_context *blitter,
type == UTIL_BLITTER_ATTRIB_COLOR || !r300->draw ? 8 : 4;
unsigned dwords = 13 + vertex_size +
(type == UTIL_BLITTER_ATTRIB_TEXCOORD ? 7 : 0);
- static const union pipe_color_union zeros;
+ static const union blitter_attrib zeros;
CS_LOCALS(r300);
/* XXX workaround for a lockup in MSAA resolve on SWTCL chipsets, this
@@ -1161,10 +1161,10 @@ void r300_blitter_draw_rectangle(struct blitter_context *blitter,
OUT_CS_REG(R300_GB_ENABLE, R300_GB_POINT_STUFF_ENABLE |
(R300_GB_TEX_STR << R300_GB_TEX0_SOURCE_SHIFT));
OUT_CS_REG_SEQ(R300_GA_POINT_S0, 4);
- OUT_CS_32F(attrib->f[0]);
- OUT_CS_32F(attrib->f[3]);
- OUT_CS_32F(attrib->f[2]);
- OUT_CS_32F(attrib->f[1]);
+ OUT_CS_32F(attrib->texcoord.x1);
+ OUT_CS_32F(attrib->texcoord.y2);
+ OUT_CS_32F(attrib->texcoord.x2);
+ OUT_CS_32F(attrib->texcoord.y1);
}
/* Set up VAP controls. */
@@ -1188,7 +1188,7 @@ void r300_blitter_draw_rectangle(struct blitter_context *blitter,
if (vertex_size == 8) {
if (!attrib)
attrib = &zeros;
- OUT_CS_TABLE(attrib->f, 4);
+ OUT_CS_TABLE(attrib->color, 4);
}
END_CS;
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 77c185088c7..1cfab31ea33 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -213,7 +213,7 @@ void r600_gfx_wait_fence(struct r600_common_context *ctx,
void r600_draw_rectangle(struct blitter_context *blitter,
int x1, int y1, int x2, int y2, float depth,
enum blitter_attrib_type type,
- const union pipe_color_union *attrib)
+ const union blitter_attrib *attrib)
{
struct r600_common_context *rctx =
(struct r600_common_context*)util_blitter_get_pipe(blitter);
@@ -261,17 +261,17 @@ void r600_draw_rectangle(struct blitter_context *blitter,
switch (type) {
case UTIL_BLITTER_ATTRIB_COLOR:
- memcpy(vb+4, attrib->f, sizeof(float)*4);
- memcpy(vb+12, attrib->f, sizeof(float)*4);
- memcpy(vb+20, attrib->f, sizeof(float)*4);
+ memcpy(vb+4, attrib->color, sizeof(float)*4);
+ memcpy(vb+12, attrib->color, sizeof(float)*4);
+ memcpy(vb+20, attrib->color, sizeof(float)*4);
break;
case UTIL_BLITTER_ATTRIB_TEXCOORD:
- vb[4] = attrib->f[0]; /* x1 */
- vb[5] = attrib->f[1]; /* y1 */
- vb[12] = attrib->f[0]; /* x1 */
- vb[13] = attrib->f[3]; /* y2 */
- vb[20] = attrib->f[2]; /* x2 */
- vb[21] = attrib->f[1]; /* y1 */
+ vb[4] = attrib->texcoord.x1;
+ vb[5] = attrib->texcoord.y1;
+ vb[12] = attrib->texcoord.x1;
+ vb[13] = attrib->texcoord.y2;
+ vb[20] = attrib->texcoord.x2;
+ vb[21] = attrib->texcoord.y1;
break;
default:; /* Nothing to do. */
}
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index 42480ec84b0..48536723b6c 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -767,7 +767,7 @@ void r600_gfx_wait_fence(struct r600_common_context *ctx,
void r600_draw_rectangle(struct blitter_context *blitter,
int x1, int y1, int x2, int y2, float depth,
enum blitter_attrib_type type,
- const union pipe_color_union *attrib);
+ const union blitter_attrib *attrib);
bool r600_common_screen_init(struct r600_common_screen *rscreen,
struct radeon_winsys *ws);
void r600_destroy_common_screen(struct r600_common_screen *rscreen);