unsigned num_elements;
uint8_t attrs[16 * VC5_MAX_ATTRIBUTES];
- struct v3d_bo *default_attribute_values;
+ struct pipe_resource *defaults;
+ uint32_t defaults_offset;
};
struct v3d_streamout_stateobj {
v3d->prog.vs->prog_data.vs->uses_iid;
shader.address_of_default_attribute_values =
- cl_address(vtx->default_attribute_values, 0);
+ cl_address(v3d_resource(vtx->defaults)->bo,
+ vtx->defaults_offset);
}
for (int i = 0; i < vtx->num_elements; i++) {
#include "util/u_memory.h"
#include "util/u_half.h"
#include "util/u_helpers.h"
+#include "util/u_upload_mgr.h"
#include "v3d_context.h"
#include "v3d_tiling.h"
/* Set up the default attribute values in case any of the vertex
* elements use them.
*/
- so->default_attribute_values = v3d_bo_alloc(v3d->screen,
- VC5_MAX_ATTRIBUTES *
- 4 * sizeof(float),
- "default_attributes");
- uint32_t *attrs = v3d_bo_map(so->default_attribute_values);
+ uint32_t *attrs;
+ u_upload_alloc(v3d->state_uploader, 0,
+ VC5_MAX_ATTRIBUTES * 4 * sizeof(float), 16,
+ &so->defaults_offset, &so->defaults, (void **)&attrs);
+
for (int i = 0; i < VC5_MAX_ATTRIBUTES; i++) {
attrs[i * 4 + 0] = 0;
attrs[i * 4 + 1] = 0;
}
}
+ u_upload_unmap(v3d->state_uploader);
return so;
}
{
struct v3d_vertex_stateobj *so = hwcso;
- v3d_bo_unreference(&so->default_attribute_values);
+ pipe_resource_reference(&so->defaults, NULL);
free(so);
}