Mesa (gallium-mesa-7.4): i965: Support drawing to FBO cube faces other than positive X.
Alan Hourihane
alanh at kemper.freedesktop.org
Fri Apr 24 16:23:43 UTC 2009
Module: Mesa
Branch: gallium-mesa-7.4
Commit: c3e7fc394f9590ac35755e722995fd88bbfd11ce
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c3e7fc394f9590ac35755e722995fd88bbfd11ce
Author: Eric Anholt <eric at anholt.net>
Date: Thu Apr 23 09:37:55 2009 -0700
i965: Support drawing to FBO cube faces other than positive X.
Also fixes drawing to 3D texture depth levels.
(cherry picked from commit 8374379572d1c541a804990bc926108360f67c02)
---
src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 3487b85..20889f8 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -310,6 +310,7 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region,
GLubyte color_mask[4];
GLboolean color_blend;
uint32_t tiling;
+ uint32_t draw_offset;
} key;
memset(&key, 0, sizeof(key));
@@ -326,6 +327,7 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region,
key.width = region->pitch; /* XXX: not really! */
key.height = region->height;
key.cpp = region->cpp;
+ key.draw_offset = region->draw_offset; /* cur 3d or cube face offset */
} else {
key.surface_type = BRW_SURFACE_NULL;
key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
@@ -333,6 +335,7 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region,
key.width = 1;
key.height = 1;
key.cpp = 4;
+ key.draw_offset = 0;
}
memcpy(key.color_mask, ctx->Color.ColorMask,
sizeof(key.color_mask));
@@ -354,8 +357,9 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region,
surf.ss0.surface_format = key.surface_format;
surf.ss0.surface_type = key.surface_type;
+ surf.ss1.base_addr = key.draw_offset;
if (region_bo != NULL)
- surf.ss1.base_addr = region_bo->offset; /* reloc */
+ surf.ss1.base_addr += region_bo->offset; /* reloc */
surf.ss2.width = key.width - 1;
surf.ss2.height = key.height - 1;
@@ -380,12 +384,12 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region,
* them both. We might be able to figure out from other state
* a more restrictive relocation to emit.
*/
- dri_bo_emit_reloc(brw->wm.surf_bo[unit],
- I915_GEM_DOMAIN_RENDER,
- I915_GEM_DOMAIN_RENDER,
- 0,
- offsetof(struct brw_surface_state, ss1),
- region_bo);
+ drm_intel_bo_emit_reloc(brw->wm.surf_bo[unit],
+ offsetof(struct brw_surface_state, ss1),
+ region_bo,
+ key.draw_offset,
+ I915_GEM_DOMAIN_RENDER,
+ I915_GEM_DOMAIN_RENDER);
}
}
}
More information about the mesa-commit
mailing list