mesa: glsl: check for rect tex samplers
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 18:21:25 +0000 (12:21 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 18:21:25 +0000 (12:21 -0600)
src/mesa/shader/slang/slang_codegen.c

index e36b689b70427b15807806c84d804f4482b072f0..9c17dceb191be5ee7b603d045d82700674f6b388 100644 (file)
@@ -3635,7 +3635,15 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
          slang_info_log_error(A->log, "illegal assignment to '%s'", varName);
          return GL_FALSE;
       }
-      else {
+#if FEATURE_es2_glsl /* XXX should use FEATURE_texture_rect */
+      /* disallow rect samplers */
+      if (var->type.specifier.type == SLANG_SPEC_SAMPLER2DRECT ||
+          var->type.specifier.type == SLANG_SPEC_SAMPLER2DRECTSHADOW) {
+         slang_info_log_error(A->log, "invalid sampler type for '%s'", varName);
+         return GL_FALSE;
+      }
+#endif
+      {
          GLint sampNum = _mesa_add_sampler(prog->Parameters, varName, datatype);
          store = _slang_new_ir_storage(PROGRAM_SAMPLER, sampNum, texIndex);
       }