/**
** 16-bit depthbuffer functions.
**/
+#define VALUE_TYPE GLushort
+ #define WRITE_DEPTH(_x, _y, d) \
+ pwrite_16(irb, no_tile_swizzle(irb, intel, _x, _y), d)
+ #define READ_DEPTH(d, _x, _y) \
+ d = pread_16(irb, no_tile_swizzle(irb, intel, _x, _y))
+ #define TAG(x) intel##x##_z16
+ #include "depthtmp.h"
- #define WRITE_DEPTH( _x, _y, d ) \
- ((GLushort *)buf)[(_x) + (_y) * pitch] = d;
-
- #define READ_DEPTH( d, _x, _y ) \
- d = ((GLushort *)buf)[(_x) + (_y) * pitch];
+ /**
+ ** 16-bit x tile depthbuffer functions.
+ **/
++#define VALUE_TYPE GLushort
+ #define WRITE_DEPTH(_x, _y, d) \
+ pwrite_16(irb, x_tile_swizzle(irb, intel, _x, _y), d)
+ #define READ_DEPTH(d, _x, _y) \
+ d = pread_16(irb, x_tile_swizzle(irb, intel, _x, _y))
+ #define TAG(x) intel_XTile_##x##_z16
+ #include "depthtmp.h"
- #define TAG(x) intel##x##_z16
+ /**
+ ** 16-bit y tile depthbuffer functions.
+ **/
++#define VALUE_TYPE GLushort
+ #define WRITE_DEPTH(_x, _y, d) \
+ pwrite_16(irb, y_tile_swizzle(irb, intel, _x, _y), d)
+ #define READ_DEPTH(d, _x, _y) \
+ d = pread_16(irb, y_tile_swizzle(irb, intel, _x, _y))
+ #define TAG(x) intel_YTile_##x##_z16
#include "depthtmp.h"
** The wrappers in main/depthstencil.c are used to extract the depth
** and stencil values.
**/
+#define VALUE_TYPE GLuint
+
/* Change ZZZS -> SZZZ */
- #define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = ((d) >> 8) | ((d) << 24); \
- ((GLuint *)buf)[(_x) + (_y) * pitch] = tmp; \
- }
+ #define WRITE_DEPTH(_x, _y, d) \
+ pwrite_32(irb, no_tile_swizzle(irb, intel, _x, _y), \
+ ((d) >> 8) | ((d) << 24))
/* Change SZZZ -> ZZZS */
#define READ_DEPTH( d, _x, _y ) { \
/**
- ** 8-bit stencil function (XXX FBO: This is obsolete)
+ ** 24/8-bit x-tile interleaved depth/stencil functions
+ ** Note: we're actually reading back combined depth+stencil values.
+ ** The wrappers in main/depthstencil.c are used to extract the depth
+ ** and stencil values.
**/
- #define WRITE_STENCIL( _x, _y, d ) { \
- GLuint tmp = ((GLuint *)buf)[(_x) + (_y) * pitch]; \
- tmp &= 0xffffff; \
- tmp |= ((d) << 24); \
- ((GLuint *) buf)[(_x) + (_y) * pitch] = tmp; \
++#define VALUE_TYPE GLuint
++
+ /* Change ZZZS -> SZZZ */
+ #define WRITE_DEPTH(_x, _y, d) \
+ pwrite_32(irb, x_tile_swizzle(irb, intel, _x, _y), \
+ ((d) >> 8) | ((d) << 24)) \
+
+ /* Change SZZZ -> ZZZS */
+ #define READ_DEPTH( d, _x, _y ) { \
+ GLuint tmp = pread_32(irb, x_tile_swizzle(irb, intel, _x, _y)); \
+ d = (tmp << 8) | (tmp >> 24); \
}
- #define READ_STENCIL( d, _x, _y ) \
- d = ((GLuint *)buf)[(_x) + (_y) * pitch] >> 24;
+ #define TAG(x) intel_XTile_##x##_z24_s8
+ #include "depthtmp.h"
+
+ /**
+ ** 24/8-bit y-tile interleaved depth/stencil functions
+ ** Note: we're actually reading back combined depth+stencil values.
+ ** The wrappers in main/depthstencil.c are used to extract the depth
+ ** and stencil values.
+ **/
++#define VALUE_TYPE GLuint
++
+ /* Change ZZZS -> SZZZ */
+ #define WRITE_DEPTH(_x, _y, d) \
+ pwrite_32(irb, y_tile_swizzle(irb, intel, _x, _y), \
+ ((d) >> 8) | ((d) << 24))
+
+ /* Change SZZZ -> ZZZS */
+ #define READ_DEPTH( d, _x, _y ) { \
+ GLuint tmp = pread_32(irb, y_tile_swizzle(irb, intel, _x, _y)); \
+ d = (tmp << 8) | (tmp >> 24); \
+ }
+
+ #define TAG(x) intel_YTile_##x##_z24_s8
+ #include "depthtmp.h"
+
+
+ /**
+ ** 8-bit stencil function (XXX FBO: This is obsolete)
+ **/
+ #define WRITE_STENCIL(_x, _y, d) \
+ pwrite_8(irb, no_tile_swizzle(irb, intel, _x, _y) + 3, d)
+
+ #define READ_STENCIL(d, _x, _y) \
+ d = pread_8(irb, no_tile_swizzle(irb, intel, _x, _y) + 3);
#define TAG(x) intel##x##_z24_s8
#include "stenciltmp.h"