Mesa (master): nvc0: expose 4 vertex streams, use stream ids in xfb

Ilia Mirkin imirkin at kemper.freedesktop.org
Tue Jul 1 15:39:13 UTC 2014


Module: Mesa
Branch: master
Commit: 5e04526399ca5d249cc5ec600aa6546356abccbb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e04526399ca5d249cc5ec600aa6546356abccbb

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sun Jun 15 16:39:14 2014 -0400

nvc0: expose 4 vertex streams, use stream ids in xfb

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 docs/GL3.txt                                         |    2 +-
 src/gallium/drivers/nouveau/nvc0/nvc0_program.c      |    1 +
 src/gallium/drivers/nouveau/nvc0/nvc0_program.h      |    1 +
 src/gallium/drivers/nouveau/nvc0/nvc0_query.c        |    1 +
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c       |    2 +-
 src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c |    2 +-
 6 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index bc418a9..e9ccf63 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -108,7 +108,7 @@ GL 4.0:
   - Packing/bitfield/conversion functions              DONE
   - Enhanced textureGather                             DONE
   - Geometry shader instancing                         DONE
-  - Geometry shader multiple streams                   DONE (i965)
+  - Geometry shader multiple streams                   DONE (i965, nvc0)
   - Enhanced per-sample shading                        DONE
   - Interpolation functions                            started (Chris)
   - New overload resolution rules                      DONE
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_program.c b/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
index ad8d1b0..7e49b06 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
@@ -493,6 +493,7 @@ nvc0_program_create_tfb_state(const struct nv50_ir_prog_info *info,
             info->out[pso->output[i].register_index].slot[s + c];
 
       tfb->varying_count[b] = MAX2(tfb->varying_count[b], p);
+      tfb->stream[b] = pso->output[i].stream;
    }
    for (b = 0; b < 4; ++b) // zero unused indices (looks nicer)
       for (c = tfb->varying_count[b]; c & 3; ++c)
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_program.h b/src/gallium/drivers/nouveau/nvc0/nvc0_program.h
index 750d8c1..3fd9d21 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_program.h
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_program.h
@@ -9,6 +9,7 @@
 
 struct nvc0_transform_feedback_state {
    uint32_t stride[4];
+   uint8_t stream[4];
    uint8_t varying_count[4];
    uint8_t varying_index[4][128];
 };
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index dc544d3..70fe270 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -136,6 +136,7 @@ nvc0_query_create(struct pipe_context *pipe, unsigned type, unsigned index)
    case PIPE_QUERY_PRIMITIVES_GENERATED:
    case PIPE_QUERY_PRIMITIVES_EMITTED:
       q->is64bit = TRUE;
+      q->index = index;
       space = 32;
       break;
    case PIPE_QUERY_TIME_ELAPSED:
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 510368b..ce36303 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -104,7 +104,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
       return 1024;
    case PIPE_CAP_MAX_VERTEX_STREAMS:
-      return 1;
+      return 4;
    case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
       return 256;
    case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
index bdc3ab5..1000d82 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
@@ -231,7 +231,7 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
             unsigned n = (tfb->varying_count[b] + 3) / 4;
 
             BEGIN_NVC0(push, NVC0_3D(TFB_STREAM(b)), 3);
-            PUSH_DATA (push, 0);
+            PUSH_DATA (push, tfb->stream[b]);
             PUSH_DATA (push, tfb->varying_count[b]);
             PUSH_DATA (push, tfb->stride[b]);
             BEGIN_NVC0(push, NVC0_3D(TFB_VARYING_LOCS(b, 0)), n);




More information about the mesa-commit mailing list