aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-08-30 15:35:17 +0200
committermarha <marha@users.sourceforge.net>2013-08-30 15:35:17 +0200
commit5ebbc3a366287b631775ed3e17537580d380db8a (patch)
treef43c3d54e7c0e161c83288d83b22cbd7da49cc96 /mesalib/src/glsl/ast_to_hir.cpp
parent84e570d071a041f85e2e8b92963d3390d14af5fc (diff)
downloadvcxsrv-5ebbc3a366287b631775ed3e17537580d380db8a.tar.gz
vcxsrv-5ebbc3a366287b631775ed3e17537580d380db8a.tar.bz2
vcxsrv-5ebbc3a366287b631775ed3e17537580d380db8a.zip
fontconfig mesa xserver xkeyboard-config xkbcomp git update 30 aug 2013
xserver commit 94d4e29aedc69431fa9b299ca1b67947173d7a24 xkeyboard-config commit fcb91cb1013cbdd87a6f77533f188d5934f24046 xkbcomp commit 24d18e0a844041ef82441adb16aa18cc4b4814ae fontconfig commit 071ce44c35733e54cb477cc75810cbe55025b619 mesa commit f7217b99f243738f941a5d009c68387dfadcb50a
Diffstat (limited to 'mesalib/src/glsl/ast_to_hir.cpp')
-rw-r--r--mesalib/src/glsl/ast_to_hir.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp
index 192130a99..52059e4bf 100644
--- a/mesalib/src/glsl/ast_to_hir.cpp
+++ b/mesalib/src/glsl/ast_to_hir.cpp
@@ -3132,32 +3132,45 @@ ast_declarator_list::hir(exec_list *instructions,
}
- /* Precision qualifiers only apply to floating point and integer types.
+ /* Precision qualifiers apply to floating point, integer and sampler
+ * types.
*
- * From section 4.5.2 of the GLSL 1.30 spec:
+ * Section 4.5.2 (Precision Qualifiers) of the GLSL 1.30 spec says:
* "Any floating point or any integer declaration can have the type
* preceded by one of these precision qualifiers [...] Literal
* constants do not have precision qualifiers. Neither do Boolean
* variables.
*
- * In GLSL ES, sampler types are also allowed.
+ * Section 4.5 (Precision and Precision Qualifiers) of the GLSL 1.30
+ * spec also says:
*
- * From page 87 of the GLSL ES spec:
- * "RESOLUTION: Allow sampler types to take a precision qualifier."
+ * "Precision qualifiers are added for code portability with OpenGL
+ * ES, not for functionality. They have the same syntax as in OpenGL
+ * ES."
+ *
+ * Section 8 (Built-In Functions) of the GLSL ES 1.00 spec says:
+ *
+ * "uniform lowp sampler2D sampler;
+ * highp vec2 coord;
+ * ...
+ * lowp vec4 col = texture2D (sampler, coord);
+ * // texture2D returns lowp"
+ *
+ * From this, we infer that GLSL 1.30 (and later) should allow precision
+ * qualifiers on sampler types just like float and integer types.
*/
if (this->type->qualifier.precision != ast_precision_none
&& !var->type->is_float()
&& !var->type->is_integer()
&& !var->type->is_record()
- && !(var->type->is_sampler() && state->es_shader)
+ && !var->type->is_sampler()
&& !(var->type->is_array()
&& (var->type->fields.array->is_float()
|| var->type->fields.array->is_integer()))) {
_mesa_glsl_error(&loc, state,
"precision qualifiers apply only to floating point"
- "%s types", state->es_shader ? ", integer, and sampler"
- : "and integer");
+ ", integer and sampler types");
}
/* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec: