unsigned next_prim_boundary = shader->primitive_boundary;
for (i = 0; i < shader->vector_length; ++i) {
- int prims = shader->llvm_emitted_primitives[i];
+ int prims = shader->llvm_emitted_primitives[i + (stream * shader->vector_length)];
total_prims += prims;
max_prims_per_invocation = MAX2(max_prims_per_invocation, prims);
}
for (i = 0; i < shader->vector_length; ++i) {
- total_verts += shader->llvm_emitted_vertices[i];
+ total_verts += shader->llvm_emitted_vertices[i + (stream * shader->vector_length)];
}
- output_ptr += shader->stream[0].emitted_vertices * shader->vertex_size;
+ output_ptr += shader->stream[stream].emitted_vertices * shader->vertex_size;
for (i = 0; i < shader->vector_length - 1; ++i) {
int current_verts = shader->llvm_emitted_vertices[i];
- int next_verts = shader->llvm_emitted_vertices[i + 1];
+ int next_verts = shader->llvm_emitted_vertices[i + 1 + (stream * shader->vector_length)];
#if 0
int j;
for (j = 0; j < current_verts; ++j) {
prim_idx = 0;
for (i = 0; i < shader->vector_length; ++i) {
- int num_prims = shader->llvm_emitted_primitives[i];
+ int num_prims = shader->llvm_emitted_primitives[i + (stream * shader->vector_length)];
for (j = 0; j < num_prims; ++j) {
int prim_length =
shader->llvm_prim_lengths[j][i];
- shader->stream[0].primitive_lengths[shader->stream[0].emitted_primitives + prim_idx] =
+ shader->stream[stream].primitive_lengths[shader->stream[stream].emitted_primitives + prim_idx] =
prim_length;
++prim_idx;
}
}
- shader->stream[0].emitted_primitives += total_prims;
- shader->stream[0].emitted_vertices += total_verts;
+ shader->stream[stream].emitted_primitives += total_prims;
+ shader->stream[stream].emitted_vertices += total_verts;
}
static void
memset(gs->gs_input, 0, sizeof(struct draw_gs_inputs));
gs->llvm_prim_lengths = 0;
- gs->llvm_emitted_primitives = align_malloc(vector_size, vector_size);
- gs->llvm_emitted_vertices = align_malloc(vector_size, vector_size);
+ gs->llvm_emitted_primitives = align_malloc(vector_size * PIPE_MAX_VERTEX_STREAMS, vector_size);
+ gs->llvm_emitted_vertices = align_malloc(vector_size * PIPE_MAX_VERTEX_STREAMS, vector_size);
gs->llvm_prim_ids = align_malloc(vector_size, vector_size);
gs->fetch_outputs = llvm_fetch_gs_outputs;
draw_gs_jit_emitted_vertices(gallivm, variant->context_ptr);
LLVMValueRef emitted_prims_ptr =
draw_gs_jit_emitted_prims(gallivm, variant->context_ptr);
- LLVMValueRef zero = lp_build_const_int32(gallivm, 0);
-
- if (stream > 0)
- return;
-
- emitted_verts_ptr = LLVMBuildGEP(builder, emitted_verts_ptr, &zero, 0, "");
- emitted_prims_ptr = LLVMBuildGEP(builder, emitted_prims_ptr, &zero, 0, "");
+ LLVMValueRef stream_val = lp_build_const_int32(gallivm, stream);
+
+ emitted_verts_ptr = LLVMBuildGEP(builder, emitted_verts_ptr, &stream_val, 1, "");
+ emitted_prims_ptr = LLVMBuildGEP(builder, emitted_prims_ptr, &stream_val, 1, "");
LLVMBuildStore(builder, total_emitted_vertices_vec, emitted_verts_ptr);
LLVMBuildStore(builder, emitted_prims_vec, emitted_prims_ptr);