summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_drawpixels.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_cb_drawpixels.c')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 03617b7a93..7c664267d4 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -63,6 +63,7 @@
#include "tgsi/tgsi_ureg.h"
#include "util/u_tile.h"
#include "util/u_draw_quad.h"
+#include "util/u_format.h"
#include "util/u_math.h"
#include "util/u_rect.h"
#include "shader/prog_instruction.h"
@@ -647,7 +648,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
}
if(format != GL_DEPTH_STENCIL &&
- pf_get_component_bits( strb->format, PIPE_FORMAT_COMP_Z ) != 0)
+ util_format_get_component_bits(strb->format, UTIL_FORMAT_COLORSPACE_ZS, 0) != 0)
usage = PIPE_TRANSFER_READ_WRITE;
else
usage = PIPE_TRANSFER_WRITE;
@@ -701,7 +702,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
}
/* now pack the stencil (and Z) values in the dest format */
- switch (pt->format) {
+ switch (pt->texture->format) {
case PIPE_FORMAT_S8_UNORM:
{
ubyte *dest = stmap + spanY * pt->stride + spanX;
@@ -842,7 +843,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GL_STENCIL_INDEX, GL_UNSIGNED_BYTE,
&ctx->DefaultPacking, buffer);
- if(pf_get_component_bits( rbDraw->format, PIPE_FORMAT_COMP_Z ) != 0)
+ if(util_format_get_component_bits(rbDraw->format, UTIL_FORMAT_COLORSPACE_ZS, 0) != 0)
usage = PIPE_TRANSFER_READ_WRITE;
else
usage = PIPE_TRANSFER_WRITE;
@@ -856,8 +857,8 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
usage, dstx, dsty,
width, height);
- assert(ptDraw->block.width == 1);
- assert(ptDraw->block.height == 1);
+ assert(util_format_get_blockwidth(ptDraw->texture->format) == 1);
+ assert(util_format_get_blockheight(ptDraw->texture->format) == 1);
/* map the stencil buffer */
drawMap = screen->transfer_map(screen, ptDraw);
@@ -878,7 +879,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
dst = drawMap + y * ptDraw->stride;
src = buffer + i * width;
- switch (ptDraw->format) {
+ switch (ptDraw->texture->format) {
case PIPE_FORMAT_S8Z24_UNORM:
{
uint *dst4 = (uint *) dst;
@@ -1083,7 +1084,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (ST_DEBUG & DEBUG_FALLBACK)
debug_printf("%s: fallback processing\n", __FUNCTION__);
- if (type == GL_DEPTH && pf_is_depth_and_stencil(pt->format))
+ if (type == GL_DEPTH && util_format_is_depth_and_stencil(pt->format))
transfer_usage = PIPE_TRANSFER_READ_WRITE;
else
transfer_usage = PIPE_TRANSFER_WRITE;