[Mesa-dev] [PATCH 19/26] glsl: Make {Min, Max}ProgramTexelOffset available to compiler.

Ian Romanick idr at freedesktop.org
Fri Nov 30 10:07:34 PST 2012


From: Paul Berry <stereotype441 at gmail.com>

These constants need to be made available to shaders in GLSL 3.00 ES.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/glsl_parser_extras.cpp | 2 ++
 src/glsl/glsl_parser_extras.h   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 2d356cf..80f15a6 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -92,6 +92,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
    this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits;
    this->Const.MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
    this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
+   this->Const.MinProgramTexelOffset = ctx->Const.MinProgramTexelOffset;
+   this->Const.MaxProgramTexelOffset = ctx->Const.MaxProgramTexelOffset;
 
    this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
 
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 210f262..1246dd2 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -190,6 +190,10 @@ struct _mesa_glsl_parse_state {
 
       /* ARB_draw_buffers */
       unsigned MaxDrawBuffers;
+
+      /* 3.00 ES */
+      int MinProgramTexelOffset;
+      int MaxProgramTexelOffset;
    } Const;
 
    /**
-- 
1.7.11.7



More information about the mesa-dev mailing list