<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 11, 2017 at 12:15 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Drivers that use Meta are happily using blitting data using texelFetch<br>
and GL_SKIP_DECODE_EXT, but the GL_EXT_texture_sRGB spec unfortunately<br>
makes GL_SKIP_DECODE_EXT not necessarily work with texelFetch.<br>
<br>
As a hack, just unset the texture_used_by_txf bitfield so we can<br>
continue with the old desired behavior.<br>
---<br>
src/mesa/drivers/common/meta.c | 12 ++++++++++++<br>
1 file changed, 12 insertions(+)<br>
<br>
diff --git a/src/mesa/drivers/common/<wbr>meta.c b/src/mesa/drivers/common/<wbr>meta.c<br>
index 73143842485..658a62885bd 100644<br>
--- a/src/mesa/drivers/common/<wbr>meta.c<br>
+++ b/src/mesa/drivers/common/<wbr>meta.c<br>
@@ -87,6 +87,7 @@<br>
#include "main/glformats.h"<br>
#include "util/bitscan.h"<br>
#include "util/ralloc.h"<br>
+#include "compiler/nir/nir.h"<br>
<br>
/** Return offset in bytes of the field within a vertex struct */<br>
#define OFFSET(FIELD) ((void *) offsetof(struct vertex, FIELD))<br>
@@ -195,6 +196,17 @@ _mesa_meta_compile_and_link_<wbr>program(struct gl_context *ctx,<br>
<br>
_mesa_meta_link_program_with_<wbr>debug(ctx, sh_prog);<br>
<br>
+ struct gl_program *fp =<br>
+ sh_prog->_LinkedShaders[MESA_<wbr>SHADER_FRAGMENT]->Program;<br>
+<br>
+ /* texelFetch() can break GL_SKIP_DECODE_EXT, but many meta passes want<br>
+ * to use both together; pretend that we're not using texelFetch to hack<br>
+ * around this bad interaction.<br>
+ */<br>
+ fp->info.textures_used_by_txf = 0;<br>
+ if (fp->nir)<br>
+ fp->nir->info.textures_used_<wbr>by_txf = 0;<br>
+<br></blockquote><div><br></div><div>This is garbage but also, it's meta, so I'm not that inclined to care. The biggest problem I see here is that it will break if we ever switching things to run nir_gather_info post-linking. I doubt we will, but it might be worth a small addition to the above comment. With that, all three are</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div></div></div></div>