_mesa_shader_write_subroutine_indices(st->ctx, stage);
- /* We always need to get a new buffer, to keep the drivers simple and
- * avoid gratuitous rendering synchronization.
- * Let's use a user buffer to avoid an unnecessary copy.
- */
- if (!st->has_user_constbuf) {
- cb.buffer = NULL;
- cb.user_buffer = NULL;
- u_upload_data(st->pipe->const_uploader, 0, paramBytes,
- st->ctx->Const.UniformBufferOffsetAlignment,
- params->ParameterValues, &cb.buffer_offset, &cb.buffer);
- u_upload_unmap(st->pipe->const_uploader);
- } else {
- cb.buffer = NULL;
- cb.user_buffer = params->ParameterValues;
- cb.buffer_offset = 0;
- }
+ cb.buffer = NULL;
+ cb.user_buffer = params->ParameterValues;
+ cb.buffer_offset = 0;
cb.buffer_size = paramBytes;
if (ST_DEBUG & DEBUG_CONSTANTS) {
st->dirty = ST_ALL_STATES_MASK;
- st->has_user_constbuf =
- screen->get_param(screen, PIPE_CAP_USER_CONSTANT_BUFFERS);
st->can_bind_const_buffer_as_vertex =
screen->get_param(screen, PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX);
boolean has_shareable_shaders;
boolean has_half_float_packing;
boolean has_multi_draw_indirect;
- boolean has_user_constbuf;
boolean can_bind_const_buffer_as_vertex;
/**
{
struct pipe_constant_buffer cb;
- if (!st->has_user_constbuf) {
- cb.buffer = NULL;
- cb.user_buffer = NULL;
- u_upload_data(st->pipe->const_uploader, 0, sizeof(addr->constants),
- st->ctx->Const.UniformBufferOffsetAlignment,
- &addr->constants, &cb.buffer_offset, &cb.buffer);
- if (!cb.buffer)
- return false;
-
- u_upload_unmap(st->pipe->const_uploader);
- } else {
- cb.buffer = NULL;
- cb.user_buffer = &addr->constants;
- cb.buffer_offset = 0;
- }
+ cb.buffer = NULL;
+ cb.user_buffer = &addr->constants;
+ cb.buffer_offset = 0;
cb.buffer_size = sizeof(addr->constants);
cso_set_constant_buffer(cso, PIPE_SHADER_FRAGMENT, 0, &cb);