[Mesa-dev] [PATCH 1/1] r600, compute: Use the BO format for RAT instead of hardwired R32_UINT
Jan Vesely
jan.vesely at rutgers.edu
Thu Feb 4 20:56:06 UTC 2016
r600_compute_buffer_alloc_vram uses pipe_buffer_create, which sets format to
PIPE_FORMAT_R8_UNORM
Fixes assertion failure since 7dd31b81fee7fe40bd09cf3fbc324fcc32782479
gallium/radeon: support PIPE_CAP_SURFACE_REINTERPRET_BLOCKS
while at it use rctx helper var where possible.
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
src/gallium/drivers/r600/evergreen_compute.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index d6e4501..010a92e 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -117,23 +117,24 @@ static void evergreen_set_rat(
rctx = pipe->ctx;
- COMPUTE_DBG(rctx->screen, "bind rat: %i \n", id);
+ COMPUTE_DBG(rctx->screen, "bind rat: %i (format %u) \n", id,
+ bo->b.b.format);
/* Create the RAT surface */
memset(&rat_templ, 0, sizeof(rat_templ));
- rat_templ.format = PIPE_FORMAT_R32_UINT;
+ rat_templ.format = bo->b.b.format;
rat_templ.u.tex.level = 0;
rat_templ.u.tex.first_layer = 0;
rat_templ.u.tex.last_layer = 0;
/* Add the RAT the list of color buffers */
- pipe->ctx->framebuffer.state.cbufs[id] = pipe->ctx->b.b.create_surface(
- (struct pipe_context *)pipe->ctx,
+ pipe->ctx->framebuffer.state.cbufs[id] = rctx->b.b.create_surface(
+ (struct pipe_context *)rctx,
(struct pipe_resource *)bo, &rat_templ);
/* Update the number of color buffers */
pipe->ctx->framebuffer.state.nr_cbufs =
- MAX2(id + 1, pipe->ctx->framebuffer.state.nr_cbufs);
+ MAX2(id + 1, rctx->framebuffer.state.nr_cbufs);
/* Update the cb_target_mask
* XXX: I think this is a potential spot for bugs once we start doing
@@ -141,7 +142,7 @@ static void evergreen_set_rat(
* of this driver. */
pipe->ctx->compute_cb_target_mask |= (0xf << (id * 4));
- surf = (struct r600_surface*)pipe->ctx->framebuffer.state.cbufs[id];
+ surf = (struct r600_surface*)rctx->framebuffer.state.cbufs[id];
evergreen_init_color_surface_rat(rctx, surf);
}
--
2.5.0
More information about the mesa-dev
mailing list