diff options
author | Marek Olšák <[email protected]> | 2018-01-10 20:02:48 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-01-17 20:17:59 +0100 |
commit | 5981a5226ea1b0075443e40bc18b2d4b3cd76d2c (patch) | |
tree | b2c326d65dcb7664dd3893c8cdc47d3924cb8fb0 /src/gallium/state_trackers | |
parent | e871abe452ad40efcccb0bab6b88fc31d0551e29 (diff) |
nine: assume that user constant buffers are always supported
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/device9.h | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_ff.c | 28 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_state.c | 125 |
4 files changed, 4 insertions, 156 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 34f903a6947..127f2ae195b 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -473,12 +473,8 @@ NineDevice9_ctor( struct NineDevice9 *This, /* Allocate upload helper for drivers that suck (from st pov ;). */ This->driver_caps.user_vbufs = GET_PCAP(USER_VERTEX_BUFFERS) && !This->csmt_active; - This->driver_caps.user_cbufs = GET_PCAP(USER_CONSTANT_BUFFERS); This->driver_caps.user_sw_vbufs = This->screen_sw->get_param(This->screen_sw, PIPE_CAP_USER_VERTEX_BUFFERS); - This->driver_caps.user_sw_cbufs = This->screen_sw->get_param(This->screen_sw, PIPE_CAP_USER_CONSTANT_BUFFERS); This->vertex_uploader = This->csmt_active ? This->pipe_secondary->stream_uploader : This->context.pipe->stream_uploader; - if (!This->driver_caps.user_cbufs) - This->constbuf_alignment = GET_PCAP(CONSTANT_BUFFER_OFFSET_ALIGNMENT); This->driver_caps.window_space_position_support = GET_PCAP(TGSI_VS_WINDOW_SPACE_POSITION); This->driver_caps.vs_integer = pScreen->get_shader_param(pScreen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_INTEGERS); This->driver_caps.ps_integer = pScreen->get_shader_param(pScreen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_INTEGERS); diff --git a/src/gallium/state_trackers/nine/device9.h b/src/gallium/state_trackers/nine/device9.h index c5fd8f76c63..4cce29a28e0 100644 --- a/src/gallium/state_trackers/nine/device9.h +++ b/src/gallium/state_trackers/nine/device9.h @@ -127,9 +127,7 @@ struct NineDevice9 struct { boolean user_vbufs; - boolean user_cbufs; boolean user_sw_vbufs; - boolean user_sw_cbufs; boolean window_space_position_support; boolean vs_integer; boolean ps_integer; @@ -141,7 +139,6 @@ struct NineDevice9 } driver_bugs; struct u_upload_mgr *vertex_uploader; - unsigned constbuf_alignment; struct nine_range_pool range_pool; diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c index 39fcb8b1591..eb673e4aff9 100644 --- a/src/gallium/state_trackers/nine/nine_ff.c +++ b/src/gallium/state_trackers/nine/nine_ff.c @@ -2060,19 +2060,7 @@ nine_ff_update(struct NineDevice9 *device) cb.user_buffer = device->ff.vs_const; cb.buffer_size = NINE_FF_NUM_VS_CONST * 4 * sizeof(float); - if (!device->driver_caps.user_cbufs) { - context->pipe_data.cb_vs_ff.buffer_size = cb.buffer_size; - u_upload_data(device->context.pipe->const_uploader, - 0, - cb.buffer_size, - device->constbuf_alignment, - cb.user_buffer, - &context->pipe_data.cb_vs_ff.buffer_offset, - &context->pipe_data.cb_vs_ff.buffer); - u_upload_unmap(device->context.pipe->const_uploader); - context->pipe_data.cb_vs_ff.user_buffer = NULL; - } else - context->pipe_data.cb_vs_ff = cb; + context->pipe_data.cb_vs_ff = cb; context->commit |= NINE_STATE_COMMIT_CONST_VS; } @@ -2084,19 +2072,7 @@ nine_ff_update(struct NineDevice9 *device) cb.user_buffer = device->ff.ps_const; cb.buffer_size = NINE_FF_NUM_PS_CONST * 4 * sizeof(float); - if (!device->driver_caps.user_cbufs) { - context->pipe_data.cb_ps_ff.buffer_size = cb.buffer_size; - u_upload_data(device->context.pipe->const_uploader, - 0, - cb.buffer_size, - device->constbuf_alignment, - cb.user_buffer, - &context->pipe_data.cb_ps_ff.buffer_offset, - &context->pipe_data.cb_ps_ff.buffer); - u_upload_unmap(device->context.pipe->const_uploader); - context->pipe_data.cb_ps_ff.user_buffer = NULL; - } else - context->pipe_data.cb_ps_ff = cb; + context->pipe_data.cb_ps_ff = cb; context->commit |= NINE_STATE_COMMIT_CONST_PS; } diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c index a9a41af66ec..26b2dea3bd5 100644 --- a/src/gallium/state_trackers/nine/nine_state.c +++ b/src/gallium/state_trackers/nine/nine_state.c @@ -382,9 +382,6 @@ prepare_vs_constants_userbuf_swvp(struct NineDevice9 *device) cb.user_buffer = dst; } - /* Do not erase the buffer field. - * It is either NULL (user_cbufs), or a resource. - * u_upload_data will do the proper refcount */ context->pipe_data.cb0_swvp.buffer_offset = cb.buffer_offset; context->pipe_data.cb0_swvp.buffer_size = cb.buffer_size; context->pipe_data.cb0_swvp.user_buffer = cb.user_buffer; @@ -423,52 +420,6 @@ prepare_vs_constants_userbuf_swvp(struct NineDevice9 *device) context->changed.vs_const_b = 0; } - if (!device->driver_caps.user_cbufs) { - struct pipe_constant_buffer *cb = &(context->pipe_data.cb0_swvp); - u_upload_data(device->context.pipe->const_uploader, - 0, - cb->buffer_size, - device->constbuf_alignment, - cb->user_buffer, - &(cb->buffer_offset), - &(cb->buffer)); - u_upload_unmap(device->context.pipe->const_uploader); - cb->user_buffer = NULL; - - cb = &(context->pipe_data.cb1_swvp); - u_upload_data(device->context.pipe->const_uploader, - 0, - cb->buffer_size, - device->constbuf_alignment, - cb->user_buffer, - &(cb->buffer_offset), - &(cb->buffer)); - u_upload_unmap(device->context.pipe->const_uploader); - cb->user_buffer = NULL; - - cb = &(context->pipe_data.cb2_swvp); - u_upload_data(device->context.pipe->const_uploader, - 0, - cb->buffer_size, - device->constbuf_alignment, - cb->user_buffer, - &(cb->buffer_offset), - &(cb->buffer)); - u_upload_unmap(device->context.pipe->const_uploader); - cb->user_buffer = NULL; - - cb = &(context->pipe_data.cb3_swvp); - u_upload_data(device->context.pipe->const_uploader, - 0, - cb->buffer_size, - device->constbuf_alignment, - cb->user_buffer, - &(cb->buffer_offset), - &(cb->buffer)); - u_upload_unmap(device->context.pipe->const_uploader); - cb->user_buffer = NULL; - } - context->changed.group &= ~NINE_STATE_VS_CONST; context->commit |= NINE_STATE_COMMIT_CONST_VS; } @@ -522,20 +473,7 @@ prepare_vs_constants_userbuf(struct NineDevice9 *device) cb.user_buffer = dst; } - if (!device->driver_caps.user_cbufs) { - context->pipe_data.cb_vs.buffer_size = cb.buffer_size; - u_upload_data(device->context.pipe->const_uploader, - 0, - cb.buffer_size, - device->constbuf_alignment, - cb.user_buffer, - &context->pipe_data.cb_vs.buffer_offset, - &context->pipe_data.cb_vs.buffer); - u_upload_unmap(device->context.pipe->const_uploader); - context->pipe_data.cb_vs.user_buffer = NULL; - } else - context->pipe_data.cb_vs = cb; - + context->pipe_data.cb_vs = cb; context->changed.vs_const_f = 0; context->changed.group &= ~NINE_STATE_VS_CONST; @@ -593,20 +531,7 @@ prepare_ps_constants_userbuf(struct NineDevice9 *device) if (!cb.buffer_size) return; - if (!device->driver_caps.user_cbufs) { - context->pipe_data.cb_ps.buffer_size = cb.buffer_size; - u_upload_data(device->context.pipe->const_uploader, - 0, - cb.buffer_size, - device->constbuf_alignment, - cb.user_buffer, - &context->pipe_data.cb_ps.buffer_offset, - &context->pipe_data.cb_ps.buffer); - u_upload_unmap(device->context.pipe->const_uploader); - context->pipe_data.cb_ps.user_buffer = NULL; - } else - context->pipe_data.cb_ps = cb; - + context->pipe_data.cb_ps = cb; context->changed.ps_const_f = 0; context->changed.group &= ~NINE_STATE_PS_CONST; @@ -3348,34 +3273,12 @@ update_vs_constants_sw(struct NineDevice9 *device) } buf = cb.user_buffer; - if (!device->driver_caps.user_sw_cbufs) { - u_upload_data(device->pipe_sw->const_uploader, - 0, - cb.buffer_size, - 16, - cb.user_buffer, - &(cb.buffer_offset), - &(cb.buffer)); - u_upload_unmap(device->pipe_sw->const_uploader); - cb.user_buffer = NULL; - } pipe_sw->set_constant_buffer(pipe_sw, PIPE_SHADER_VERTEX, 0, &cb); if (cb.buffer) pipe_resource_reference(&cb.buffer, NULL); cb.user_buffer = (char *)buf + 4096 * sizeof(float[4]); - if (!device->driver_caps.user_sw_cbufs) { - u_upload_data(device->pipe_sw->const_uploader, - 0, - cb.buffer_size, - 16, - cb.user_buffer, - &(cb.buffer_offset), - &(cb.buffer)); - u_upload_unmap(device->pipe_sw->const_uploader); - cb.user_buffer = NULL; - } pipe_sw->set_constant_buffer(pipe_sw, PIPE_SHADER_VERTEX, 1, &cb); if (cb.buffer) @@ -3390,18 +3293,6 @@ update_vs_constants_sw(struct NineDevice9 *device) cb.buffer_size = 2048 * sizeof(float[4]); cb.user_buffer = state->vs_const_i; - if (!device->driver_caps.user_sw_cbufs) { - u_upload_data(device->pipe_sw->const_uploader, - 0, - cb.buffer_size, - 16, - cb.user_buffer, - &(cb.buffer_offset), - &(cb.buffer)); - u_upload_unmap(device->pipe_sw->const_uploader); - cb.user_buffer = NULL; - } - pipe_sw->set_constant_buffer(pipe_sw, PIPE_SHADER_VERTEX, 2, &cb); if (cb.buffer) pipe_resource_reference(&cb.buffer, NULL); @@ -3415,18 +3306,6 @@ update_vs_constants_sw(struct NineDevice9 *device) cb.buffer_size = 512 * sizeof(float[4]); cb.user_buffer = state->vs_const_b; - if (!device->driver_caps.user_sw_cbufs) { - u_upload_data(device->pipe_sw->const_uploader, - 0, - cb.buffer_size, - 16, - cb.user_buffer, - &(cb.buffer_offset), - &(cb.buffer)); - u_upload_unmap(device->pipe_sw->const_uploader); - cb.user_buffer = NULL; - } - pipe_sw->set_constant_buffer(pipe_sw, PIPE_SHADER_VERTEX, 3, &cb); if (cb.buffer) pipe_resource_reference(&cb.buffer, NULL); |