i965: Emit surface states for extra planes prior to gen8
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 9 Jun 2016 02:56:46 +0000 (19:56 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 9 Jun 2016 04:57:57 +0000 (21:57 -0700)
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 <jason@jlekstrand.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c

index b73d5d5976ad4a91cbaa862c9d7761544952d55c..133a944f767f7ad3f76037b59a0b5ebec4e598d4 100644 (file)
@@ -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
index 329164d86e1eaf619bf6def1bdc8b8d0b30f8461..60589bc00feae93869ea690b566e337994237958 100644 (file)
@@ -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;