mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
iris: Implement new way for setting streamout buffers.
For gen12 we set the streamout buffers using 4 separate commands instead of 3DSTATE_SO_BUFFER. Signed-off-by: Plamena Manolova <plamena.manolova@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
665b81e29a
commit
0f610e17bc
2 changed files with 23 additions and 3 deletions
|
|
@ -55,4 +55,14 @@
|
|||
/* The number of bits in our TIMESTAMP queries. */
|
||||
#define TIMESTAMP_BITS 36
|
||||
|
||||
/* For gen12 we set the streamout buffers using 4 separate commands
|
||||
* (3DSTATE_SO_BUFFER_INDEX_*) instead of 3DSTATE_SO_BUFFER. However the layout
|
||||
* of the 3DSTATE_SO_BUFFER_INDEX_* commands is identical to that of
|
||||
* 3DSTATE_SO_BUFFER apart from the SOBufferIndex field, so for now we use the
|
||||
* 3DSTATE_SO_BUFFER command, but change the 3DCommandSubOpcode.
|
||||
* SO_BUFFER_INDEX_0_CMD is actually the 3DCommandSubOpcode for
|
||||
* 3DSTATE_SO_BUFFER_INDEX_0.
|
||||
*/
|
||||
#define SO_BUFFER_INDEX_0_CMD 0x60
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3545,8 +3545,14 @@ iris_set_stream_output_targets(struct pipe_context *ctx,
|
|||
unsigned offset = offsets[i];
|
||||
|
||||
if (!tgt) {
|
||||
iris_pack_command(GENX(3DSTATE_SO_BUFFER), so_buffers, sob)
|
||||
iris_pack_command(GENX(3DSTATE_SO_BUFFER), so_buffers, sob) {
|
||||
#if GEN_GEN < 12
|
||||
sob.SOBufferIndex = i;
|
||||
#else
|
||||
sob._3DCommandOpcode = 0;
|
||||
sob._3DCommandSubOpcode = SO_BUFFER_INDEX_0_CMD + i;
|
||||
#endif
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -3567,6 +3573,12 @@ iris_set_stream_output_targets(struct pipe_context *ctx,
|
|||
offset = 0;
|
||||
|
||||
iris_pack_command(GENX(3DSTATE_SO_BUFFER), so_buffers, sob) {
|
||||
#if GEN_GEN < 12
|
||||
sob.SOBufferIndex = i;
|
||||
#else
|
||||
sob._3DCommandOpcode = 0;
|
||||
sob._3DCommandSubOpcode = SO_BUFFER_INDEX_0_CMD + i;
|
||||
#endif
|
||||
sob.SurfaceBaseAddress =
|
||||
rw_bo(NULL, res->bo->gtt_offset + tgt->base.buffer_offset);
|
||||
sob.SOBufferEnable = true;
|
||||
|
|
@ -3575,8 +3587,6 @@ iris_set_stream_output_targets(struct pipe_context *ctx,
|
|||
sob.MOCS = mocs(res->bo);
|
||||
|
||||
sob.SurfaceSize = MAX2(tgt->base.buffer_size / 4, 1) - 1;
|
||||
|
||||
sob.SOBufferIndex = i;
|
||||
sob.StreamOffset = offset;
|
||||
sob.StreamOutputBufferOffsetAddress =
|
||||
rw_bo(NULL, iris_resource_bo(tgt->offset.res)->gtt_offset +
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue