turnip: use global bo for clear blit shaders
[mesa.git] / src / freedreno / vulkan / tu_private.h
index 6486e3293fb1c6ac2e5fb75795e70f7cd7e6771a..f6a66c60c419df44a54eeb3a84e336471f090142 100644 (file)
@@ -339,12 +339,25 @@ struct tu_bo
    void *map;
 };
 
+enum global_shader {
+   GLOBAL_SH_VS,
+   GLOBAL_SH_VS_LAYER,
+   GLOBAL_SH_GS_LAYER,
+   GLOBAL_SH_FS_BLIT,
+   GLOBAL_SH_FS_CLEAR0,
+   GLOBAL_SH_FS_CLEAR_MAX = GLOBAL_SH_FS_CLEAR0 + MAX_RTS,
+   GLOBAL_SH_COUNT,
+};
+
 /* This struct defines the layout of the global_bo */
 struct tu6_global
 {
    /* 6 bcolor_entry entries, one for each VK_BORDER_COLOR */
    uint8_t border_color[128 * 6];
 
+   /* clear/blit shaders, all <= 16 instrs (16 instr = 1 instrlen unit) */
+   instr_t shaders[GLOBAL_SH_COUNT][16];
+
    uint32_t seqno_dummy;          /* dummy seqno for CP_EVENT_WRITE */
    uint32_t _pad0;
    volatile uint32_t vsc_draw_overflow;
@@ -361,6 +374,8 @@ struct tu6_global
 #define gb_offset(member) offsetof(struct tu6_global, member)
 #define global_iova(cmd, member) ((cmd)->device->global_bo.iova + gb_offset(member))
 
+void tu_init_clear_blit_shaders(struct tu6_global *global);
+
 /* extra space in vsc draw/prim streams */
 #define VSC_PAD 0x40