aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-12-07 16:01:31 -0700
committerBrian <[email protected]>2007-12-07 16:01:31 -0700
commit2067eed9d30bb5b260920a5650655579c1988202 (patch)
tree03d112483fa510bc618e9307d587bd38585efc8c /src/mesa/pipe/softpipe
parent099bf3ffe932f4a8c1ddae064bce901555af35ce (diff)
Get rid of "duplicate" formats.
For example, replace PIPE_FORMAT_U_A8_R8_G8_B8 with PIPE_FORMAT_A8R8G8B8_UNORM
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_clear.c6
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_depth_test.c16
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_stencil.c8
-rw-r--r--src/mesa/pipe/softpipe/sp_surface.c70
-rw-r--r--src/mesa/pipe/softpipe/sp_tile_cache.c12
5 files changed, 56 insertions, 56 deletions
diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c
index 2b24ea63ab7..a6352e06161 100644
--- a/src/mesa/pipe/softpipe/sp_clear.c
+++ b/src/mesa/pipe/softpipe/sp_clear.c
@@ -62,19 +62,19 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
*/
uint r, g, b, a;
switch (ps->format) {
- case PIPE_FORMAT_U_R8_G8_B8_A8:
+ case PIPE_FORMAT_R8G8B8A8_UNORM:
r = (clearValue >> 24) & 0xff;
g = (clearValue >> 16) & 0xff;
g = (clearValue >> 8) & 0xff;
a = (clearValue ) & 0xff;
break;
- case PIPE_FORMAT_U_A8_R8_G8_B8:
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
r = (clearValue >> 16) & 0xff;
g = (clearValue >> 8) & 0xff;
b = (clearValue ) & 0xff;
a = (clearValue >> 24) & 0xff;
break;
- case PIPE_FORMAT_U_B8_G8_R8_A8:
+ case PIPE_FORMAT_B8G8R8A8_UNORM:
r = (clearValue >> 8) & 0xff;
g = (clearValue >> 16) & 0xff;
b = (clearValue >> 24) & 0xff;
diff --git a/src/mesa/pipe/softpipe/sp_quad_depth_test.c b/src/mesa/pipe/softpipe/sp_quad_depth_test.c
index 33181896218..00128fa5284 100644
--- a/src/mesa/pipe/softpipe/sp_quad_depth_test.c
+++ b/src/mesa/pipe/softpipe/sp_quad_depth_test.c
@@ -74,7 +74,7 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
* Also, get the zbuffer values (bzzzz) from the cached tile.
*/
switch (format) {
- case PIPE_FORMAT_U_Z16:
+ case PIPE_FORMAT_Z16_UNORM:
{
float scale = 65535.0;
@@ -89,7 +89,7 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
}
}
break;
- case PIPE_FORMAT_U_Z32:
+ case PIPE_FORMAT_Z32_UNORM:
{
double scale = (double) (uint) ~0UL;
@@ -104,7 +104,7 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
}
}
break;
- case PIPE_FORMAT_S8_Z24:
+ case PIPE_FORMAT_S8Z24_UNORM:
{
float scale = (float) ((1 << 24) - 1);
@@ -119,7 +119,7 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
}
}
break;
- case PIPE_FORMAT_Z24_S8:
+ case PIPE_FORMAT_Z24S8_UNORM:
{
float scale = (float) ((1 << 24) - 1);
@@ -202,21 +202,21 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
/* put updated Z values back into cached tile */
switch (format) {
- case PIPE_FORMAT_U_Z16:
+ case PIPE_FORMAT_Z16_UNORM:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
int y = quad->y0 % TILE_SIZE + (j >> 1);
tile->data.depth16[y][x] = (ushort) bzzzz[j];
}
break;
- case PIPE_FORMAT_U_Z32:
+ case PIPE_FORMAT_Z32_UNORM:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
int y = quad->y0 % TILE_SIZE + (j >> 1);
tile->data.depth32[y][x] = bzzzz[j];
}
break;
- case PIPE_FORMAT_S8_Z24:
+ case PIPE_FORMAT_S8Z24_UNORM:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
int y = quad->y0 % TILE_SIZE + (j >> 1);
@@ -225,7 +225,7 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
tile->data.depth32[y][x] = s8z24;
}
break;
- case PIPE_FORMAT_Z24_S8:
+ case PIPE_FORMAT_Z24S8_UNORM:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
int y = quad->y0 % TILE_SIZE + (j >> 1);
diff --git a/src/mesa/pipe/softpipe/sp_quad_stencil.c b/src/mesa/pipe/softpipe/sp_quad_stencil.c
index 0149b20f48f..b8c199204df 100644
--- a/src/mesa/pipe/softpipe/sp_quad_stencil.c
+++ b/src/mesa/pipe/softpipe/sp_quad_stencil.c
@@ -234,14 +234,14 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
/* get stencil values from cached tile */
switch (ps->format) {
- case PIPE_FORMAT_S8_Z24:
+ case PIPE_FORMAT_S8Z24_UNORM:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
int y = quad->y0 % TILE_SIZE + (j >> 1);
stencilVals[j] = tile->data.depth32[y][x] >> 24;
}
break;
- case PIPE_FORMAT_Z24_S8:
+ case PIPE_FORMAT_Z24S8_UNORM:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
int y = quad->y0 % TILE_SIZE + (j >> 1);
@@ -298,7 +298,7 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
/* put new stencil values into cached tile */
switch (ps->format) {
- case PIPE_FORMAT_S8_Z24:
+ case PIPE_FORMAT_S8Z24_UNORM:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
int y = quad->y0 % TILE_SIZE + (j >> 1);
@@ -307,7 +307,7 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
tile->data.depth32[y][x] = s8z24;
}
break;
- case PIPE_FORMAT_Z24_S8:
+ case PIPE_FORMAT_Z24S8_UNORM:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
int y = quad->y0 % TILE_SIZE + (j >> 1);
diff --git a/src/mesa/pipe/softpipe/sp_surface.c b/src/mesa/pipe/softpipe/sp_surface.c
index 16f0209eee4..cdbffe54000 100644
--- a/src/mesa/pipe/softpipe/sp_surface.c
+++ b/src/mesa/pipe/softpipe/sp_surface.c
@@ -70,7 +70,7 @@
#endif
-/*** PIPE_FORMAT_U_A8_R8_G8_B8 ***/
+/*** PIPE_FORMAT_A8R8G8B8_UNORM ***/
static void
a8r8g8b8_get_tile(struct pipe_surface *ps,
@@ -82,7 +82,7 @@ a8r8g8b8_get_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_U_A8_R8_G8_B8);
+ assert(ps->format == PIPE_FORMAT_A8R8G8B8_UNORM);
CLIP_TILE;
@@ -113,7 +113,7 @@ a8r8g8b8_put_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_U_A8_R8_G8_B8);
+ assert(ps->format == PIPE_FORMAT_A8R8G8B8_UNORM);
CLIP_TILE;
@@ -134,7 +134,7 @@ a8r8g8b8_put_tile(struct pipe_surface *ps,
}
-/*** PIPE_FORMAT_U_B8_G8_R8_A8 ***/
+/*** PIPE_FORMAT_B8G8R8A8_UNORM ***/
static void
b8g8r8a8_get_tile(struct pipe_surface *ps,
@@ -146,7 +146,7 @@ b8g8r8a8_get_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_U_B8_G8_R8_A8);
+ assert(ps->format == PIPE_FORMAT_B8G8R8A8_UNORM);
CLIP_TILE;
@@ -177,7 +177,7 @@ b8g8r8a8_put_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_U_B8_G8_R8_A8);
+ assert(ps->format == PIPE_FORMAT_B8G8R8A8_UNORM);
CLIP_TILE;
@@ -198,7 +198,7 @@ b8g8r8a8_put_tile(struct pipe_surface *ps,
}
-/*** PIPE_FORMAT_U_A1_R5_G5_B5 ***/
+/*** PIPE_FORMAT_A1R5G5B5_UNORM ***/
static void
a1r5g5b5_get_tile(struct pipe_surface *ps,
@@ -209,7 +209,7 @@ a1r5g5b5_get_tile(struct pipe_surface *ps,
+ y * ps->pitch + x;
unsigned i, j;
- assert(ps->format == PIPE_FORMAT_U_A1_R5_G5_B5);
+ assert(ps->format == PIPE_FORMAT_A1R5G5B5_UNORM);
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
@@ -226,7 +226,7 @@ a1r5g5b5_get_tile(struct pipe_surface *ps,
-/*** PIPE_FORMAT_U_Z16 ***/
+/*** PIPE_FORMAT_Z16_UNORM ***/
/**
* Return each Z value as four floats in [0,1].
@@ -242,7 +242,7 @@ z16_get_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_U_Z16);
+ assert(ps->format == PIPE_FORMAT_Z16_UNORM);
CLIP_TILE;
@@ -324,7 +324,7 @@ a8_get_tile(struct pipe_surface *ps,
}
-/*** PIPE_FORMAT_S_R16_G16_B16_A16 ***/
+/*** PIPE_FORMAT_R16G16B16A16_SNORM ***/
static void
r16g16b16a16_get_tile(struct pipe_surface *ps,
@@ -336,7 +336,7 @@ r16g16b16a16_get_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_S_R16_G16_B16_A16);
+ assert(ps->format == PIPE_FORMAT_R16G16B16A16_SNORM);
CLIP_TILE;
@@ -368,7 +368,7 @@ r16g16b16a16_put_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_S_R16_G16_B16_A16);
+ assert(ps->format == PIPE_FORMAT_R16G16B16A16_SNORM);
CLIP_TILE;
@@ -458,7 +458,7 @@ a8_l8_get_tile(struct pipe_surface *ps,
-/*** PIPE_FORMAT_U_Z32 ***/
+/*** PIPE_FORMAT_Z32_UNORM ***/
/**
* Return each Z value as four floats in [0,1].
@@ -474,7 +474,7 @@ z32_get_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_U_Z16);
+ assert(ps->format == PIPE_FORMAT_Z16_UNORM);
CLIP_TILE;
@@ -492,7 +492,7 @@ z32_get_tile(struct pipe_surface *ps,
}
-/*** PIPE_FORMAT_S8_Z24 ***/
+/*** PIPE_FORMAT_S8Z24_UNORM ***/
/**
* Return Z component as four float in [0,1]. Stencil part ignored.
@@ -508,7 +508,7 @@ s8z24_get_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_S8_Z24);
+ assert(ps->format == PIPE_FORMAT_S8Z24_UNORM);
CLIP_TILE;
@@ -526,7 +526,7 @@ s8z24_get_tile(struct pipe_surface *ps,
}
-/*** PIPE_FORMAT_Z24_S8 ***/
+/*** PIPE_FORMAT_Z24S8_UNORM ***/
/**
* Return Z component as four float in [0,1]. Stencil part ignored.
@@ -542,7 +542,7 @@ z24s8_get_tile(struct pipe_surface *ps,
unsigned i, j;
unsigned w0 = w;
- assert(ps->format == PIPE_FORMAT_Z24_S8);
+ assert(ps->format == PIPE_FORMAT_Z24S8_UNORM);
CLIP_TILE;
@@ -673,13 +673,13 @@ softpipe_get_tile_rgba(struct pipe_context *pipe,
float *p)
{
switch (ps->format) {
- case PIPE_FORMAT_U_A8_R8_G8_B8:
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
a8r8g8b8_get_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_U_B8_G8_R8_A8:
+ case PIPE_FORMAT_B8G8R8A8_UNORM:
b8g8r8a8_get_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_U_A1_R5_G5_B5:
+ case PIPE_FORMAT_A1R5G5B5_UNORM:
a1r5g5b5_get_tile(ps, x, y, w, h, p);
break;
case PIPE_FORMAT_U_L8:
@@ -694,19 +694,19 @@ softpipe_get_tile_rgba(struct pipe_context *pipe,
case PIPE_FORMAT_U_A8_L8:
a8_l8_get_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_S_R16_G16_B16_A16:
+ case PIPE_FORMAT_R16G16B16A16_SNORM:
r16g16b16a16_get_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_U_Z16:
+ case PIPE_FORMAT_Z16_UNORM:
z16_get_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_U_Z32:
+ case PIPE_FORMAT_Z32_UNORM:
z32_get_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_S8_Z24:
+ case PIPE_FORMAT_S8Z24_UNORM:
s8z24_get_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_Z24_S8:
+ case PIPE_FORMAT_Z24S8_UNORM:
z24s8_get_tile(ps, x, y, w, h, p);
break;
default:
@@ -723,13 +723,13 @@ softpipe_put_tile_rgba(struct pipe_context *pipe,
const float *p)
{
switch (ps->format) {
- case PIPE_FORMAT_U_A8_R8_G8_B8:
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
a8r8g8b8_put_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_U_B8_G8_R8_A8:
+ case PIPE_FORMAT_B8G8R8A8_UNORM:
b8g8r8a8_put_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_U_A1_R5_G5_B5:
+ case PIPE_FORMAT_A1R5G5B5_UNORM:
/*a1r5g5b5_put_tile(ps, x, y, w, h, p);*/
break;
case PIPE_FORMAT_U_L8:
@@ -744,19 +744,19 @@ softpipe_put_tile_rgba(struct pipe_context *pipe,
case PIPE_FORMAT_U_A8_L8:
/*a8_l8_put_tile(ps, x, y, w, h, p);*/
break;
- case PIPE_FORMAT_S_R16_G16_B16_A16:
+ case PIPE_FORMAT_R16G16B16A16_SNORM:
r16g16b16a16_put_tile(ps, x, y, w, h, p);
break;
- case PIPE_FORMAT_U_Z16:
+ case PIPE_FORMAT_Z16_UNORM:
/*z16_put_tile(ps, x, y, w, h, p);*/
break;
- case PIPE_FORMAT_U_Z32:
+ case PIPE_FORMAT_Z32_UNORM:
/*z32_put_tile(ps, x, y, w, h, p);*/
break;
- case PIPE_FORMAT_S8_Z24:
+ case PIPE_FORMAT_S8Z24_UNORM:
/*s8z24_put_tile(ps, x, y, w, h, p);*/
break;
- case PIPE_FORMAT_Z24_S8:
+ case PIPE_FORMAT_Z24S8_UNORM:
/*z24s8_put_tile(ps, x, y, w, h, p);*/
break;
default:
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.c b/src/mesa/pipe/softpipe/sp_tile_cache.c
index 93930b18f28..be5dd5c2890 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.c
+++ b/src/mesa/pipe/softpipe/sp_tile_cache.c
@@ -163,9 +163,9 @@ static INLINE boolean
is_depth_stencil_surface(struct pipe_surface *ps)
{
return (ps &&
- (ps->format == PIPE_FORMAT_S8_Z24 ||
- ps->format == PIPE_FORMAT_U_Z16 ||
- ps->format == PIPE_FORMAT_U_Z32 ||
+ (ps->format == PIPE_FORMAT_S8Z24_UNORM ||
+ ps->format == PIPE_FORMAT_Z16_UNORM ||
+ ps->format == PIPE_FORMAT_Z32_UNORM ||
ps->format == PIPE_FORMAT_U_S8));
}
@@ -180,7 +180,7 @@ clear_tile(struct softpipe_cached_tile *tile, uint format,
uint i, j;
switch (format) {
- case PIPE_FORMAT_U_Z16:
+ case PIPE_FORMAT_Z16_UNORM:
{
ushort clear_val = (ushort) (clear_value[0] * 0xffff);
for (i = 0; i < TILE_SIZE; i++) {
@@ -190,7 +190,7 @@ clear_tile(struct softpipe_cached_tile *tile, uint format,
}
}
break;
- case PIPE_FORMAT_U_Z32:
+ case PIPE_FORMAT_Z32_UNORM:
{
uint clear_val = (uint) (clear_value[0] * 0xffffffff);
for (i = 0; i < TILE_SIZE; i++) {
@@ -200,7 +200,7 @@ clear_tile(struct softpipe_cached_tile *tile, uint format,
}
}
break;
- case PIPE_FORMAT_S8_Z24:
+ case PIPE_FORMAT_S8Z24_UNORM:
{
uint clear_val = (uint) (clear_value[0] * 0xffffff);
clear_val |= ((uint) clear_value[1]) << 24;