diff options
author | Marek Olšák <[email protected]> | 2017-04-02 14:30:16 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-05-10 19:00:16 +0200 |
commit | c24c3b94ed29ecd99b1101c74c6c4606f9b5580e (patch) | |
tree | 81f6966bc59a68d9867693c65d35fae9bb1d9819 /src/gallium/auxiliary/vl | |
parent | fe437882ea2d60e91c244cc95beb4b79c615af49 (diff) |
gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytes
Diffstat (limited to 'src/gallium/auxiliary/vl')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_bicubic_filter.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vl_compositor.c | 7 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vl_deint_filter.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vl_matrix_filter.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vl_median_filter.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vl_mpeg12_decoder.c | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vl_vertex_buffers.c | 24 |
7 files changed, 30 insertions, 29 deletions
diff --git a/src/gallium/auxiliary/vl/vl_bicubic_filter.c b/src/gallium/auxiliary/vl/vl_bicubic_filter.c index efd8a1c7aec..a3dc6c8c5cf 100644 --- a/src/gallium/auxiliary/vl/vl_bicubic_filter.c +++ b/src/gallium/auxiliary/vl/vl_bicubic_filter.c @@ -295,7 +295,7 @@ vl_bicubic_filter_init(struct vl_bicubic_filter *filter, struct pipe_context *pi goto error_sampler; filter->quad = vl_vb_upload_quads(pipe); - if(!filter->quad.buffer) + if(!filter->quad.buffer.resource) goto error_quad; memset(&ve, 0, sizeof(ve)); @@ -349,7 +349,7 @@ error_vs: pipe->delete_vertex_elements_state(pipe, filter->ves); error_ves: - pipe_resource_reference(&filter->quad.buffer, NULL); + pipe_resource_reference(&filter->quad.buffer.resource, NULL); error_quad: pipe->delete_sampler_state(pipe, filter->sampler); @@ -373,7 +373,7 @@ vl_bicubic_filter_cleanup(struct vl_bicubic_filter *filter) filter->pipe->delete_blend_state(filter->pipe, filter->blend); filter->pipe->delete_rasterizer_state(filter->pipe, filter->rs_state); filter->pipe->delete_vertex_elements_state(filter->pipe, filter->ves); - pipe_resource_reference(&filter->quad.buffer, NULL); + pipe_resource_reference(&filter->quad.buffer.resource, NULL); filter->pipe->delete_vs_state(filter->pipe, filter->vs); filter->pipe->delete_fs_state(filter->pipe, filter->fs); diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c index 693d685cd0b..a79bf112646 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.c +++ b/src/gallium/auxiliary/vl/vl_compositor.c @@ -605,7 +605,8 @@ init_buffers(struct vl_compositor *c) */ c->vertex_buf.stride = sizeof(struct vertex2f) + sizeof(struct vertex4f) * 2; c->vertex_buf.buffer_offset = 0; - c->vertex_buf.buffer = NULL; + c->vertex_buf.buffer.resource = NULL; + c->vertex_buf.is_user_buffer = false; vertex_elems[0].src_offset = 0; vertex_elems[0].instance_divisor = 0; @@ -630,7 +631,7 @@ cleanup_buffers(struct vl_compositor *c) assert(c); c->pipe->delete_vertex_elements_state(c->pipe, c->vertex_elems_state); - pipe_resource_reference(&c->vertex_buf.buffer, NULL); + pipe_resource_reference(&c->vertex_buf.buffer.resource, NULL); } static inline struct u_rect @@ -812,7 +813,7 @@ gen_vertex_data(struct vl_compositor *c, struct vl_compositor_state *s, struct u u_upload_alloc(c->pipe->stream_uploader, 0, c->vertex_buf.stride * VL_COMPOSITOR_MAX_LAYERS * 4, /* size */ 4, /* alignment */ - &c->vertex_buf.buffer_offset, &c->vertex_buf.buffer, + &c->vertex_buf.buffer_offset, &c->vertex_buf.buffer.resource, (void**)&vb); for (i = 0; i < VL_COMPOSITOR_MAX_LAYERS; i++) { diff --git a/src/gallium/auxiliary/vl/vl_deint_filter.c b/src/gallium/auxiliary/vl/vl_deint_filter.c index 2eec5cbcd32..d2c48bda7f9 100644 --- a/src/gallium/auxiliary/vl/vl_deint_filter.c +++ b/src/gallium/auxiliary/vl/vl_deint_filter.c @@ -308,7 +308,7 @@ vl_deint_filter_init(struct vl_deint_filter *filter, struct pipe_context *pipe, goto error_sampler; filter->quad = vl_vb_upload_quads(pipe); - if(!filter->quad.buffer) + if(!filter->quad.buffer.resource) goto error_quad; memset(&ve, 0, sizeof(ve)); @@ -361,7 +361,7 @@ error_vs: pipe->delete_vertex_elements_state(pipe, filter->ves); error_ves: - pipe_resource_reference(&filter->quad.buffer, NULL); + pipe_resource_reference(&filter->quad.buffer.resource, NULL); error_quad: pipe->delete_sampler_state(pipe, filter->sampler); @@ -396,7 +396,7 @@ vl_deint_filter_cleanup(struct vl_deint_filter *filter) filter->pipe->delete_blend_state(filter->pipe, filter->blend[2]); filter->pipe->delete_rasterizer_state(filter->pipe, filter->rs_state); filter->pipe->delete_vertex_elements_state(filter->pipe, filter->ves); - pipe_resource_reference(&filter->quad.buffer, NULL); + pipe_resource_reference(&filter->quad.buffer.resource, NULL); filter->pipe->delete_vs_state(filter->pipe, filter->vs); filter->pipe->delete_fs_state(filter->pipe, filter->fs_copy_top); diff --git a/src/gallium/auxiliary/vl/vl_matrix_filter.c b/src/gallium/auxiliary/vl/vl_matrix_filter.c index b498d1f1db2..1dacc7c6025 100644 --- a/src/gallium/auxiliary/vl/vl_matrix_filter.c +++ b/src/gallium/auxiliary/vl/vl_matrix_filter.c @@ -184,7 +184,7 @@ vl_matrix_filter_init(struct vl_matrix_filter *filter, struct pipe_context *pipe goto error_sampler; filter->quad = vl_vb_upload_quads(pipe); - if(!filter->quad.buffer) + if(!filter->quad.buffer.resource) goto error_quad; memset(&ve, 0, sizeof(ve)); @@ -233,7 +233,7 @@ error_offsets: pipe->delete_vertex_elements_state(pipe, filter->ves); error_ves: - pipe_resource_reference(&filter->quad.buffer, NULL); + pipe_resource_reference(&filter->quad.buffer.resource, NULL); error_quad: pipe->delete_sampler_state(pipe, filter->sampler); @@ -257,7 +257,7 @@ vl_matrix_filter_cleanup(struct vl_matrix_filter *filter) filter->pipe->delete_blend_state(filter->pipe, filter->blend); filter->pipe->delete_rasterizer_state(filter->pipe, filter->rs_state); filter->pipe->delete_vertex_elements_state(filter->pipe, filter->ves); - pipe_resource_reference(&filter->quad.buffer, NULL); + pipe_resource_reference(&filter->quad.buffer.resource, NULL); filter->pipe->delete_vs_state(filter->pipe, filter->vs); filter->pipe->delete_fs_state(filter->pipe, filter->fs); diff --git a/src/gallium/auxiliary/vl/vl_median_filter.c b/src/gallium/auxiliary/vl/vl_median_filter.c index 0183b875871..273afaf2fb2 100644 --- a/src/gallium/auxiliary/vl/vl_median_filter.c +++ b/src/gallium/auxiliary/vl/vl_median_filter.c @@ -295,7 +295,7 @@ vl_median_filter_init(struct vl_median_filter *filter, struct pipe_context *pipe goto error_sampler; filter->quad = vl_vb_upload_quads(pipe); - if(!filter->quad.buffer) + if(!filter->quad.buffer.resource) goto error_quad; memset(&ve, 0, sizeof(ve)); @@ -337,7 +337,7 @@ error_offsets: pipe->delete_vertex_elements_state(pipe, filter->ves); error_ves: - pipe_resource_reference(&filter->quad.buffer, NULL); + pipe_resource_reference(&filter->quad.buffer.resource, NULL); error_quad: pipe->delete_sampler_state(pipe, filter->sampler); @@ -361,7 +361,7 @@ vl_median_filter_cleanup(struct vl_median_filter *filter) filter->pipe->delete_blend_state(filter->pipe, filter->blend); filter->pipe->delete_rasterizer_state(filter->pipe, filter->rs_state); filter->pipe->delete_vertex_elements_state(filter->pipe, filter->ves); - pipe_resource_reference(&filter->quad.buffer, NULL); + pipe_resource_reference(&filter->quad.buffer.resource, NULL); filter->pipe->delete_vs_state(filter->pipe, filter->vs); filter->pipe->delete_fs_state(filter->pipe, filter->fs); diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c index db62b44f563..8a2dae34e35 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c @@ -509,8 +509,8 @@ vl_mpeg12_destroy(struct pipe_video_codec *decoder) dec->context->delete_vertex_elements_state(dec->context, dec->ves_ycbcr); dec->context->delete_vertex_elements_state(dec->context, dec->ves_mv); - pipe_resource_reference(&dec->quads.buffer, NULL); - pipe_resource_reference(&dec->pos.buffer, NULL); + pipe_resource_reference(&dec->quads.buffer.resource, NULL); + pipe_resource_reference(&dec->pos.buffer.resource, NULL); pipe_sampler_view_reference(&dec->zscan_linear, NULL); pipe_sampler_view_reference(&dec->zscan_normal, NULL); diff --git a/src/gallium/auxiliary/vl/vl_vertex_buffers.c b/src/gallium/auxiliary/vl/vl_vertex_buffers.c index 17212278f1a..45a9badce21 100644 --- a/src/gallium/auxiliary/vl/vl_vertex_buffers.c +++ b/src/gallium/auxiliary/vl/vl_vertex_buffers.c @@ -49,23 +49,23 @@ vl_vb_upload_quads(struct pipe_context *pipe) /* create buffer */ quad.stride = sizeof(struct vertex2f); quad.buffer_offset = 0; - quad.buffer = pipe_buffer_create + quad.buffer.resource = pipe_buffer_create ( pipe->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_DEFAULT, sizeof(struct vertex2f) * 4 ); - quad.user_buffer = NULL; + quad.is_user_buffer = false; - if(!quad.buffer) + if(!quad.buffer.resource) return quad; /* and fill it */ v = pipe_buffer_map ( pipe, - quad.buffer, + quad.buffer.resource, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE, &buf_transfer ); @@ -94,23 +94,23 @@ vl_vb_upload_pos(struct pipe_context *pipe, unsigned width, unsigned height) /* create buffer */ pos.stride = sizeof(struct vertex2s); pos.buffer_offset = 0; - pos.buffer = pipe_buffer_create + pos.buffer.resource = pipe_buffer_create ( pipe->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_DEFAULT, sizeof(struct vertex2s) * width * height ); - pos.user_buffer = NULL; + pos.is_user_buffer = false; - if(!pos.buffer) + if(!pos.buffer.resource) return pos; /* and fill it */ v = pipe_buffer_map ( pipe, - pos.buffer, + pos.buffer.resource, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE, &buf_transfer ); @@ -268,8 +268,8 @@ vl_vb_get_ycbcr(struct vl_vertex_buffer *buffer, int component) buf.stride = sizeof(struct vl_ycbcr_block); buf.buffer_offset = 0; - buf.buffer = buffer->ycbcr[component].resource; - buf.user_buffer = NULL; + buf.buffer.resource = buffer->ycbcr[component].resource; + buf.is_user_buffer = false; return buf; } @@ -283,8 +283,8 @@ vl_vb_get_mv(struct vl_vertex_buffer *buffer, int motionvector) buf.stride = sizeof(struct vl_motionvector); buf.buffer_offset = 0; - buf.buffer = buffer->mv[motionvector].resource; - buf.user_buffer = NULL; + buf.buffer.resource = buffer->mv[motionvector].resource; + buf.is_user_buffer = false; return buf; } |