OSDN Git Service

meta: Handle array textures in scaled MSAA blits
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 22 Sep 2015 21:42:32 +0000 (14:42 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 7 Oct 2015 13:47:23 +0000 (14:47 +0100)
commitd0684f3d588145173caff50a898194ae9ba94b29
treef0a39f8428df7abc8dce279720ef16971a14b8fb
parent7d78578b0663ae726a89c7147229aad8314eaf4d
meta: Handle array textures in scaled MSAA blits

The old code had some significant problems with respect to
sampler2DArray textures.  The biggest problem was that some of the code
would use vec3 for the texture coordinate type, and other parts of the
code would use vec2.  The resulting shader would not even compile.
Since there were not tests for this path, nobody noticed.

The input to the fragment shader is always treated as a vec3.  If the
source data is only vec2, the vertex puller will supply 0 for the .z
component.  The texture coordinate passed to the fragment shader is
always a vec2 that comes from the .xy part of the vertex shader input.
The layer, taken from the .z of the vertex shader input is passed
separately as a flat integer.  If the generated fragment shader does not
use the layer integer, the GLSL linker will eliminate all the dead code
in the vertex shader.

Fixes the new piglit tests "blit-scaled samples=2 with
gl_texture_2d_multisample_array", etc. on i965.

Note for stable maintainer: This patch may depend on 46037237, and that
patch should be safe for stable.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9bd9cf1fa402bf948020ee5d560259a5cfd2a739)
src/mesa/drivers/common/meta_blit.c