summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_surface.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-08-30 13:08:27 +0200
committerChristoph Bumiller <[email protected]>2011-08-30 13:55:07 +0200
commit0a3f0ff2645d03d5f572cc26932595b8df400505 (patch)
treee85f772a412a0b2b73f84f39023a4c52c0d22c62 /src/gallium/drivers/nv50/nv50_surface.c
parent55bab45a7c6c8e659e31b398b4ccd6e790c2738b (diff)
nv50: add support for linear textures and render targets
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_surface.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_surface.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c
index 57339f89a36..b0a8497c1e7 100644
--- a/src/gallium/drivers/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nv50/nv50_surface.c
@@ -290,11 +290,19 @@ nv50_clear_render_target(struct pipe_context *pipe,
OUT_RING (chan, mt->level[sf->base.u.tex.level].tile_mode << 4);
OUT_RING (chan, 0);
BEGIN_RING(chan, RING_3D(RT_HORIZ(0)), 2);
- OUT_RING (chan, sf->width);
+ if (nouveau_bo_tile_layout(bo))
+ OUT_RING(chan, sf->width);
+ else
+ OUT_RING(chan, NV50_3D_RT_HORIZ_LINEAR | mt->level[0].pitch);
OUT_RING (chan, sf->height);
BEGIN_RING(chan, RING_3D(RT_ARRAY_MODE), 1);
OUT_RING (chan, 1);
+ if (!nouveau_bo_tile_layout(bo)) {
+ BEGIN_RING(chan, RING_3D(ZETA_ENABLE), 1);
+ OUT_RING (chan, 0);
+ }
+
/* NOTE: only works with D3D clear flag (5097/0x143c bit 4) */
BEGIN_RING(chan, RING_3D(VIEWPORT_HORIZ(0)), 2);
@@ -324,6 +332,8 @@ nv50_clear_depth_stencil(struct pipe_context *pipe,
struct nouveau_bo *bo = mt->base.bo;
uint32_t mode = 0;
+ assert(nouveau_bo_tile_layout(bo)); /* ZETA cannot be linear */
+
if (clear_flags & PIPE_CLEAR_DEPTH) {
BEGIN_RING(chan, RING_3D(CLEAR_DEPTH), 1);
OUT_RINGf (chan, depth);