Commit 674a929e authored by Italo Nicola's avatar Italo Nicola
Browse files

donotmerge: misc performance tentative changes



This commit can be dropped.
Signed-off-by: Italo Nicola's avatarItalo Nicola <italonicola@collabora.com>
parent 6ad42e16
Pipeline #583765 waiting for manual action with stages
......@@ -461,6 +461,7 @@ struct pipe_constant_buffer {
struct pipe_resource *buffer; /**< the actual buffer */
unsigned buffer_offset; /**< offset to start of data in buffer, in bytes */
unsigned buffer_size; /**< how much data can be read in shader */
int buffer_handle;
const void *user_buffer; /**< pointer to a user buffer if buffer == NULL */
};
......
......@@ -603,7 +603,7 @@ struct vrend_vertex_buffer {
uint32_t res_id;
};
#define VREND_PROGRAM_NQUEUES (1 << 8)
#define VREND_PROGRAM_NQUEUES (1 << 16)
#define VREND_PROGRAM_NQUEUE_MASK (VREND_PROGRAM_NQUEUES - 1)
struct vrend_sub_context {
......@@ -3219,13 +3219,15 @@ void vrend_set_uniform_buffer(struct vrend_context *ctx,
const uint32_t mask = 1u << index;
if (res_handle) {
res = vrend_renderer_ctx_res_lookup(ctx, res_handle);
if (!res) {
vrend_report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_RESOURCE, res_handle);
return;
if (res_handle != cbs->buffer_handle) {
res = vrend_renderer_ctx_res_lookup(ctx, res_handle);
if (!res) {
vrend_report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_RESOURCE, res_handle);
return;
}
cbs->buffer = (struct pipe_resource *)res;
cbs->buffer_handle = res_handle;
}
cbs->buffer = (struct pipe_resource *)res;
cbs->buffer_offset = offset;
cbs->buffer_size = length;
ctx->sub->const_bufs_used_mask[shader] |= mask;
......@@ -3233,6 +3235,7 @@ void vrend_set_uniform_buffer(struct vrend_context *ctx,
cbs->buffer = NULL;
cbs->buffer_offset = 0;
cbs->buffer_size = 0;
cbs->buffer_handle = -1;
ctx->sub->const_bufs_used_mask[shader] &= ~mask;
}
ctx->sub->const_bufs_dirty[shader] |= mask;
......@@ -4965,6 +4968,7 @@ vrend_select_program(struct vrend_sub_context *sub_ctx, ubyte vertices_per_patch
vrend_shader_select(sub_ctx, shaders[PIPE_SHADER_GEOMETRY], &gs_dirty);
vrend_shader_select(sub_ctx, shaders[PIPE_SHADER_FRAGMENT], &fs_dirty);
#if 0
// NOTE: run shader selection again as a workaround to #180 - "duplicated shader compilation"
if (shaders[PIPE_SHADER_GEOMETRY])
vrend_shader_select(sub_ctx, shaders[PIPE_SHADER_GEOMETRY], &gs_dirty);
......@@ -4979,6 +4983,7 @@ vrend_select_program(struct vrend_sub_context *sub_ctx, ubyte vertices_per_patch
sub_ctx->drawing = true;
vrend_shader_select(sub_ctx, shaders[PIPE_SHADER_VERTEX], &vs_dirty);
sub_ctx->drawing = false;
#endif
uint8_t gles_emulate_query_texture_levels_mask = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment