summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-12-17 23:12:45 +0100
committerMarek Olšák <[email protected]>2012-01-15 07:28:35 +0100
commit2449695e822421fdcaf1c66dffc12d7d705ea69d (patch)
treee1866c15d7fc3749ea6240fe0f519970448c5b0b /src/mesa
parentfaa90abfe0b6f55ab69768eb930b4ab5ef21cb06 (diff)
gallium: improve the pipe_stream_output_info struct (v2)
There are 3 changes: 1) stride is specified for each buffer, not just one, so that drivers don't have to derive it from the outputs 2) new per-output property dst_offset, which specifies the offset into the buffer in dwords where the output should be stored, so that drivers don't have to compute the offsets manually; this will also be useful for gl_SkipComponents from ARB_transform_feedback3 3) register_mask is removed, instead, there is start_component and num_components; register_mask with non-consecutive 1s doesn't make much sense (some hardware cannot do packing of components) Christoph Bumiller: fixed nvc0. v2: resolve merge conflicts in Draw and clean it up
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 26047cfe078..dc841ff9779 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5097,25 +5097,21 @@ st_translate_stream_output_info(glsl_to_tgsi_visitor *glsl_to_tgsi,
const GLuint outputMapping[],
struct pipe_stream_output_info *so)
{
- static unsigned comps_to_mask[] = {
- 0,
- TGSI_WRITEMASK_X,
- TGSI_WRITEMASK_XY,
- TGSI_WRITEMASK_XYZ,
- TGSI_WRITEMASK_XYZW
- };
unsigned i;
struct gl_transform_feedback_info *info =
&glsl_to_tgsi->shader_program->LinkedTransformFeedback;
for (i = 0; i < info->NumOutputs; i++) {
- assert(info->Outputs[i].NumComponents < Elements(comps_to_mask));
so->output[i].register_index =
outputMapping[info->Outputs[i].OutputRegister];
- so->output[i].register_mask =
- comps_to_mask[info->Outputs[i].NumComponents]
- << info->Outputs[i].ComponentOffset;
+ so->output[i].start_component = info->Outputs[i].ComponentOffset;
+ 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;
+ }
+
+ for (i = 0; i < PIPE_MAX_SO_BUFFERS; i++) {
+ so->stride[i] = info->BufferStride[i];
}
so->num_outputs = info->NumOutputs;
}