<p dir="ltr"><br>
On Jun 8, 2016 9:25 PM, "Kristian Høgsberg" <<a href="mailto:krh@bitplanet.net">krh@bitplanet.net</a>> wrote:<br>
><br>
> On Wed, Jun 8, 2016 at 9:07 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> > When Kristian implemented GL_TEXTURE_EXTERNAL_OES, he hooked it up for gen8<br>
> > but not for gen7 or earlier. It all works, we just need to emit the states<br>
> > for the extra planes.<br>
><br>
> Ah yes, thanks.<br>
><br>
> Reviewed-by: Kristian Høgsberg <<a href="mailto:krh@bitplanet.net">krh@bitplanet.net</a>></p>
<p dir="ltr">Thanks!</p>
<p dir="ltr">> > Cc: "12.0" <<a href="mailto:mesa-stable@list.freedesktop.org">mesa-stable@list.freedesktop.org</a>><br>
> > Cc: Kristian Høgsberg <<a href="mailto:krh@bitplanet.net">krh@bitplanet.net</a>><br>
> > ---<br>
> > src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 9 +++++++++<br>
> > src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 9 +++++++++<br>
> > 2 files changed, 18 insertions(+)<br>
> ><br>
> > diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> > index b73d5d5..133a944 100644<br>
> > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> > @@ -338,6 +338,15 @@ brw_update_texture_surface(struct gl_context *ctx,<br>
> > uint32_t tex_format = translate_tex_format(brw, mt->format,<br>
> > sampler->sRGBDecode);<br>
> ><br>
> > + if (tObj->Target == GL_TEXTURE_EXTERNAL_OES) {<br>
> > + if (plane > 0)<br>
> > + mt = mt->plane[plane - 1];<br>
> > + if (mt == NULL)<br>
> > + return;<br>
> > +<br>
> > + tex_format = translate_tex_format(brw, mt->format, sampler->sRGBDecode);<br>
> > + }<br>
> > +<br>
> > if (for_gather) {<br>
> > /* Sandybridge's gather4 message is broken for integer formats.<br>
> > * To work around this, we pretend the surface is UNORM for<br>
> > diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c<br>
> > index 329164d..60589bc 100644<br>
> > --- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c<br>
> > +++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c<br>
> > @@ -386,6 +386,15 @@ gen7_update_texture_surface(struct gl_context *ctx,<br>
> > unsigned format = translate_tex_format(<br>
> > brw, intel_obj->_Format, sampler->sRGBDecode);<br>
> ><br>
> > + if (obj->Target == GL_TEXTURE_EXTERNAL_OES) {<br>
> > + if (plane > 0)<br>
> > + mt = mt->plane[plane - 1];<br>
> > + if (mt == NULL)<br>
> > + return;<br>
> > +<br>
> > + format = translate_tex_format(brw, mt->format, sampler->sRGBDecode);<br>
> > + }<br>
> > +<br>
> > if (for_gather && format == BRW_SURFACEFORMAT_R32G32_FLOAT)<br>
> > format = BRW_SURFACEFORMAT_R32G32_FLOAT_LD;<br>
> ><br>
> > --<br>
> > 2.5.0.400.gff86faf<br>
> ><br>
</p>