summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-04-30 14:42:45 +0200
committerMarek Olšák <[email protected]>2017-05-10 19:29:08 +0200
commit71fde4905994083d4a85bf373e81292a842153e0 (patch)
treef9c853b92df72d5b0e7449445ca1c590dd5f9741 /src/mesa/state_tracker
parentf4d272f6f616ea7c064c654cfda718e704e9e2db (diff)
st/mesa: fold error handling into setup_(non_)interleaved_attribs
Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_array.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c
index 522073f205d..db03b20a412 100644
--- a/src/mesa/state_tracker/st_atom_array.c
+++ b/src/mesa/state_tracker/st_atom_array.c
@@ -447,7 +447,7 @@ set_vertex_attribs(struct st_context *st,
* \param vbuffer returns vertex buffer info
* \param velements returns vertex element info
*/
-static boolean
+static void
setup_interleaved_attribs(struct st_context *st,
const struct st_vertex_program *vp,
const struct st_vp_variant *vpv,
@@ -536,7 +536,8 @@ setup_interleaved_attribs(struct st_context *st,
struct st_buffer_object *stobj = st_buffer_object(bufobj);
if (!stobj || !stobj->buffer) {
- return FALSE; /* out-of-memory error probably */
+ st->vertex_array_out_of_memory = true;
+ return; /* out-of-memory error probably */
}
vbuffer.buffer.resource = stobj->buffer;
@@ -554,7 +555,6 @@ setup_interleaved_attribs(struct st_context *st,
set_vertex_attribs(st, &vbuffer, vpv->num_inputs ? 1 : 0,
velements, vpv->num_inputs);
- return TRUE;
}
/**
@@ -563,7 +563,7 @@ setup_interleaved_attribs(struct st_context *st,
* \param vbuffer returns vertex buffer info
* \param velements returns vertex element info
*/
-static boolean
+static void
setup_non_interleaved_attribs(struct st_context *st,
const struct st_vertex_program *vp,
const struct st_vp_variant *vpv,
@@ -601,7 +601,8 @@ setup_non_interleaved_attribs(struct st_context *st,
struct st_buffer_object *stobj = st_buffer_object(bufobj);
if (!stobj || !stobj->buffer) {
- return FALSE; /* out-of-memory error probably */
+ st->vertex_array_out_of_memory = true;
+ return; /* out-of-memory error probably */
}
vbuffer[bufidx].buffer.resource = stobj->buffer;
@@ -643,7 +644,6 @@ setup_non_interleaved_attribs(struct st_context *st,
}
set_vertex_attribs(st, vbuffer, num_vbuffers, velements, vpv->num_inputs);
- return TRUE;
}
void st_update_array(struct st_context *st)
@@ -663,16 +663,8 @@ void st_update_array(struct st_context *st)
vp = st->vp;
vpv = st->vp_variant;
- if (is_interleaved_arrays(vp, vpv, arrays)) {
- if (!setup_interleaved_attribs(st, vp, vpv, arrays)) {
- st->vertex_array_out_of_memory = TRUE;
- return;
- }
- }
- else {
- if (!setup_non_interleaved_attribs(st, vp, vpv, arrays)) {
- st->vertex_array_out_of_memory = TRUE;
- return;
- }
- }
+ if (is_interleaved_arrays(vp, vpv, arrays))
+ setup_interleaved_attribs(st, vp, vpv, arrays);
+ else
+ setup_non_interleaved_attribs(st, vp, vpv, arrays);
}