case GL_STENCIL_INDEX8_EXT:
case GL_STENCIL_INDEX16_EXT:
/* alloc a depth+stencil buffer */
- rb->Format = MESA_FORMAT_Z24_S8;
+ rb->Format = MESA_FORMAT_S8_Z24;
rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
cpp = 4;
- irb->texformat = MESA_FORMAT_Z24_S8;
+ irb->texformat = MESA_FORMAT_S8_Z24;
break;
case GL_DEPTH_COMPONENT16:
rb->Format = MESA_FORMAT_Z16;
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32:
- rb->Format = MESA_FORMAT_Z24_S8;
+ rb->Format = MESA_FORMAT_S8_Z24;
rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
cpp = 4;
- irb->texformat = MESA_FORMAT_Z24_S8;
+ irb->texformat = MESA_FORMAT_S8_Z24;
break;
case GL_DEPTH_STENCIL_EXT:
case GL_DEPTH24_STENCIL8_EXT:
- rb->Format = MESA_FORMAT_Z24_S8;
+ rb->Format = MESA_FORMAT_S8_Z24;
rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
cpp = 4;
- irb->texformat = MESA_FORMAT_Z24_S8;
+ irb->texformat = MESA_FORMAT_S8_Z24;
break;
default:
_mesa_problem(ctx,
irb->texformat = MESA_FORMAT_ARGB8888;
break;
case GL_STENCIL_INDEX8_EXT:
- irb->Base.Format = MESA_FORMAT_Z24_S8;
+ irb->Base.Format = MESA_FORMAT_S8_Z24;
irb->Base._BaseFormat = GL_STENCIL_INDEX;
irb->Base.DataType = GL_UNSIGNED_BYTE;
- irb->texformat = MESA_FORMAT_Z24_S8;
+ irb->texformat = MESA_FORMAT_S8_Z24;
break;
case GL_DEPTH_COMPONENT16:
irb->Base.Format = MESA_FORMAT_Z16;
irb->texformat = MESA_FORMAT_Z16;
break;
case GL_DEPTH_COMPONENT24:
- irb->Base.Format = MESA_FORMAT_Z24_S8;
+ irb->Base.Format = MESA_FORMAT_S8_Z24;
irb->Base._BaseFormat = GL_DEPTH_COMPONENT;
irb->Base.DataType = GL_UNSIGNED_INT;
- irb->texformat = MESA_FORMAT_Z24_S8;
+ irb->texformat = MESA_FORMAT_S8_Z24;
break;
case GL_DEPTH24_STENCIL8_EXT:
- irb->Base.Format = MESA_FORMAT_Z24_S8;
+ irb->Base.Format = MESA_FORMAT_S8_Z24;
irb->Base._BaseFormat = GL_DEPTH_STENCIL;
irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
- irb->texformat = MESA_FORMAT_Z24_S8;
+ irb->texformat = MESA_FORMAT_S8_Z24;
break;
default:
_mesa_problem(NULL,
irb->Base.DataType = GL_UNSIGNED_SHORT;
DBG("Render to DEPTH16 texture OK\n");
}
- else if (texImage->TexFormat == MESA_FORMAT_Z24_S8) {
+ else if (texImage->TexFormat == MESA_FORMAT_S8_Z24) {
irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
DBG("Render to DEPTH_STENCIL texture OK\n");
}
dri_bo_subdata(irb->region->buffer, offset, 1, &val);
}
-static uint32_t
-z24s8_to_s8z24(uint32_t val)
-{
- return (val << 24) | (val >> 8);
-}
-
-static uint32_t
-s8z24_to_z24s8(uint32_t val)
-{
- return (val >> 24) | (val << 8);
-}
-
static uint32_t no_tile_swizzle(struct intel_renderbuffer *irb,
int x, int y)
{
/* z24s8 depthbuffer functions. */
#define INTEL_VALUE_TYPE GLuint
-#define INTEL_WRITE_DEPTH(offset, d) pwrite_32(irb, offset, z24s8_to_s8z24(d))
-#define INTEL_READ_DEPTH(offset) s8z24_to_z24s8(pread_32(irb, offset))
+#define INTEL_WRITE_DEPTH(offset, d) pwrite_32(irb, offset, d)
+#define INTEL_READ_DEPTH(offset) pread_32(irb, offset)
#define INTEL_TAG(name) name##_z24_s8
#include "intel_depthtmp.h"
break;
}
break;
- case MESA_FORMAT_Z24_S8:
+ case MESA_FORMAT_S8_Z24:
/* There are a few different ways SW asks us to access the S8Z24 data:
* Z24 depth-only depth reads
* S8Z24 depth reads
* S8Z24 stencil reads.
*/
- if (rb->Format == MESA_FORMAT_Z24_S8) {
+ if (rb->Format == MESA_FORMAT_S8_Z24) {
switch (tiling) {
case I915_TILING_NONE:
default: