summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-11-15 23:24:56 +0100
committerMarek Olšák <[email protected]>2017-11-25 17:17:52 +0100
commit43abaf2ad0c1c42e56e47732395cc98912a050e8 (patch)
treeed29562b5efc2979815b1179aee0d566d175e1e9 /src/mesa
parent2116b974189b4d58d02bc1c9810aef820eed71b6 (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')
-rw-r--r--src/mesa/drivers/dri/r200/r200_maos_arrays.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c5
-rw-r--r--src/mesa/main/arrayobj.c3
-rw-r--r--src/mesa/main/context.c1
-rw-r--r--src/mesa/program/prog_print.c1
-rw-r--r--src/mesa/program/program_lexer.l1
-rw-r--r--src/mesa/program/program_parse.y29
-rw-r--r--src/mesa/tnl/t_context.h3
-rw-r--r--src/mesa/vbo/vbo_attrib.h1
9 files changed, 24 insertions, 24 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
index 60f851be56c..a3d45cf7369 100644
--- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c
+++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
@@ -102,9 +102,7 @@ void r200EmitArrays( struct gl_context *ctx, GLubyte *vimap_rev )
}
break;
case 1:
- assert(attrib == VERT_ATTRIB_WEIGHT);
- emitsize = (VB->AttribPtr[attrib]->size);
- vfmt0 |= emitsize << R200_VTX_WEIGHT_COUNT_SHIFT;
+ unreachable("r200: vertex weight attrib unsupported");
break;
case 2:
assert(attrib == VERT_ATTRIB_NORMAL);
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index bb8550332b3..c3606b50ff0 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -498,11 +498,6 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2
free_inputs &= ~(1 << 0);
array_count++;
}
- if (mesa_vp->info.inputs_read & VERT_BIT_WEIGHT) {
- vp->inputs[VERT_ATTRIB_WEIGHT] = 12;
- vp->inputmap_rev[1] = VERT_ATTRIB_WEIGHT;
- array_count++;
- }
if (mesa_vp->info.inputs_read & VERT_BIT_NORMAL) {
vp->inputs[VERT_ATTRIB_NORMAL] = 1;
vp->inputmap_rev[2] = VERT_ATTRIB_NORMAL;
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 88a5702f412..18d6d8008c1 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -277,9 +277,6 @@ _mesa_initialize_vao(struct gl_context *ctx,
/* Init the individual arrays */
for (i = 0; i < ARRAY_SIZE(vao->VertexAttrib); i++) {
switch (i) {
- case VERT_ATTRIB_WEIGHT:
- init_array(ctx, vao, VERT_ATTRIB_WEIGHT, 1, GL_FLOAT);
- break;
case VERT_ATTRIB_NORMAL:
init_array(ctx, vao, VERT_ATTRIB_NORMAL, 3, GL_FLOAT);
break;
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 25dd59ae2c1..3fa9f69f883 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -436,7 +436,6 @@ _mesa_init_current(struct gl_context *ctx)
}
/* redo special cases: */
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 0.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 1.0 );
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;
}
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h
index 67a87f26af5..ced2857fc97 100644
--- a/src/mesa/tnl/t_context.h
+++ b/src/mesa/tnl/t_context.h
@@ -77,7 +77,6 @@
*/
enum {
_TNL_ATTRIB_POS,
- _TNL_ATTRIB_WEIGHT,
_TNL_ATTRIB_NORMAL,
_TNL_ATTRIB_COLOR0,
_TNL_ATTRIB_COLOR1,
@@ -150,7 +149,7 @@ enum {
/**
* Handy attribute ranges:
*/
-#define _TNL_FIRST_PROG _TNL_ATTRIB_WEIGHT
+#define _TNL_FIRST_PROG _TNL_ATTRIB_NORMAL
#define _TNL_LAST_PROG _TNL_ATTRIB_TEX7
#define _TNL_FIRST_TEX _TNL_ATTRIB_TEX0
diff --git a/src/mesa/vbo/vbo_attrib.h b/src/mesa/vbo/vbo_attrib.h
index 560c82623ba..f4a3a66cfbf 100644
--- a/src/mesa/vbo/vbo_attrib.h
+++ b/src/mesa/vbo/vbo_attrib.h
@@ -45,7 +45,6 @@
*/
enum {
VBO_ATTRIB_POS,
- VBO_ATTRIB_WEIGHT,
VBO_ATTRIB_NORMAL,
VBO_ATTRIB_COLOR0,
VBO_ATTRIB_COLOR1,