[Mesa-dev] [PATCH 5/8] i965 gen6: Initial implementation of transform feedback.

Paul Berry stereotype441 at gmail.com
Mon Dec 19 11:13:12 PST 2011


On 16 December 2011 19:50, Kenneth Graunke <kenneth at whitecape.org> wrote:

> On 12/13/2011 03:35 PM, Paul Berry wrote:
> [snip]
> > +static void
> > +brw_update_sol_surface(struct brw_context *brw, drm_intel_bo *bo,
> > +                       uint32_t *out_offset, unsigned
> num_vector_components,
> > +                       unsigned stride_dwords, unsigned offset_dwords,
> > +                       uint32_t buffer_size_minus_1)
> > +{
> > +   uint32_t *surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE, 6 *
> 4, 32,
> > +                                    out_offset);
> > +   uint32_t width = buffer_size_minus_1 & 0x7f;
> > +   uint32_t height = (buffer_size_minus_1 & 0xfff80) >> 7;
> > +   uint32_t depth = (buffer_size_minus_1 & 0x7f00000) >> 20;
> > +   uint32_t pitch_minus_1 = 4*stride_dwords - 1;
> > +   uint32_t surface_format;
> > +   uint32_t offset_bytes = 4 * offset_dwords;
> > +   switch (num_vector_components) {
> > +   case 1:
> > +      surface_format = BRW_SURFACEFORMAT_R32_FLOAT;
> > +      break;
> > +   case 2:
> > +      surface_format = BRW_SURFACEFORMAT_R32G32_FLOAT;
> > +      break;
> > +   case 3:
> > +      surface_format = BRW_SURFACEFORMAT_R32G32B32_FLOAT;
> > +      break;
> > +   case 4:
> > +      surface_format = BRW_SURFACEFORMAT_R32G32B32A32_FLOAT;
> > +      break;
> > +   default:
> > +      assert (!"Invalid vector size for transform feedback output");
> > +      surface_format = BRW_SURFACEFORMAT_R32_FLOAT;
> > +      break;
> > +   }
>
> Is it possible to have integer transform feedback outputs?  If so, we'd
> need to adjust this.  But we can do that later (if at all).
>

Yes, integer transform feedback outputs are possible, but I believe that it
won't be necessary to adjust this because the data port doesn't do any
format conversions on "streamed vertex buffer write" messages.  But I'll
make sure we have the necessary piglit tests to verify this, and if I'm
wrong I'll do a follow-up patch.


>
> Looks good, Paul.
>
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111219/e625706f/attachment.html>


More information about the mesa-dev mailing list