diff options
author | Marek Olšák <[email protected]> | 2010-12-29 03:17:43 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-01-06 16:16:29 +0100 |
commit | 58c5e782e351621bde2693fa945d0c90d140b855 (patch) | |
tree | d8a77d03790420d9e89325d74ff2e0dbb57a854c /src/mesa/state_tracker/st_context.h | |
parent | 5adcd9c9117b125cab1155c5f3af0bb51ace74b7 (diff) |
st/mesa: optimize constant buffer uploads
The overhead of resource_create, transfer_inline_write, and resource_destroy
to upload constant data is very visible with some apps in sysprof, and
as such should be eliminated.
My approach uses a user buffer to pass a pointer to a driver. This gives
the driver the freedom it needs to take the fast path, which may differ
for each driver.
This commit addresses the same issue as Jakob's one that suballocates out
of a big constant buffer, but it also eliminates the copy to the buffer.
Diffstat (limited to 'src/mesa/state_tracker/st_context.h')
-rw-r--r-- | src/mesa/state_tracker/st_context.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 1fd80053c1b..f20eb54e971 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -92,7 +92,10 @@ struct st_context struct pipe_sampler_state samplers[PIPE_MAX_SAMPLERS]; struct pipe_sampler_state *sampler_list[PIPE_MAX_SAMPLERS]; struct pipe_clip_state clip; - struct pipe_resource *constants[PIPE_SHADER_TYPES]; + struct { + void *ptr; + unsigned size; + } constants[PIPE_SHADER_TYPES]; struct pipe_framebuffer_state framebuffer; struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS]; struct pipe_scissor_state scissor; |