diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-12-19 11:35:21 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-12-19 11:37:16 +0000 |
commit | 2f53713beb9aa425d8248bae6a3c388a7de189de (patch) | |
tree | bb7da01e6902421b61f0185d3d1c48d193c77d31 | |
parent | 1f37b4d87e798690ed080e5da356366906ff55cd (diff) |
965: fix off-by-one in surface dimensions
-rw-r--r-- | src/mesa/pipe/i965simple/brw_wm_surface_state.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mesa/pipe/i965simple/brw_wm_surface_state.c b/src/mesa/pipe/i965simple/brw_wm_surface_state.c index 0f851dd1ed..1eb11cbb91 100644 --- a/src/mesa/pipe/i965simple/brw_wm_surface_state.c +++ b/src/mesa/pipe/i965simple/brw_wm_surface_state.c @@ -155,13 +155,13 @@ void brw_update_texture_surface( struct brw_context *brw, surf.ss1.base_addr = brw_buffer_offset( brw, tObj->buffer ); surf.ss2.mip_count = tObj->base.last_level - tObj->base.first_level; - surf.ss2.width = tObj->base.width[0]; - surf.ss2.height = tObj->base.height[0]; + surf.ss2.width = tObj->base.width[0] - 1; + surf.ss2.height = tObj->base.height[0] - 1; surf.ss3.tile_walk = BRW_TILEWALK_XMAJOR; surf.ss3.tiled_surface = 0; /* always zero */ - surf.ss3.pitch = tObj->pitch; - surf.ss3.depth = tObj->base.depth[0]; + surf.ss3.pitch = tObj->pitch - 1; + surf.ss3.depth = tObj->base.depth[0] - 1; surf.ss4.min_lod = 0; @@ -192,25 +192,25 @@ static void upload_wm_surfaces(struct brw_context *brw ) /* BRW_NEW_FRAMEBUFFER */ - struct pipe_surface *region = brw->attribs.FrameBuffer.cbufs[0];/*fixme*/ + struct pipe_surface *pipe_surface = brw->attribs.FrameBuffer.cbufs[0];/*fixme*/ memset(&surf, 0, sizeof(surf)); - if (region != NULL) { - if (region->cpp == 4) + if (pipe_surface != NULL) { + if (pipe_surface->cpp == 4) surf.ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; else surf.ss0.surface_format = BRW_SURFACEFORMAT_B5G6R5_UNORM; surf.ss0.surface_type = BRW_SURFACE_2D; - surf.ss1.base_addr = brw_buffer_offset( brw, region->buffer ); + surf.ss1.base_addr = brw_buffer_offset( brw, pipe_surface->buffer ); - surf.ss2.width = region->width; - surf.ss2.height = region->height; + surf.ss2.width = pipe_surface->width - 1; + surf.ss2.height = pipe_surface->height - 1; surf.ss3.tile_walk = BRW_TILEWALK_XMAJOR; surf.ss3.tiled_surface = 0; - surf.ss3.pitch = region->pitch; + surf.ss3.pitch = pipe_surface->pitch - 1; } else { surf.ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; surf.ss0.surface_type = BRW_SURFACE_NULL; |