diff options
author | Luca Barbieri <luca@luca-barbieri.com> | 2010-01-20 22:38:39 -0800 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-01-21 09:41:28 -0700 |
commit | e59353f592ef587d34279f0735f06053e289a7b4 (patch) | |
tree | a7c79166431453e19a7dee0bb17c5e19d2a4146b /src/mesa/shader | |
parent | 1ca22855119508457b2cbd9a0a3b840e47a61eff (diff) | |
download | external_mesa3d-e59353f592ef587d34279f0735f06053e289a7b4.zip external_mesa3d-e59353f592ef587d34279f0735f06053e289a7b4.tar.gz external_mesa3d-e59353f592ef587d34279f0735f06053e289a7b4.tar.bz2 |
mesa: support for GL_ARB_fragment_coord_conventions
Signed-off-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/arbprogparse.c | 2 | ||||
-rw-r--r-- | src/mesa/shader/program_parse_extra.c | 12 | ||||
-rw-r--r-- | src/mesa/shader/program_parser.h | 2 |
3 files changed, 16 insertions, 0 deletions
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 { |