diff options
author | Marek Olšák <[email protected]> | 2011-02-13 09:13:14 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-02-15 22:44:21 +0100 |
commit | eafb7f234d11a290b00dcaf5492b9bdad1cf5148 (patch) | |
tree | 6abe76f35f3dd25c9c3f537b4a4765ec9bb2e46f /src/gallium/state_trackers | |
parent | 82a9794a35744d60adc38b5eee53153c73d07331 (diff) |
gallium: add usage parameter to pipe_buffer_create
And set a reasonable buffer usage flag everywhere instead of
just PIPE_USAGE_DEFAULT.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/vega/renderer.c | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_renderer.c | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp index 61cf2ddd9df..2e45f3f43e9 100644 --- a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp +++ b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp @@ -794,7 +794,8 @@ struct dxgi_blitter const unsigned semantic_indices[] = { 0, 0 }; vs = util_make_vertex_passthrough_shader(pipe, 2, semantic_names, semantic_indices); - vbuf.buffer = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER, sizeof(quad_data)); + vbuf.buffer = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER, + PIPE_USAGE_STREAM, sizeof(quad_data)); vbuf.buffer_offset = 0; vbuf.stride = 4 * sizeof(float); pipe_buffer_write(pipe, vbuf.buffer, 0, sizeof(quad_data), quad_data); diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c index 952b12356a4..9de2cb1014d 100644 --- a/src/gallium/state_trackers/vega/renderer.c +++ b/src/gallium/state_trackers/vega/renderer.c @@ -174,6 +174,7 @@ static void renderer_set_mvp(struct renderer *renderer, pipe_resource_reference(&cbuf, NULL); cbuf = pipe_buffer_create(renderer->pipe->screen, PIPE_BIND_CONSTANT_BUFFER, + PIPE_USAGE_STATIC, sizeof(consts)); if (cbuf) { pipe_buffer_write(renderer->pipe, cbuf, @@ -474,7 +475,8 @@ static void renderer_set_custom_fs(struct renderer *renderer, pipe_resource_reference(&cbuf, NULL); cbuf = pipe_buffer_create(renderer->pipe->screen, - PIPE_BIND_CONSTANT_BUFFER, const_buffer_len); + PIPE_BIND_CONSTANT_BUFFER, PIPE_USAGE_STATIC, + const_buffer_len); pipe_buffer_write(renderer->pipe, cbuf, 0, const_buffer_len, const_buffer); renderer->pipe->set_constant_buffer(renderer->pipe, diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index 7c6b6c05dae..3b3ae455c0b 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -429,6 +429,7 @@ void renderer_set_constants(struct xorg_renderer *r, pipe_resource_reference(cbuf, NULL); *cbuf = pipe_buffer_create(r->pipe->screen, PIPE_BIND_CONSTANT_BUFFER, + PIPE_USAGE_STATIC, param_bytes); if (*cbuf) { |