nir/xfb: adding varyings on nir_xfb_info and gather_info

In order to be used for OpenGL (right now for ARB_gl_spirv).

This commit adds two new structures:

  * nir_xfb_varying_info: that identifies each individual varying. For
    each one, we need to know the type, buffer and xfb_offset

  * nir_xfb_buffer_info: as now for each buffer, in addition to the
    stride, we need to know how many varyings are assigned to it.

For this patch, the only case where num_outputs != num_varyings is
with the case of doubles, that for dvec3/4 could require more than one
output. There are more cases though (like aoa), that will be handled
on following patches.

v2: updated after new nir general XFB support introduced for "anv: Add
    support for VK_EXT_transform_feedback"

v3: compute num_varyings beforehand for allocating, instead of relying
    on num_outputs as approximate value (Timothy Arceri)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
Alejandro Piñeiro
2019-01-09 18:19:45 +01:00
parent 9f68b9ac71
commit cf0b2ad486
4 changed files with 49 additions and 12 deletions

View File

@@ -1162,10 +1162,10 @@ emit_3dstate_streamout(struct anv_pipeline *pipeline,
so.RenderStreamSelect = stream_info ?
stream_info->rasterizationStream : 0;
so.Buffer0SurfacePitch = xfb_info->strides[0];
so.Buffer1SurfacePitch = xfb_info->strides[1];
so.Buffer2SurfacePitch = xfb_info->strides[2];
so.Buffer3SurfacePitch = xfb_info->strides[3];
so.Buffer0SurfacePitch = xfb_info->buffers[0].stride;
so.Buffer1SurfacePitch = xfb_info->buffers[1].stride;
so.Buffer2SurfacePitch = xfb_info->buffers[2].stride;
so.Buffer3SurfacePitch = xfb_info->buffers[3].stride;
int urb_entry_read_offset = 0;
int urb_entry_read_length =