OSDN Git Service

glsl: Allow precision qualifiers for sampler types
authorAnuj Phogat <anuj.phogat@gmail.com>
Tue, 27 Aug 2013 01:21:03 +0000 (18:21 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Thu, 29 Aug 2013 19:10:57 +0000 (12:10 -0700)
commit9c0b7be964f0cbb707ed11c2526a30eda5254d2e
treef5645d5f31abcce485bd5963d70642439fa0ba40
parent1ecfdba98a346c8bb05ad9403e3a6412574215f4
glsl: Allow precision qualifiers for sampler types

GLSL 1.30 doesn't allow precision qualifiers on sampler types,
but in GLSL ES, sampler types are also allowed. This seems like
an oversight (since the intention of including these in GLSL 1.30
is to allow compatibility with ES shaders).

Currently, Mesa allows "default" precision qualifiers to be set for
sampler types in GLSL (commit d5948f2). This patch makes it follow
GLSL ES rules and also allow declaring sampler variables with a
precision qualifier in GLSL 1.30 (and later). e.g.
uniform lowp sampler2D sampler;

This fixes a shader compilation error in Khronos OpenGL conformance
test "depth_texture_mipmap".

V2: Update comments.
Signed-off-by: Ian Romanick <idr@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@lists.freedesktop.org>
Cc: <mesa-stable@lists.freedesktop.org>
src/glsl/ast_to_hir.cpp