nvc0: expose 4 vertex streams, use stream ids in xfb
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 15 Jun 2014 20:39:14 +0000 (16:39 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 1 Jul 2014 15:34:40 +0000 (11:34 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
docs/GL3.txt
src/gallium/drivers/nouveau/nvc0/nvc0_program.c
src/gallium/drivers/nouveau/nvc0/nvc0_program.h
src/gallium/drivers/nouveau/nvc0/nvc0_query.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c

index bc418a90808d116e88ee1b761eb1500a2111d2e7..e9ccf63a7ee1171ce163635a6aeca0c938fae9c8 100644 (file)
@@ -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
index ad8d1b04e212ebf1f1da3ceeec5984185b00650c..7e49b06dee24f53027e8e85f8828cce774bf22d8 100644 (file)
@@ -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)
index 750d8c104590e725fc15320625f44fdd5b57f6d8..3fd9d21b4c4bf51d9163d473483144fcbbf42c12 100644 (file)
@@ -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];
 };
index dc544d36efc6ff6d0f60128ec641c639e4154617..70fe270c27bd17b2b15d3243aea57bb16e14083c 100644 (file)
@@ -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:
index 510368b9b833c553ca779b1fb2e959c6427ab623..ce3630338aa248203046b3d69a8d58aa7d7aaadb 100644 (file)
@@ -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:
index bdc3ab5821e7264d15e05d4d88766b79281e97f7..1000d8286d779dd4b5f74304d845dd1bdab14913 100644 (file)
@@ -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);