mesa/st: add vertex stream support
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 15 Jun 2014 22:49:50 +0000 (18:49 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 1 Jul 2014 15:34:37 +0000 (11:34 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/state_tracker/st_cb_queryobj.c
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 1aaa322f6150b61427a7578e3ff8524b1032d3d6..489f537d8bdbe50e4180172afd9b7c5cefbd85f6 100644 (file)
@@ -138,7 +138,7 @@ st_BeginQuery(struct gl_context *ctx, struct gl_query_object *q)
       pipe->end_query(pipe, stq->pq_begin);
    } else {
       if (!stq->pq) {
-         stq->pq = pipe->create_query(pipe, type, 0);
+         stq->pq = pipe->create_query(pipe, type, q->Stream);
          stq->type = type;
       }
       if (stq->pq) {
index a552bb4da0128f2bf2ec3cc00b06002415f469a3..13de2be4039736848518de210da7e0317ffa6457 100644 (file)
@@ -3139,14 +3139,18 @@ void
 glsl_to_tgsi_visitor::visit(ir_emit_vertex *ir)
 {
    assert(this->prog->Target == GL_GEOMETRY_PROGRAM_NV);
-   emit(ir, TGSI_OPCODE_EMIT, undef_dst, st_src_reg_for_int(0));
+
+   ir->stream->accept(this);
+   emit(ir, TGSI_OPCODE_EMIT, undef_dst, this->result);
 }
 
 void
 glsl_to_tgsi_visitor::visit(ir_end_primitive *ir)
 {
    assert(this->prog->Target == GL_GEOMETRY_PROGRAM_NV);
-   emit(ir, TGSI_OPCODE_ENDPRIM, undef_dst, st_src_reg_for_int(0));
+
+   ir->stream->accept(this);
+   emit(ir, TGSI_OPCODE_ENDPRIM, undef_dst, this->result);
 }
 
 glsl_to_tgsi_visitor::glsl_to_tgsi_visitor()
@@ -5524,7 +5528,7 @@ st_translate_stream_output_info(glsl_to_tgsi_visitor *glsl_to_tgsi,
       so->output[i].num_components = info->Outputs[i].NumComponents;
       so->output[i].output_buffer = info->Outputs[i].OutputBuffer;
       so->output[i].dst_offset = info->Outputs[i].DstOffset;
-      so->output[i].stream = 0; /* info->Outputs[i].StreamId */
+      so->output[i].stream = info->Outputs[i].StreamId;
    }
 
    for (i = 0; i < PIPE_MAX_SO_BUFFERS; i++) {