Mesa (master): st/nine: Drop USER_INDEX_BUFFERS check

2017-02-25 Thread Edward O'Callaghan
Module: Mesa
Branch: master
Commit: 47c49f619045f8b3d597558adac736578c3f14cb
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=47c49f619045f8b3d597558adac736578c3f14cb

Author: Mike Lothian 
Date:   Sat Feb 25 11:50:44 2017 +

st/nine: Drop USER_INDEX_BUFFERS check

This fixes 4a883966c1f74f43afc145d2c3d27af7b8c5e01a where the
PIPE_CAP was removed.

Now USER_INDEX_BUFFERS are always enabled remove the check and only
check for cmst_active directly.

v2: Axel pointed out the code was still needed when cmst was inactive,
Rebase on master too
v3: Drop struct member user_ibufs also && fixup shortlog (Edward).
v4: Fix negation
v5: Use the right variable name csmt != cmst

Fixes: 4a883966c1f7 ("gallium: remove PIPE_CAP_USER_INDEX_BUFFERS")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99953
Reported-and-tested-by: Vinson Lee  (v1)
Cc: Marek Olšák 
Cc: Axel Davy 
Signed-off-by: Edward O'Callaghan 
Signed-off-by: Mike Lothian 
Reviewed-by: Edward O'Callaghan 

---

 src/gallium/state_trackers/nine/device9.c | 3 +--
 src/gallium/state_trackers/nine/device9.h | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/nine/device9.c 
b/src/gallium/state_trackers/nine/device9.c
index c3924a2..8437162 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -473,7 +473,6 @@ 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_ibufs = GET_PCAP(USER_INDEX_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);
@@ -2896,7 +2895,7 @@ NineDevice9_DrawIndexedPrimitiveUP( struct NineDevice9 
*This,
 vbuf.buffer_offset -= base;
 vbuf.user_buffer = NULL;
 }
-if (!This->driver_caps.user_ibufs) {
+if (This->csmt_active) {
 u_upload_data(This->context.pipe->stream_uploader,
   0,
   (prim_count_to_vertex_count(PrimitiveType, 
PrimitiveCount)) * ibuf.index_size,
diff --git a/src/gallium/state_trackers/nine/device9.h 
b/src/gallium/state_trackers/nine/device9.h
index 71ebbdc..4b1630c 100644
--- a/src/gallium/state_trackers/nine/device9.h
+++ b/src/gallium/state_trackers/nine/device9.h
@@ -127,7 +127,6 @@ struct NineDevice9
 
 struct {
 boolean user_vbufs;
-boolean user_ibufs;
 boolean user_cbufs;
 boolean user_sw_vbufs;
 boolean user_sw_cbufs;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): st/nine: make use of common uploaders v4

2017-02-25 Thread Axel Davy
Module: Mesa
Branch: master
Commit: abb1c645c476b5dd289ce3efae0594f8796f9cf8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=abb1c645c476b5dd289ce3efae0594f8796f9cf8

Author: Constantine Charlamov 
Date:   Tue Feb 21 07:31:30 2017 +0300

st/nine: make use of common uploaders v4

Make use of common uploaders that landed recently to Mesa

v2: fixed formatting, broken due to thunderbird configuration

v3: per Axel comment: added a comment into NineDevice9_DrawPrimitiveUP

v4: per Axel comment: changed style of the comment

---

 src/gallium/state_trackers/nine/device9.c| 50 +---
 src/gallium/state_trackers/nine/device9.h|  5 ---
 src/gallium/state_trackers/nine/nine_ff.c|  8 ++---
 src/gallium/state_trackers/nine/nine_state.c | 48 +-
 4 files changed, 37 insertions(+), 74 deletions(-)

diff --git a/src/gallium/state_trackers/nine/device9.c 
b/src/gallium/state_trackers/nine/device9.c
index b9b7a63..c3924a2 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -477,31 +477,8 @@ NineDevice9_ctor( struct NineDevice9 *This,
 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);
-
-/* Implicit use of context pipe for vertex and index uploaded when
- * csmt is not active. Does not need to sync since csmt is unactive,
- * thus no need to call NineDevice9_GetPipe at each upload. */
-if (!This->driver_caps.user_vbufs)
-This->vertex_uploader = u_upload_create(This->csmt_active ?
-This->pipe_secondary : 
This->context.pipe,
-65536,
-PIPE_BIND_VERTEX_BUFFER, 
PIPE_USAGE_STREAM);
-This->vertex_sw_uploader = u_upload_create(This->pipe_sw, 65536,
-PIPE_BIND_VERTEX_BUFFER, 
PIPE_USAGE_STREAM);
-if (!This->driver_caps.user_ibufs)
-This->index_uploader = u_upload_create(This->csmt_active ?
-This->pipe_secondary : 
This->context.pipe,
-   128 * 1024,
-   PIPE_BIND_INDEX_BUFFER, 
PIPE_USAGE_STREAM);
-if (!This->driver_caps.user_cbufs) {
+if (!This->driver_caps.user_cbufs)
 This->constbuf_alignment = GET_PCAP(CONSTANT_BUFFER_OFFSET_ALIGNMENT);
-This->constbuf_uploader = u_upload_create(This->context.pipe, 
This->vs_const_size,
-  PIPE_BIND_CONSTANT_BUFFER, 
PIPE_USAGE_STREAM);
-}
-
-This->constbuf_sw_uploader = u_upload_create(This->pipe_sw, 128 * 1024,
- PIPE_BIND_CONSTANT_BUFFER, 
PIPE_USAGE_STREAM);
-
 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);
@@ -552,17 +529,6 @@ NineDevice9_dtor( struct NineDevice9 *This )
 nine_state_clear(>state, TRUE);
 nine_context_clear(This);
 
-if (This->vertex_uploader)
-u_upload_destroy(This->vertex_uploader);
-if (This->index_uploader)
-u_upload_destroy(This->index_uploader);
-if (This->constbuf_uploader)
-u_upload_destroy(This->constbuf_uploader);
-if (This->vertex_sw_uploader)
-u_upload_destroy(This->vertex_sw_uploader);
-if (This->constbuf_sw_uploader)
-u_upload_destroy(This->constbuf_sw_uploader);
-
 nine_bind(>record, NULL);
 
 pipe_sampler_view_reference(>dummy_sampler_view, NULL);
@@ -2852,15 +2818,17 @@ NineDevice9_DrawPrimitiveUP( struct NineDevice9 *This,
 vtxbuf.buffer = NULL;
 vtxbuf.user_buffer = pVertexStreamZeroData;
 
+/* csmt is unactive when user vertex or index buffers are used, thus no
+ * need to call NineDevice9_GetPipe. */
 if (!This->driver_caps.user_vbufs) {
-u_upload_data(This->vertex_uploader,
+u_upload_data(This->context.pipe->stream_uploader,
   0,
   (prim_count_to_vertex_count(PrimitiveType, 
PrimitiveCount)) * VertexStreamZeroStride, /* XXX */
   4,
   vtxbuf.user_buffer,
   _offset,
   );
-u_upload_unmap(This->vertex_uploader);
+u_upload_unmap(This->context.pipe->stream_uploader);
 vtxbuf.user_buffer = NULL;
 }
 
@@ -2916,27 +2884,27 @@