* \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,
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;
set_vertex_attribs(st, &vbuffer, vpv->num_inputs ? 1 : 0,
velements, vpv->num_inputs);
- return TRUE;
}
/**
* \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,
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;
}
set_vertex_attribs(st, vbuffer, num_vbuffers, velements, vpv->num_inputs);
- return TRUE;
}
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);
}