diff options
author | Marek Olšák <[email protected]> | 2017-11-15 23:24:56 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-11-25 17:17:52 +0100 |
commit | 43abaf2ad0c1c42e56e47732395cc98912a050e8 (patch) | |
tree | ed29562b5efc2979815b1179aee0d566d175e1e9 /src/mesa/program | |
parent | 2116b974189b4d58d02bc1c9810aef820eed71b6 (diff) |
mesa: remove unused vertex attrib WEIGHT
We don't support ARB_vertex_blend.
Note that the attribute aliasing check for ARB_vertex_program had to be
rewritten.
vbo_context: 20344 -> 20008 bytes
gl_context: 74672 -> 74616 bytes
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/program')
-rw-r--r-- | src/mesa/program/prog_print.c | 1 | ||||
-rw-r--r-- | src/mesa/program/program_lexer.l | 1 | ||||
-rw-r--r-- | src/mesa/program/program_parse.y | 29 |
3 files changed, 22 insertions, 9 deletions
diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c index 4f85d14c41d..9462510f3ad 100644 --- a/src/mesa/program/prog_print.c +++ b/src/mesa/program/prog_print.c @@ -89,7 +89,6 @@ arb_input_attrib_string(GLuint index, GLenum progType) */ static const char *const vertAttribs[] = { "vertex.position", - "vertex.weight", "vertex.normal", "vertex.color.primary", "vertex.color.secondary", diff --git a/src/mesa/program/program_lexer.l b/src/mesa/program/program_lexer.l index dee66cbf30a..2e168b83bdb 100644 --- a/src/mesa/program/program_lexer.l +++ b/src/mesa/program/program_lexer.l @@ -289,7 +289,6 @@ result { return RESULT; } {dot}texture { return TEXTURE; } {dot}transpose { return TRANSPOSE; } {dot}attrib { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } -{dot}weight { return_token_or_DOT(require_ARB_vp, WEIGHT); } texture { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } 1D { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y index f3adea6677c..1bc5f515494 100644 --- a/src/mesa/program/program_parse.y +++ b/src/mesa/program/program_parse.y @@ -186,7 +186,6 @@ static struct asm_instruction *asm_instruction_copy_ctor( %token TEX_SHADOW1D TEX_SHADOW2D TEX_SHADOWRECT %token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D %token VERTEX VTXATTRIB -%token WEIGHT %token <string> IDENTIFIER USED_IDENTIFIER %type <string> string @@ -1007,10 +1006,6 @@ vtxAttribItem: POSITION { $$ = VERT_ATTRIB_POS; } - | WEIGHT vtxOptWeightNum - { - $$ = VERT_ATTRIB_WEIGHT; - } | NORMAL { $$ = VERT_ATTRIB_NORMAL; @@ -1049,7 +1044,6 @@ vtxAttribNum: INTEGER } ; -vtxOptWeightNum: | '[' vtxWeightNum ']'; vtxWeightNum: INTEGER; fragAttribItem: POSITION @@ -2219,8 +2213,29 @@ int validate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state) { const GLbitfield64 inputs = state->prog->info.inputs_read | state->InputsBound; + GLbitfield ff_inputs = 0; - if (((inputs & VERT_BIT_FF_ALL) & (inputs >> VERT_ATTRIB_GENERIC0)) != 0) { + /* Since Mesa internal attribute indices are different from + * how NV_vertex_program defines attribute aliasing, we have to construct + * a separate usage mask based on how the aliasing is defined. + * + * Note that attribute aliasing is optional if NV_vertex_program is + * unsupported. + */ + if (inputs & VERT_BIT_POS) + ff_inputs |= 1 << 0; + if (inputs & VERT_BIT_NORMAL) + ff_inputs |= 1 << 2; + if (inputs & VERT_BIT_COLOR0) + ff_inputs |= 1 << 3; + if (inputs & VERT_BIT_COLOR1) + ff_inputs |= 1 << 4; + if (inputs & VERT_BIT_FOG) + ff_inputs |= 1 << 5; + + ff_inputs |= ((inputs & VERT_BIT_TEX_ALL) >> VERT_ATTRIB_TEX0) << 8; + + if ((ff_inputs & (inputs >> VERT_ATTRIB_GENERIC0)) != 0) { yyerror(locp, state, "illegal use of generic attribute and name attribute"); return 0; } |