[Mesa-dev] [PATCH] i965/skl: Don't try to apply the opt_sampler_eot extension for vs

Kenneth Graunke kenneth at whitecape.org
Tue Apr 28 15:44:40 PDT 2015


On Tuesday, April 28, 2015 02:27:17 PM Neil Roberts wrote:
> The opt_sampler_eot optimisation of fs_visitor effectively assumes
> that it is running on a fragment shader because it casts the program
> key to a brw_wm_prog_key. However on Skylake fs_visitor can also be
> used for vertex shaders. It looks like this usually works anyway
> because the optimisation is skipped if key->nr_color_regions != 1.
> However for a vertex shader the key is actually a brw_vs_prog_key so
> the space for nr_color_regions is probably taken up by
> key->base.program_string_id. This can end up making nr_color_regions
> be 1 in which case the function will later assert when the last
> instruction is not FS_OPCODE_FB_WRITE. This was making the DEQP test
> suite assert. Presumably this only happens there because that compiles
> a lot of shaders so it would end up with a high value for
> program_string_id.
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 61ee056..255ddf4 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -2548,6 +2548,9 @@ fs_visitor::opt_sampler_eot()
>  {
>     brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
>  
> +   if (stage != MESA_SHADER_FRAGMENT)
> +      return false;
> +
>     if (devinfo->gen < 9 && !devinfo->is_cherryview)
>        return false;
>  
> 

Good catch.

I'd remove "skl" from the subject line - this isn't platform specific
breakage (the optimization breaks VS on all platforms where it runs,
such as Cherryview).

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150428/4e53a590/attachment.sig>


More information about the mesa-dev mailing list