diff options
author | Marek Olšák <[email protected]> | 2017-04-30 14:57:35 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-05-10 19:29:08 +0200 |
commit | 9db1f9bcd1acc3a6ee0b2246aaa60e1edef52614 (patch) | |
tree | 7bc665210d12750221983a9eaf643891c22d22c4 /src | |
parent | e8b22745929610508565f9bc18f526f49a629563 (diff) |
st/mesa: simplify the signature of get_client_array
Tested-by: Edmondo Tommasina <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_atom_array.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c index f8734608440..cc9cac1b336 100644 --- a/src/mesa/state_tracker/st_atom_array.c +++ b/src/mesa/state_tracker/st_atom_array.c @@ -300,11 +300,9 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, } static const struct gl_vertex_array * -get_client_array(const struct st_vertex_program *vp, - const struct gl_vertex_array **arrays, - int attr) +get_client_array(const struct gl_vertex_array **arrays, + unsigned mesaAttr) { - const GLuint mesaAttr = vp->index_to_input[attr]; /* st_program uses 0xffffffff to denote a double placeholder attribute */ if (mesaAttr == ST_DOUBLE_ATTRIB_PLACEHOLDER) return NULL; @@ -331,7 +329,7 @@ is_interleaved_arrays(const struct st_vertex_program *vp, const struct gl_buffer_object *bufObj; GLsizei stride; - array = get_client_array(vp, arrays, attr); + array = get_client_array(arrays, vp->index_to_input[attr]); if (!array) continue; @@ -467,7 +465,7 @@ setup_interleaved_attribs(struct st_context *st, if (num_inputs) { const struct gl_vertex_array *array; - array = get_client_array(vp, arrays, 0); + array = get_client_array(arrays, vp->index_to_input[0]); assert(array); /* Since we're doing interleaved arrays, we know there'll be at most @@ -481,7 +479,7 @@ setup_interleaved_attribs(struct st_context *st, for (attr = 1; attr < num_inputs; attr++) { const GLubyte *start; - array = get_client_array(vp, arrays, attr); + array = get_client_array(arrays, vp->index_to_input[attr]); if (!array) continue; start = array->Ptr; @@ -503,7 +501,7 @@ setup_interleaved_attribs(struct st_context *st, unsigned src_offset; unsigned src_format; - array = get_client_array(vp, arrays, attr); + array = get_client_array(arrays, vp->index_to_input[attr]); assert(array); src_offset = (unsigned) (array->Ptr - low_addr); @@ -576,14 +574,14 @@ setup_non_interleaved_attribs(struct st_context *st, GLuint attr; for (attr = 0; attr < num_inputs;) { - const GLuint mesaAttr = vp->index_to_input[attr]; + const unsigned mesaAttr = vp->index_to_input[attr]; const struct gl_vertex_array *array; struct gl_buffer_object *bufobj; GLsizei stride; unsigned src_format; unsigned bufidx; - array = get_client_array(vp, arrays, attr); + array = get_client_array(arrays, mesaAttr); assert(array); bufidx = num_vbuffers++; |