Module: Mesa Branch: asm-shader-rework-3 Commit: e90c9152e516bd7d3981192e120b54a206cc8d35 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e90c9152e516bd7d3981192e120b54a206cc8d35
Author: Ian Romanick <[email protected]> Date: Wed Sep 30 21:37:51 2009 -0700 NV vp3: Add tracking for GL_NV_vertex_program3 The last bit of NV_vp2 (i.e., clip distance) isn't finished yet, but NV_vp3 is a pretty small addition. --- src/mesa/main/extensions.c | 1 + src/mesa/main/mtypes.h | 1 + src/mesa/shader/program_parse_extra.c | 25 ++++++++++++++++++++++--- src/mesa/shader/program_parser.h | 1 + 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index a250395..d6b6002 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -176,6 +176,7 @@ static const struct { { OFF, "GL_NV_vertex_program", F(NV_vertex_program) }, { OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) }, { OFF, "GL_NV_vertex_program2_option", F(NV_vertex_program2_option) }, + { OFF, "GL_NV_vertex_program3", F(NV_vertex_program3) }, { ON, "GL_OES_read_format", F(OES_read_format) }, { OFF, "GL_SGI_color_matrix", F(SGI_color_matrix) }, { OFF, "GL_SGI_color_table", F(SGI_color_table) }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 92a1567..9f78116 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2617,6 +2617,7 @@ struct gl_extensions GLboolean NV_vertex_program; GLboolean NV_vertex_program1_1; GLboolean NV_vertex_program2_option; + GLboolean NV_vertex_program3; GLboolean OES_read_format; GLboolean SGI_color_matrix; GLboolean SGI_color_table; diff --git a/src/mesa/shader/program_parse_extra.c b/src/mesa/shader/program_parse_extra.c index d432cb2..ae9c680 100644 --- a/src/mesa/shader/program_parse_extra.c +++ b/src/mesa/shader/program_parse_extra.c @@ -151,9 +151,22 @@ _mesa_parse_cc(const char *s) int _mesa_ARBvp_parse_option(struct asm_parser_state *state, const char *option) { - if (strcmp(option, "ARB_position_invariant") == 0) { - state->option.PositionInvariant = 1; - return 1; + if (strncmp(option, "ARB_", 4) == 0) { + /* Advance the pointer past the "ARB_" prefix. + */ + option += 4; + + if (strcmp(option, "position_invariant") == 0) { + state->option.PositionInvariant = 1; + return 1; + } else if (strcmp(option, "fragment_program_shadow") == 0) { + if (state->ctx->Extensions.ARB_fragment_program_shadow + && state->ctx->Extensions.NV_vertex_program3 + && state->option.NV_vertex3) { + state->option.Shadow = 1; + return 1; + } + } } else if (strncmp(option, "NV_vertex_program", 17) == 0) { option += 17; @@ -164,6 +177,12 @@ _mesa_ARBvp_parse_option(struct asm_parser_state *state, const char *option) state->option.NV_vertex2 = 1; return 1; } + } else if ((option[0] == '3') && (option[1] == '\0')) { + if (state->ctx->Extensions.NV_vertex_program3) { + state->option.NV_vertex2 = 1; + state->option.NV_vertex3 = 1; + return 1; + } } } diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index 8d86333..023a19c 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -216,6 +216,7 @@ struct asm_parser_state { unsigned TexArray:1; unsigned NV_fragment:1; unsigned NV_vertex2:1; + unsigned NV_vertex3:1; } option; struct { _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
