LLVMValueRef gs_next_vertex;
LLVMValueRef can_emit, kill;
LLVMValueRef args[2];
- unsigned chan;
+ unsigned chan, offset;
int i;
unsigned stream;
lp_build_if(&if_state, gallivm, can_emit);
}
+ offset = 0;
for (i = 0; i < info->num_outputs; i++) {
LLVMValueRef *out_ptr =
ctx->soa.outputs[i];
LLVMValueRef out_val = LLVMBuildLoad(gallivm->builder, out_ptr[chan], "");
LLVMValueRef voffset =
- lp_build_const_int32(gallivm, (i * 4 + chan) *
+ lp_build_const_int32(gallivm, offset *
shader->selector->gs_max_out_vertices);
+ offset++;
voffset = lp_build_add(uint, voffset, gs_next_vertex);
voffset = lp_build_mul_imm(uint, voffset, 4);
for (int stream = 0; stream < 4; stream++) {
LLVMBasicBlockRef bb;
+ unsigned offset;
if (!gsinfo->num_stream_output_components[stream])
continue;
LLVMPositionBuilderAtEnd(builder, bb);
/* Fetch vertex data from GSVS ring */
+ offset = 0;
for (i = 0; i < gsinfo->num_outputs; ++i) {
for (unsigned chan = 0; chan < 4; chan++) {
if (!(gsinfo->output_usagemask[i] & (1 << chan)) ||
args[2] = lp_build_const_int32(
gallivm,
- (i * 4 + chan) * gs_selector->gs_max_out_vertices * 16 * 4);
+ offset * gs_selector->gs_max_out_vertices * 16 * 4);
+ offset++;
outputs[i].values[chan] =
LLVMBuildBitCast(gallivm->builder,