diff options
author | Jason Ekstrand <[email protected]> | 2014-09-03 13:53:33 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2014-09-05 10:45:27 -0700 |
commit | 7599886b26853163ef354476be70aa7fd9ae35c5 (patch) | |
tree | c9480ad018f5e4bf338ec585e8b3a330e79df807 /src/mesa/drivers/dri/i965/brw_blorp.cpp | |
parent | 87472ae58cf2a5c812630f4eabd485931d243e0c (diff) |
i965/blorp: Pass image formats seperately from the miptree
When a texture is wrapped in a texture view, we can't trust the format in
the miptree itself. This patch allows us to pass the format seperately
through blorp so we can proprerly handled wrapped textures.
It's worth noting here that we can use the miptree format directly for
depth/stencil formats because they cannot be reinterpreted by a texture
view.
Signed-off-by: Jason Ekstrand <[email protected]>
CC: "10.3" <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_blorp.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp index 6b161c9373a..2c00bce1351 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp @@ -78,7 +78,7 @@ void brw_blorp_surface_info::set(struct brw_context *brw, struct intel_mipmap_tree *mt, unsigned int level, unsigned int layer, - bool is_render_target) + mesa_format format, bool is_render_target) { brw_blorp_mip_info::set(mt, level, layer); this->num_samples = mt->num_samples; @@ -86,7 +86,10 @@ brw_blorp_surface_info::set(struct brw_context *brw, this->map_stencil_as_y_tiled = false; this->msaa_layout = mt->msaa_layout; - switch (mt->format) { + if (format == MESA_FORMAT_NONE) + format = mt->format; + + switch (format) { case MESA_FORMAT_S_UINT8: /* The miptree is a W-tiled stencil buffer. Surface states can't be set * up for W tiling, so we'll need to use Y tiling and have the WM @@ -115,7 +118,7 @@ brw_blorp_surface_info::set(struct brw_context *brw, this->brw_surfaceformat = BRW_SURFACEFORMAT_R16_UNORM; break; default: { - mesa_format linear_format = _mesa_get_srgb_format_linear(mt->format); + mesa_format linear_format = _mesa_get_srgb_format_linear(format); if (is_render_target) { assert(brw->format_supported_as_render_target[linear_format]); this->brw_surfaceformat = brw->render_target_format[linear_format]; |