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

Kenneth Graunke kenneth at whitecape.org
Fri Dec 16 19:50:22 PST 2011


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).

Looks good, Paul.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list