---
 src/mesa/main/extensions.c            |    1 +
 src/mesa/main/mtypes.h                |    3 +++
 src/mesa/shader/arbprogparse.c        |    2 ++
 src/mesa/shader/program_parse_extra.c |   12 ++++++++++++
 src/mesa/shader/program_parser.h      |    2 ++
 5 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index cd3311e..f8e18e1 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -50,6 +50,7 @@ static const struct {
    { OFF, "GL_ARB_depth_clamp",                F(ARB_depth_clamp) },
    { ON,  "GL_ARB_draw_buffers",               F(ARB_draw_buffers) },
    { OFF, "GL_ARB_draw_elements_base_vertex",  
F(ARB_draw_elements_base_vertex) },
+   { OFF, "GL_ARB_fragment_coord_conventions",    
F(ARB_fragment_coord_conventions) },
    { OFF, "GL_ARB_fragment_program",           F(ARB_fragment_program) },
    { OFF, "GL_ARB_fragment_program_shadow",    F(ARB_fragment_program_shadow) 
},
    { OFF, "GL_ARB_fragment_shader",            F(ARB_fragment_shader) },
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 6b775e4..f81131b 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1762,6 +1762,8 @@ struct gl_fragment_program
    struct gl_program Base;   /**< base class */
    GLenum FogOption;
    GLboolean UsesKill;          /**< shader uses KIL instruction */
+   GLboolean OriginUpperLeft;
+   GLboolean PixelCenterInteger;
 };
 
 
@@ -2395,6 +2397,7 @@ struct gl_extensions
    GLboolean ARB_depth_clamp;
    GLboolean ARB_draw_buffers;
    GLboolean ARB_draw_elements_base_vertex;
+   GLboolean ARB_fragment_coord_conventions;
    GLboolean ARB_fragment_program;
    GLboolean ARB_fragment_program_shadow;
    GLboolean ARB_fragment_shader;
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index a09be71..3e22a8a 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -123,6 +123,8 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum 
target,
    case OPTION_FOG_LINEAR: program->FogOption = GL_LINEAR; break;
    default:                program->FogOption = GL_NONE;   break;
    }
+   program->OriginUpperLeft = state.option.OriginUpperLeft;
+   program->PixelCenterInteger = state.option.PixelCenterInteger;
 
    program->UsesKill            = state.fragment.UsesKill;
 
diff --git a/src/mesa/shader/program_parse_extra.c 
b/src/mesa/shader/program_parse_extra.c
index 0656c5e..ae98b78 100644
--- a/src/mesa/shader/program_parse_extra.c
+++ b/src/mesa/shader/program_parse_extra.c
@@ -216,6 +216,18 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, 
const char *option)
            state->option.Shadow = 1;
            return 1;
         }
+      } else if (strncmp(option, "fragment_coord_", 15) == 0) {
+         option += 15;
+         if (state->ctx->Extensions.ARB_fragment_coord_conventions) {
+            if (strcmp(option, "origin_upper_left") == 0) {
+               state->option.OriginUpperLeft = 1;
+               return 1;
+            }
+            else if (strcmp(option, "pixel_center_integer") == 0) {
+               state->option.PixelCenterInteger = 1;
+               return 1;
+            }
+         }
       }
    } else if (strncmp(option, "NV_fragment_program", 19) == 0) {
       option += 19;
diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h
index 69396ca..730466c 100644
--- a/src/mesa/shader/program_parser.h
+++ b/src/mesa/shader/program_parser.h
@@ -209,6 +209,8 @@ struct asm_parser_state {
       unsigned TexRect:1;
       unsigned TexArray:1;
       unsigned NV_fragment:1;
+      unsigned OriginUpperLeft:1;
+      unsigned PixelCenterInteger:1;
    } option;
 
    struct {
-- 
1.6.3.3


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to