diff options
author | Jason Ekstrand <[email protected]> | 2016-06-08 19:56:46 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-06-08 21:57:57 -0700 |
commit | 037ce5d7343829a69ec9c7361a0964bc1366b019 (patch) | |
tree | 1363226b7b6888c47cac918a5547e1a408ee73ef /src/mesa | |
parent | dc81b3ad43dde0815baf957e7cf4c633d6f350f8 (diff) |
i965: Emit surface states for extra planes prior to gen8
When Kristian implemented GL_TEXTURE_EXTERNAL_OES, he hooked it up for gen8
but not for gen7 or earlier. It all works, we just need to emit the states
for the extra planes.
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Cc: "12.0" <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 9 |
2 files changed, 18 insertions, 0 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 b73d5d5976a..133a944f767 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -338,6 +338,15 @@ brw_update_texture_surface(struct gl_context *ctx, uint32_t tex_format = translate_tex_format(brw, mt->format, sampler->sRGBDecode); + if (tObj->Target == GL_TEXTURE_EXTERNAL_OES) { + if (plane > 0) + mt = mt->plane[plane - 1]; + if (mt == NULL) + return; + + tex_format = translate_tex_format(brw, mt->format, sampler->sRGBDecode); + } + if (for_gather) { /* Sandybridge's gather4 message is broken for integer formats. * To work around this, we pretend the surface is UNORM for diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c index 329164d86e1..60589bc00fe 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c @@ -386,6 +386,15 @@ gen7_update_texture_surface(struct gl_context *ctx, unsigned format = translate_tex_format( brw, intel_obj->_Format, sampler->sRGBDecode); + if (obj->Target == GL_TEXTURE_EXTERNAL_OES) { + if (plane > 0) + mt = mt->plane[plane - 1]; + if (mt == NULL) + return; + + format = translate_tex_format(brw, mt->format, sampler->sRGBDecode); + } + if (for_gather && format == BRW_SURFACEFORMAT_R32G32_FLOAT) format = BRW_SURFACEFORMAT_R32G32_FLOAT_LD; |