diff options
author | Dave Airlie <[email protected]> | 2011-09-11 09:45:10 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-10-11 16:13:29 +0100 |
commit | 866f9b18c68ede63c00917ec9c3dae3524ca8826 (patch) | |
tree | b07a53b71fe3aeac8deddbabb00ced29bb33e3c9 /src/mesa | |
parent | 6b3e75de7c2dd6be6bf1acd0e996bdb1def702a1 (diff) |
gallium: rename ZS stencil type to UINT (v2)
these are never USCALED, always UINT in reality.
taken from some work by Christoph Bumiller
v2: fixup formatting of table + tabs
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 40 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_eglimage.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 6 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_readpixels.c | 14 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 10 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_format.c | 34 |
6 files changed, 53 insertions, 53 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 74e87f0e446..89e0a73f1c9 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -871,7 +871,7 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, if (format == GL_DEPTH_STENCIL) { GLenum ztype = - pt->resource->format == PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED ? + pt->resource->format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT ? GL_FLOAT : GL_UNSIGNED_INT; _mesa_unpack_depth_span(ctx, spanWidth, ztype, zValues, @@ -896,14 +896,14 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, /* now pack the stencil (and Z) values in the dest format */ switch (pt->resource->format) { - case PIPE_FORMAT_S8_USCALED: + case PIPE_FORMAT_S8_UINT: { ubyte *dest = stmap + spanY * pt->stride + spanX; assert(usage == PIPE_TRANSFER_WRITE); memcpy(dest, sValues, spanWidth); } break; - case PIPE_FORMAT_Z24_UNORM_S8_USCALED: + case PIPE_FORMAT_Z24_UNORM_S8_UINT: if (format == GL_DEPTH_STENCIL) { uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); GLint k; @@ -921,7 +921,7 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, } } break; - case PIPE_FORMAT_S8_USCALED_Z24_UNORM: + case PIPE_FORMAT_S8_UINT_Z24_UNORM: if (format == GL_DEPTH_STENCIL) { uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); GLint k; @@ -939,7 +939,7 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, } } break; - case PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED: + case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: if (format == GL_DEPTH_STENCIL) { uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); GLfloat *destf = (GLfloat*)dest; @@ -1112,20 +1112,20 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, enum pipe_format stencil_format = PIPE_FORMAT_NONE; switch (pt->format) { - case PIPE_FORMAT_Z24_UNORM_S8_USCALED: - case PIPE_FORMAT_X24S8_USCALED: - stencil_format = PIPE_FORMAT_X24S8_USCALED; + case PIPE_FORMAT_Z24_UNORM_S8_UINT: + case PIPE_FORMAT_X24S8_UINT: + stencil_format = PIPE_FORMAT_X24S8_UINT; break; - case PIPE_FORMAT_S8_USCALED_Z24_UNORM: - case PIPE_FORMAT_S8X24_USCALED: - stencil_format = PIPE_FORMAT_S8X24_USCALED; + case PIPE_FORMAT_S8_UINT_Z24_UNORM: + case PIPE_FORMAT_S8X24_UINT: + stencil_format = PIPE_FORMAT_S8X24_UINT; break; - case PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED: - case PIPE_FORMAT_X32_S8X24_USCALED: - stencil_format = PIPE_FORMAT_X32_S8X24_USCALED; + case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: + case PIPE_FORMAT_X32_S8X24_UINT: + stencil_format = PIPE_FORMAT_X32_S8X24_UINT; break; - case PIPE_FORMAT_S8_USCALED: - stencil_format = PIPE_FORMAT_S8_USCALED; + case PIPE_FORMAT_S8_UINT: + stencil_format = PIPE_FORMAT_S8_UINT; break; default: assert(0); @@ -1241,7 +1241,7 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, src = buffer + i * width; switch (ptDraw->resource->format) { - case PIPE_FORMAT_Z24_UNORM_S8_USCALED: + case PIPE_FORMAT_Z24_UNORM_S8_UINT: { uint *dst4 = (uint *) dst; int j; @@ -1252,7 +1252,7 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, } } break; - case PIPE_FORMAT_S8_USCALED_Z24_UNORM: + case PIPE_FORMAT_S8_UINT_Z24_UNORM: { uint *dst4 = (uint *) dst; int j; @@ -1263,11 +1263,11 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, } } break; - case PIPE_FORMAT_S8_USCALED: + case PIPE_FORMAT_S8_UINT: assert(usage == PIPE_TRANSFER_WRITE); memcpy(dst, src, width); break; - case PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED: + case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: { uint *dst4 = (uint *) dst; int j; diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c index 531296fb302..37c20ebe30f 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.c +++ b/src/mesa/state_tracker/st_cb_eglimage.c @@ -53,7 +53,7 @@ st_pipe_format_to_base_format(enum pipe_format format) base_format = GL_DEPTH_STENCIL; } else { - if (format == PIPE_FORMAT_S8_USCALED) + if (format == PIPE_FORMAT_S8_UINT) base_format = GL_STENCIL_INDEX; else base_format = GL_DEPTH_COMPONENT; diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 4d321587fc8..6da65d7b9ed 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -259,13 +259,13 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) case PIPE_FORMAT_Z32_UNORM: strb->Base.InternalFormat = GL_DEPTH_COMPONENT32; break; - case PIPE_FORMAT_Z24_UNORM_S8_USCALED: - case PIPE_FORMAT_S8_USCALED_Z24_UNORM: + case PIPE_FORMAT_Z24_UNORM_S8_UINT: + case PIPE_FORMAT_S8_UINT_Z24_UNORM: case PIPE_FORMAT_Z24X8_UNORM: case PIPE_FORMAT_X8Z24_UNORM: strb->Base.InternalFormat = GL_DEPTH24_STENCIL8_EXT; break; - case PIPE_FORMAT_S8_USCALED: + case PIPE_FORMAT_S8_UINT: strb->Base.InternalFormat = GL_STENCIL_INDEX8_EXT; break; case PIPE_FORMAT_R16G16B16A16_SNORM: diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 7fa1672fda8..bd73f3bf037 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -109,13 +109,13 @@ st_read_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, /* get stencil (and Z) values */ switch (pt->resource->format) { - case PIPE_FORMAT_S8_USCALED: + case PIPE_FORMAT_S8_UINT: { const ubyte *src = stmap + srcY * pt->stride; memcpy(sValues, src, width); } break; - case PIPE_FORMAT_Z24_UNORM_S8_USCALED: + case PIPE_FORMAT_Z24_UNORM_S8_UINT: if (format == GL_DEPTH_STENCIL) { const uint *src = (uint *) (stmap + srcY * pt->stride); const GLfloat scale = 1.0f / (0xffffff); @@ -133,7 +133,7 @@ st_read_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, } } break; - case PIPE_FORMAT_S8_USCALED_Z24_UNORM: + case PIPE_FORMAT_S8_UINT_Z24_UNORM: if (format == GL_DEPTH_STENCIL) { const uint *src = (uint *) (stmap + srcY * pt->stride); const GLfloat scale = 1.0f / (0xffffff); @@ -151,7 +151,7 @@ st_read_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, } } break; - case PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED: + case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: if (format == GL_DEPTH_STENCIL) { const uint *src = (uint *) (stmap + srcY * pt->stride); const GLfloat *srcf = (const GLfloat*)src; @@ -502,7 +502,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei h const GLint dstStride = _mesa_image_row_stride(&clippedPacking, width, format, type); - if (pformat == PIPE_FORMAT_Z24_UNORM_S8_USCALED || + if (pformat == PIPE_FORMAT_Z24_UNORM_S8_UINT || pformat == PIPE_FORMAT_Z24X8_UNORM) { if (format == GL_DEPTH_COMPONENT) { for (i = 0; i < height; i++) { @@ -534,7 +534,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei h } } } - else if (pformat == PIPE_FORMAT_S8_USCALED_Z24_UNORM || + else if (pformat == PIPE_FORMAT_S8_UINT_Z24_UNORM || pformat == PIPE_FORMAT_X8Z24_UNORM) { if (format == GL_DEPTH_COMPONENT) { for (i = 0; i < height; i++) { @@ -601,7 +601,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei h dst += dstStride; } } - else if (pformat == PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED) { + else if (pformat == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) { assert(format == GL_DEPTH_COMPONENT); for (i = 0; i < height; i++) { GLfloat zfloat[MAX_WIDTH]; /* Z32 */ diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 6707fcae122..a1f029089d0 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -368,18 +368,18 @@ void st_init_extensions(struct st_context *st) /* GL_EXT_packed_depth_stencil requires both the ability to render to * a depth/stencil buffer and texture from depth/stencil source. */ - if (screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM, + if (screen->is_format_supported(screen, PIPE_FORMAT_S8_UINT_Z24_UNORM, PIPE_TEXTURE_2D, 0, PIPE_BIND_DEPTH_STENCIL) && - screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM, + screen->is_format_supported(screen, PIPE_FORMAT_S8_UINT_Z24_UNORM, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW)) { ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; } - else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED, + else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_UINT, PIPE_TEXTURE_2D, 0, PIPE_BIND_DEPTH_STENCIL) && - screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED, + screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_UINT, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW)) { ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; @@ -650,7 +650,7 @@ void st_init_extensions(struct st_context *st) PIPE_TEXTURE_2D, 0, PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_SAMPLER_VIEW) && - screen->is_format_supported(screen, PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED, + screen->is_format_supported(screen, PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, PIPE_TEXTURE_2D, 0, PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_SAMPLER_VIEW)) { diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 6e8ab94f412..196433d5e23 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -89,13 +89,13 @@ st_format_datatype(enum pipe_format format) format == PIPE_FORMAT_R9G9B9E5_FLOAT) { return GL_FLOAT; } - else if (format == PIPE_FORMAT_Z24_UNORM_S8_USCALED || - format == PIPE_FORMAT_S8_USCALED_Z24_UNORM || + else if (format == PIPE_FORMAT_Z24_UNORM_S8_UINT || + format == PIPE_FORMAT_S8_UINT_Z24_UNORM || format == PIPE_FORMAT_Z24X8_UNORM || format == PIPE_FORMAT_X8Z24_UNORM) { return GL_UNSIGNED_INT_24_8; } - else if (format == PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED) { + else if (format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) { return GL_FLOAT_32_UNSIGNED_INT_24_8_REV; } else { @@ -199,19 +199,19 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) case MESA_FORMAT_Z32: return PIPE_FORMAT_Z32_UNORM; case MESA_FORMAT_Z24_S8: - return PIPE_FORMAT_S8_USCALED_Z24_UNORM; + return PIPE_FORMAT_S8_UINT_Z24_UNORM; case MESA_FORMAT_S8_Z24: - return PIPE_FORMAT_Z24_UNORM_S8_USCALED; + return PIPE_FORMAT_Z24_UNORM_S8_UINT; case MESA_FORMAT_Z24_X8: return PIPE_FORMAT_X8Z24_UNORM; case MESA_FORMAT_X8_Z24: return PIPE_FORMAT_Z24X8_UNORM; case MESA_FORMAT_S8: - return PIPE_FORMAT_S8_USCALED; + return PIPE_FORMAT_S8_UINT; case MESA_FORMAT_Z32_FLOAT: return PIPE_FORMAT_Z32_FLOAT; case MESA_FORMAT_Z32_FLOAT_X24S8: - return PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED; + return PIPE_FORMAT_Z32_FLOAT_S8X24_UINT; case MESA_FORMAT_YCBCR: return PIPE_FORMAT_UYVY; #if FEATURE_texture_s3tc @@ -508,7 +508,7 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_I8; case PIPE_FORMAT_I16_UNORM: return MESA_FORMAT_I16; - case PIPE_FORMAT_S8_USCALED: + case PIPE_FORMAT_S8_UINT: return MESA_FORMAT_S8; case PIPE_FORMAT_R16G16B16A16_UNORM: @@ -518,17 +518,17 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_Z16; case PIPE_FORMAT_Z32_UNORM: return MESA_FORMAT_Z32; - case PIPE_FORMAT_S8_USCALED_Z24_UNORM: + case PIPE_FORMAT_S8_UINT_Z24_UNORM: return MESA_FORMAT_Z24_S8; case PIPE_FORMAT_X8Z24_UNORM: return MESA_FORMAT_Z24_X8; case PIPE_FORMAT_Z24X8_UNORM: return MESA_FORMAT_X8_Z24; - case PIPE_FORMAT_Z24_UNORM_S8_USCALED: + case PIPE_FORMAT_Z24_UNORM_S8_UINT: return MESA_FORMAT_S8_Z24; case PIPE_FORMAT_Z32_FLOAT: return MESA_FORMAT_Z32_FLOAT; - case PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED: + case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: return MESA_FORMAT_Z32_FLOAT_X24S8; case PIPE_FORMAT_UYVY: @@ -818,8 +818,8 @@ struct format_mapping PIPE_FORMAT_Z24X8_UNORM, \ PIPE_FORMAT_X8Z24_UNORM, \ PIPE_FORMAT_Z16_UNORM, \ - PIPE_FORMAT_Z24_UNORM_S8_USCALED, \ - PIPE_FORMAT_S8_USCALED_Z24_UNORM, \ + PIPE_FORMAT_Z24_UNORM_S8_UINT, \ + PIPE_FORMAT_S8_UINT_Z24_UNORM, \ 0 /** @@ -988,19 +988,19 @@ static const struct format_mapping format_map[] = { { GL_STENCIL_INDEX, GL_STENCIL_INDEX1_EXT, GL_STENCIL_INDEX4_EXT, GL_STENCIL_INDEX8_EXT, GL_STENCIL_INDEX16_EXT, 0 }, { - PIPE_FORMAT_S8_USCALED, PIPE_FORMAT_Z24_UNORM_S8_USCALED, - PIPE_FORMAT_S8_USCALED_Z24_UNORM, 0 + PIPE_FORMAT_S8_UINT, PIPE_FORMAT_Z24_UNORM_S8_UINT, + PIPE_FORMAT_S8_UINT_Z24_UNORM, 0 } }, /* Depth / Stencil formats */ { { GL_DEPTH_STENCIL_EXT, GL_DEPTH24_STENCIL8_EXT, 0 }, - { PIPE_FORMAT_Z24_UNORM_S8_USCALED, PIPE_FORMAT_S8_USCALED_Z24_UNORM, 0 } + { PIPE_FORMAT_Z24_UNORM_S8_UINT, PIPE_FORMAT_S8_UINT_Z24_UNORM, 0 } }, { { GL_DEPTH32F_STENCIL8, 0 }, - { PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED, 0 } + { PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, 0 } }, /* sRGB formats */ |