From 2067eed9d30bb5b260920a5650655579c1988202 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 7 Dec 2007 16:01:31 -0700 Subject: [PATCH] Get rid of "duplicate" formats. For example, replace PIPE_FORMAT_U_A8_R8_G8_B8 with PIPE_FORMAT_A8R8G8B8_UNORM --- .../dri/intel_winsys/intel_winsys_softpipe.c | 6 +- src/mesa/pipe/draw/draw_vertex_fetch.c | 2 +- src/mesa/pipe/i915simple/i915_context.c | 24 ++++---- src/mesa/pipe/i915simple/i915_state_emit.c | 10 ++-- src/mesa/pipe/i915simple/i915_state_sampler.c | 12 ++-- src/mesa/pipe/i915simple/i915_surface.c | 4 +- src/mesa/pipe/p_format.h | 12 ---- src/mesa/pipe/softpipe/sp_clear.c | 6 +- src/mesa/pipe/softpipe/sp_quad_depth_test.c | 16 ++--- src/mesa/pipe/softpipe/sp_quad_stencil.c | 8 +-- src/mesa/pipe/softpipe/sp_surface.c | 70 +++++++++++----------- src/mesa/pipe/softpipe/sp_tile_cache.c | 12 ++-- src/mesa/pipe/xlib/xm_api.c | 8 +-- src/mesa/pipe/xlib/xm_winsys.c | 8 +-- 14 files changed, 93 insertions(+), 105 deletions(-) diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c b/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c index 7a93546..f9ed625 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c @@ -48,9 +48,9 @@ static boolean intel_is_format_supported(struct softpipe_winsys *sws, uint format) { switch(format) { - case PIPE_FORMAT_U_A8_R8_G8_B8: - case PIPE_FORMAT_U_R5_G6_B5: - case PIPE_FORMAT_S8_Z24: + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: return TRUE; default: return FALSE; diff --git a/src/mesa/pipe/draw/draw_vertex_fetch.c b/src/mesa/pipe/draw/draw_vertex_fetch.c index 5510b36..77df5c6 100644 --- a/src/mesa/pipe/draw/draw_vertex_fetch.c +++ b/src/mesa/pipe/draw/draw_vertex_fetch.c @@ -79,7 +79,7 @@ fetch_attrib4(const void *ptr, unsigned format, float attrib[4]) attrib[0] = (float) ((int *) ptr)[0]; break; - case PIPE_FORMAT_U_A8_R8_G8_B8: + case PIPE_FORMAT_A8R8G8B8_UNORM: attrib[0] = (float) ((unsigned char *) ptr)[2] / 255.0f; attrib[1] = (float) ((unsigned char *) ptr)[1] / 255.0f; attrib[2] = (float) ((unsigned char *) ptr)[0] / 255.0f; diff --git a/src/mesa/pipe/i915simple/i915_context.c b/src/mesa/pipe/i915simple/i915_context.c index 07b331c..cfce116 100644 --- a/src/mesa/pipe/i915simple/i915_context.c +++ b/src/mesa/pipe/i915simple/i915_context.c @@ -50,32 +50,32 @@ i915_is_format_supported( struct pipe_context *pipe, #if 0 /* XXX: This is broken -- rewrite if still needed. */ static const unsigned tex_supported[] = { - PIPE_FORMAT_U_R8_G8_B8_A8, - PIPE_FORMAT_U_A8_R8_G8_B8, - PIPE_FORMAT_U_R5_G6_B5, + PIPE_FORMAT_R8G8B8A8_UNORM, + PIPE_FORMAT_A8R8G8B8_UNORM, + PIPE_FORMAT_R5G6B5_UNORM, PIPE_FORMAT_U_L8, PIPE_FORMAT_U_A8, PIPE_FORMAT_U_I8, PIPE_FORMAT_U_L8_A8, PIPE_FORMAT_YCBCR, PIPE_FORMAT_YCBCR_REV, - PIPE_FORMAT_S8_Z24, + PIPE_FORMAT_S8Z24_UNORM, }; /* Actually a lot more than this - add later: */ static const unsigned render_supported[] = { - PIPE_FORMAT_U_A8_R8_G8_B8, - PIPE_FORMAT_U_R5_G6_B5, + PIPE_FORMAT_A8R8G8B8_UNORM, + PIPE_FORMAT_R5G6B5_UNORM, }; /* */ static const unsigned z_stencil_supported[] = { - PIPE_FORMAT_U_Z16, - PIPE_FORMAT_U_Z32, - PIPE_FORMAT_S8_Z24, + PIPE_FORMAT_Z16_UNORM, + PIPE_FORMAT_Z32_UNORM, + PIPE_FORMAT_S8Z24_UNORM, }; switch (type) { @@ -97,9 +97,9 @@ i915_is_format_supported( struct pipe_context *pipe, } #else switch( format ) { - case PIPE_FORMAT_U_A8_R8_G8_B8: - case PIPE_FORMAT_U_R5_G6_B5: - case PIPE_FORMAT_S8_Z24: + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: return TRUE; }; return FALSE; diff --git a/src/mesa/pipe/i915simple/i915_state_emit.c b/src/mesa/pipe/i915simple/i915_state_emit.c index eda40d7..1e0db91 100644 --- a/src/mesa/pipe/i915simple/i915_state_emit.c +++ b/src/mesa/pipe/i915simple/i915_state_emit.c @@ -38,9 +38,9 @@ static unsigned translate_format( unsigned format ) { switch (format) { - case PIPE_FORMAT_U_A8_R8_G8_B8: + case PIPE_FORMAT_A8R8G8B8_UNORM: return COLOR_BUF_ARGB8888; - case PIPE_FORMAT_U_R5_G6_B5: + case PIPE_FORMAT_R5G6B5_UNORM: return COLOR_BUF_RGB565; default: assert(0); @@ -51,9 +51,9 @@ static unsigned translate_format( unsigned format ) static unsigned translate_depth_format( unsigned zformat ) { switch (zformat) { - case PIPE_FORMAT_S8_Z24: + case PIPE_FORMAT_S8Z24_UNORM: return DEPTH_FRMT_24_FIXED_8_OTHER; - case PIPE_FORMAT_U_Z16: + case PIPE_FORMAT_Z16_UNORM: return DEPTH_FRMT_16_FIXED; default: assert(0); @@ -247,7 +247,7 @@ i915_emit_hardware_state(struct i915_context *i915 ) if (cbuf_surface) cformat = cbuf_surface->format; else - cformat = PIPE_FORMAT_U_A8_R8_G8_B8; /* arbitrary */ + cformat = PIPE_FORMAT_A8R8G8B8_UNORM; /* arbitrary */ cformat = translate_format(cformat); if (depth_surface) diff --git a/src/mesa/pipe/i915simple/i915_state_sampler.c b/src/mesa/pipe/i915simple/i915_state_sampler.c index 1816d9a..dd2d51d 100644 --- a/src/mesa/pipe/i915simple/i915_state_sampler.c +++ b/src/mesa/pipe/i915simple/i915_state_sampler.c @@ -138,13 +138,13 @@ translate_texture_format(uint pipeFormat) return MAPSURF_8BIT | MT_8BIT_A8; case PIPE_FORMAT_U_A8_L8: return MAPSURF_16BIT | MT_16BIT_AY88; - case PIPE_FORMAT_U_R5_G6_B5: + case PIPE_FORMAT_R5G6B5_UNORM: return MAPSURF_16BIT | MT_16BIT_RGB565; - case PIPE_FORMAT_U_A1_R5_G5_B5: + case PIPE_FORMAT_A1R5G5B5_UNORM: return MAPSURF_16BIT | MT_16BIT_ARGB1555; - case PIPE_FORMAT_U_A4_R4_G4_B4: + case PIPE_FORMAT_A4R4G4B4_UNORM: return MAPSURF_16BIT | MT_16BIT_ARGB4444; - case PIPE_FORMAT_U_A8_R8_G8_B8: + case PIPE_FORMAT_A8R8G8B8_UNORM: return MAPSURF_32BIT | MT_32BIT_ARGB8888; case PIPE_FORMAT_YCBCR_REV: return (MAPSURF_422 | MT_422_YCRCB_NORMAL); @@ -155,7 +155,7 @@ translate_texture_format(uint pipeFormat) case PIPE_FORMAT_RGBA_FXT1: return (MAPSURF_COMPRESSED | MT_COMPRESS_FXT1); #endif - case PIPE_FORMAT_U_Z16: + case PIPE_FORMAT_Z16_UNORM: return (MAPSURF_16BIT | MT_16BIT_L16); #if 0 case PIPE_FORMAT_RGBA_DXT1: @@ -166,7 +166,7 @@ translate_texture_format(uint pipeFormat) case PIPE_FORMAT_RGBA_DXT5: return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); #endif - case PIPE_FORMAT_S8_Z24: + case PIPE_FORMAT_S8Z24_UNORM: return (MAPSURF_32BIT | MT_32BIT_xL824); default: fprintf(stderr, "i915: translate_texture_format() bad image format %x\n", diff --git a/src/mesa/pipe/i915simple/i915_surface.c b/src/mesa/pipe/i915simple/i915_surface.c index ecbabe5..ea48c1b 100644 --- a/src/mesa/pipe/i915simple/i915_surface.c +++ b/src/mesa/pipe/i915simple/i915_surface.c @@ -66,7 +66,7 @@ i915_get_tile_rgba(struct pipe_context *pipe, CLIP_TILE; switch (ps->format) { - case PIPE_FORMAT_U_A8_R8_G8_B8: + case PIPE_FORMAT_A8R8G8B8_UNORM: for (i = 0; i < h; i++) { float *pRow = p; for (j = 0; j < w; j++) { @@ -81,7 +81,7 @@ i915_get_tile_rgba(struct pipe_context *pipe, p += w0 * 4; } break; - case PIPE_FORMAT_S8_Z24: + case PIPE_FORMAT_S8Z24_UNORM: { const float scale = 1.0f / (float) 0xffffff; for (i = 0; i < h; i++) { diff --git a/src/mesa/pipe/p_format.h b/src/mesa/pipe/p_format.h index de0eb95..86728f7 100644 --- a/src/mesa/pipe/p_format.h +++ b/src/mesa/pipe/p_format.h @@ -276,18 +276,6 @@ static INLINE uint pf_rev(pipe_format_ycbcr_t f) /** * Duplicated formats: */ -#define PIPE_FORMAT_U_A8_R8_G8_B8 PIPE_FORMAT_A8R8G8B8_UNORM -#define PIPE_FORMAT_U_B8_G8_R8_A8 PIPE_FORMAT_B8G8R8A8_UNORM -#define PIPE_FORMAT_U_A1_R5_G5_B5 PIPE_FORMAT_A1R5G5B5_UNORM -#define PIPE_FORMAT_U_A4_R4_G4_B4 PIPE_FORMAT_A4R4G4B4_UNORM -#define PIPE_FORMAT_U_R8_G8_B8_A8 PIPE_FORMAT_R8G8B8A8_UNORM -#define PIPE_FORMAT_U_R5_G6_B5 PIPE_FORMAT_R5G6B5_UNORM -#define PIPE_FORMAT_S_R16_G16_B16_A16 PIPE_FORMAT_R16G16B16A16_SNORM -#define PIPE_FORMAT_U_Z16 PIPE_FORMAT_Z16_UNORM -#define PIPE_FORMAT_U_Z32 PIPE_FORMAT_Z32_UNORM -#define PIPE_FORMAT_F_Z32 PIPE_FORMAT_Z32_FLOAT -#define PIPE_FORMAT_S8_Z24 PIPE_FORMAT_S8Z24_UNORM -#define PIPE_FORMAT_Z24_S8 PIPE_FORMAT_Z24S8_UNORM #define PIPE_FORMAT_U_S8 PIPE_FORMAT_S8_UNORM /** diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c index 2b24ea6..a6352e0 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 3318189..00128fa 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 0149b20..b8c1992 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 16f0209..cdbffe5 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 93930b1..be5dd5c 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; diff --git a/src/mesa/pipe/xlib/xm_api.c b/src/mesa/pipe/xlib/xm_api.c index 5cb9ca0..9c77137 100644 --- a/src/mesa/pipe/xlib/xm_api.c +++ b/src/mesa/pipe/xlib/xm_api.c @@ -406,7 +406,7 @@ choose_pixel_format(XMesaVisual v) return 0 /* PIXEL_FORMAT_U_A8_B8_G8_R8 */; } else { - return PIPE_FORMAT_U_R8_G8_B8_A8; + return PIPE_FORMAT_R8G8B8A8_UNORM; } } else if ( GET_REDMASK(v) == 0xff0000 @@ -415,10 +415,10 @@ choose_pixel_format(XMesaVisual v) && v->BitsPerPixel == 32) { if (CHECK_BYTE_ORDER(v)) { /* no byteswapping needed */ - return PIPE_FORMAT_U_A8_R8_G8_B8; + return PIPE_FORMAT_A8R8G8B8_UNORM; } else { - return PIPE_FORMAT_U_B8_G8_R8_A8; + return PIPE_FORMAT_B8G8R8A8_UNORM; } } else if ( GET_REDMASK(v) == 0xf800 @@ -427,7 +427,7 @@ choose_pixel_format(XMesaVisual v) && CHECK_BYTE_ORDER(v) && v->BitsPerPixel == 16) { /* 5-6-5 RGB */ - return PIPE_FORMAT_U_R5_G6_B5; + return PIPE_FORMAT_R5G6B5_UNORM; } assert(0); diff --git a/src/mesa/pipe/xlib/xm_winsys.c b/src/mesa/pipe/xlib/xm_winsys.c index e8cb36e..408797c 100644 --- a/src/mesa/pipe/xlib/xm_winsys.c +++ b/src/mesa/pipe/xlib/xm_winsys.c @@ -389,11 +389,11 @@ xmesa_is_format_supported(struct softpipe_winsys *sws, uint format) else { /* non-color / window surface format */ switch (format) { - case PIPE_FORMAT_S_R16_G16_B16_A16: - case PIPE_FORMAT_S8_Z24: + case PIPE_FORMAT_R16G16B16A16_SNORM: + case PIPE_FORMAT_S8Z24_UNORM: case PIPE_FORMAT_U_S8: - case PIPE_FORMAT_U_Z16: - case PIPE_FORMAT_U_Z32: + case PIPE_FORMAT_Z16_UNORM: + case PIPE_FORMAT_Z32_UNORM: return TRUE; default: return FALSE; -- 2.7.4