mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-16 02:50:19 +01:00
freedreno/a6xx: Inline fd6_draw()
Simplify the code a bit by inlining this helper. Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
This commit is contained in:
parent
fb1c6b89a2
commit
adcd83fb22
1 changed files with 17 additions and 31 deletions
|
|
@ -43,34 +43,6 @@
|
|||
/* some bits in common w/ a4xx: */
|
||||
#include "a4xx/fd4_draw.h"
|
||||
|
||||
static inline void
|
||||
fd6_draw(struct fd_batch *batch, struct fd_ringbuffer *ring,
|
||||
enum pc_di_primtype primtype,
|
||||
enum pc_di_vis_cull_mode vismode,
|
||||
enum pc_di_src_sel src_sel, uint32_t count,
|
||||
uint32_t instances, enum a4xx_index_size idx_type,
|
||||
uint32_t idx_size, uint32_t idx_offset,
|
||||
struct pipe_resource *idx_buffer)
|
||||
{
|
||||
OUT_PKT7(ring, CP_DRAW_INDX_OFFSET, idx_buffer ? 7 : 3);
|
||||
if (vismode == USE_VISIBILITY) {
|
||||
/* leave vis mode blank for now, it will be patched up when
|
||||
* we know if we are binning or not
|
||||
*/
|
||||
OUT_RINGP(ring, DRAW4(primtype, src_sel, idx_type, 0) | 0x2000,
|
||||
&batch->draw_patches);
|
||||
} else {
|
||||
OUT_RING(ring, DRAW4(primtype, src_sel, idx_type, vismode) | 0x2000);
|
||||
}
|
||||
OUT_RING(ring, instances); /* NumInstances */
|
||||
OUT_RING(ring, count); /* NumIndices */
|
||||
if (idx_buffer) {
|
||||
OUT_RING(ring, 0x0); /* XXX */
|
||||
OUT_RELOC(ring, fd_resource(idx_buffer)->bo, idx_offset, 0, 0);
|
||||
OUT_RING (ring, idx_size);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
fd6_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
|
||||
enum pc_di_primtype primtype,
|
||||
|
|
@ -126,9 +98,23 @@ fd6_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
|
|||
src_sel = DI_SRC_SEL_AUTO_INDEX;
|
||||
}
|
||||
|
||||
fd6_draw(batch, ring, primtype, vismode, src_sel,
|
||||
info->count, info->instance_count,
|
||||
idx_type, idx_size, idx_offset, idx_buffer);
|
||||
OUT_PKT7(ring, CP_DRAW_INDX_OFFSET, idx_buffer ? 7 : 3);
|
||||
if (vismode == USE_VISIBILITY) {
|
||||
/* leave vis mode blank for now, it will be patched up when
|
||||
* we know if we are binning or not
|
||||
*/
|
||||
OUT_RINGP(ring, DRAW4(primtype, src_sel, idx_type, 0) | 0x2000,
|
||||
&batch->draw_patches);
|
||||
} else {
|
||||
OUT_RING(ring, DRAW4(primtype, src_sel, idx_type, vismode) | 0x2000);
|
||||
}
|
||||
OUT_RING(ring, info->instance_count); /* NumInstances */
|
||||
OUT_RING(ring, info->count); /* NumIndices */
|
||||
if (idx_buffer) {
|
||||
OUT_RING(ring, 0x0); /* XXX */
|
||||
OUT_RELOC(ring, fd_resource(idx_buffer)->bo, idx_offset, 0, 0);
|
||||
OUT_RING (ring, idx_size);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue