{
unsigned instance;
unsigned index_limit;
-
+ unsigned count;
assert(info->instance_count > 0);
if (info->indexed)
assert(draw->pt.user.elts);
draw->pt.max_index = index_limit - 1;
+ count = info->count;
+ if (count == 0) {
+ if (info->count_from_stream_output)
+ count = draw->pt.max_index + 1;
+ }
/*
* TODO: We could use draw->pt.max_index to further narrow
draw_pt_arrays_restart(draw, info);
}
else {
- draw_pt_arrays(draw, info->mode, info->start, info->count);
+ draw_pt_arrays(draw, info->mode, info->start, count);
}
}
}
for (i = 0; i < num_vertices; ++i) {
const float (*input)[4];
unsigned total_written_compos = 0;
+ int ob;
/*debug_printf("%d) vertex index = %d (prim idx = %d)\n", i, indices[i], prim_idx);*/
input = (const float (*)[4])(
(const char *)input_ptr + (indices[i] * input_vertex_stride));
unsigned idx = state->output[slot].register_index;
unsigned start_comp = state->output[slot].start_component;
unsigned num_comps = state->output[slot].num_components;
- int ob = state->output[slot].output_buffer;
+
+ ob = state->output[slot].output_buffer;
buffer = (float *)((char *)draw->so.targets[ob]->mapping +
draw->so.targets[ob]->target.buffer_offset +
- draw->so.targets[ob]->internal_offset);
+ draw->so.targets[ob]->internal_offset) + state->output[slot].dst_offset;
memcpy(buffer, &input[idx][start_comp], num_comps * sizeof(float));
- draw->so.targets[ob]->internal_offset += num_comps * sizeof(float);
total_written_compos += num_comps;
}
+ for (ob = 0; ob < draw->so.num_targets; ++ob)
+ draw->so.targets[ob]->internal_offset += state->stride[ob] * sizeof(float);
}
so->emitted_vertices += num_vertices;
++so->emitted_primitives;
if (!emit->has_so)
return;
+ if (!draw->so.num_targets)
+ return;
+
emit->emitted_vertices = 0;
emit->emitted_primitives = 0;
emit->generated_primitives = 0;
case PIPE_CAP_USER_VERTEX_BUFFERS:
case PIPE_CAP_USER_INDEX_BUFFERS:
case PIPE_CAP_USER_CONSTANT_BUFFERS:
+ case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
return 1;
case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
return 16;
- case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
case PIPE_CAP_TGSI_CAN_COMPACT_VARYINGS:
case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: