st/mesa: add some debug code in st_choose_format()
[mesa.git] / src / mesa / state_tracker / st_atom_constbuf.c
index e4b585101da1ab04bbd9424eff2525a69e94a8dd..0a6b23aff3b09eae1ba66c3b40f3e4ed1afa80a0 100644 (file)
@@ -56,7 +56,7 @@ void st_upload_constants(struct st_context *st, struct gl_program *prog)
 {
    gl_shader_stage stage = prog->info.stage;
    struct gl_program_parameter_list *params = prog->Parameters;
-   enum pipe_shader_type shader_type = st_shader_stage_to_ptarget(stage);
+   enum pipe_shader_type shader_type = pipe_shader_type_from_mesa(stage);
 
    assert(shader_type == PIPE_SHADER_VERTEX ||
           shader_type == PIPE_SHADER_FRAGMENT ||
@@ -101,22 +101,9 @@ void st_upload_constants(struct st_context *st, struct gl_program *prog)
 
       _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) {
@@ -208,7 +195,7 @@ static void st_bind_ubos(struct st_context *st, struct gl_program *prog,
       return;
 
    for (i = 0; i < prog->info.num_ubos; i++) {
-      struct gl_uniform_buffer_binding *binding;
+      struct gl_buffer_binding *binding;
       struct st_buffer_object *st_obj;
 
       binding =