summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/extensions.c1
-rw-r--r--src/mesa/main/mtypes.h3
-rw-r--r--src/mesa/shader/arbprogparse.c2
-rw-r--r--src/mesa/shader/program_parse_extra.c12
-rw-r--r--src/mesa/shader/program_parser.h2
5 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 00427aa580..ac7ff26b50 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 7eff5cadd0..919ddd7a29 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 a09be71020..3e22a8a305 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 0656c5eaa8..ae98b782b7 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 69396ca2c0..730466c30f 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 {