<p dir="ltr">Nice! Both are</p>
<p dir="ltr">Reviewed-by: Chris Forbes <<a href="mailto:chrisf@ijw.co.nz">chrisf@ijw.co.nz</a>></p>
<div class="gmail_quote">On Jan 1, 2015 5:04 PM, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Gen7.5+ platforms that support the "Shader Channel Select" feature leave<br>
key->tex.swizzles[i] as SWIZZLE_NOOP except when GL_DEPTH_TEXTURE_MODE<br>
is GL_ALPHA (which is really uncommon). So, the precompile should leave<br>
them as SWIZZLE_NOOP (aka SWIZZLE_XYZW) as well.<br>
<br>
We didn't notice this because prog->ShadowSamplers is not set correctly.<br>
The next patch will fix that problem.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=87886" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=87886</a><br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_fs.cpp | 3 ++-<br>
src/mesa/drivers/dri/i965/brw_vec4.cpp | 4 +++-<br>
2 files changed, 5 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
index 78c068f..fa1ca8c 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
@@ -3912,9 +3912,10 @@ brw_fs_precompile(struct gl_context *ctx,<br>
BRW_FS_VARYING_INPUT_MASK) > 16)<br>
key.input_slots_valid = fp->Base.InputsRead | VARYING_BIT_POS;<br>
<br>
+ const bool has_shader_channel_select = brw->is_haswell || brw->gen >= 8;<br>
unsigned sampler_count = _mesa_fls(fp->Base.SamplersUsed);<br>
for (unsigned i = 0; i < sampler_count; i++) {<br>
- if (fp->Base.ShadowSamplers & (1 << i)) {<br>
+ if (!has_shader_channel_select && (fp->Base.ShadowSamplers & (1 << i))) {<br>
/* Assume DEPTH_TEXTURE_MODE is the default: X, X, X, 1 */<br>
key.tex.swizzles[i] =<br>
MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_ONE);<br>
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp<br>
index f389392..b1a2a53 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp<br>
@@ -1945,11 +1945,13 @@ brw_vue_setup_prog_key_for_precompile(struct gl_context *ctx,<br>
struct brw_vue_prog_key *key,<br>
GLuint id, struct gl_program *prog)<br>
{<br>
+ struct brw_context *brw = brw_context(ctx);<br>
key->program_string_id = id;<br>
<br>
+ const bool has_shader_channel_select = brw->is_haswell || brw->gen >= 8;<br>
unsigned sampler_count = _mesa_fls(prog->SamplersUsed);<br>
for (unsigned i = 0; i < sampler_count; i++) {<br>
- if (prog->ShadowSamplers & (1 << i)) {<br>
+ if (!has_shader_channel_select && (prog->ShadowSamplers & (1 << i))) {<br>
/* Assume DEPTH_TEXTURE_MODE is the default: X, X, X, 1 */<br>
key->tex.swizzles[i] =<br>
MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_ONE);<br>
--<br>
2.2.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>