BRW_STATE_RASTERIZER_DISCARD,
BRW_STATE_STATS_WM,
BRW_STATE_UNIFORM_BUFFER,
- BRW_STATE_ATOMIC_BUFFER,
BRW_STATE_IMAGE_UNITS,
BRW_STATE_META_IN_PROGRESS,
BRW_STATE_PUSH_CONSTANT_ALLOCATION,
#define BRW_NEW_RASTERIZER_DISCARD (1ull << BRW_STATE_RASTERIZER_DISCARD)
#define BRW_NEW_STATS_WM (1ull << BRW_STATE_STATS_WM)
#define BRW_NEW_UNIFORM_BUFFER (1ull << BRW_STATE_UNIFORM_BUFFER)
-#define BRW_NEW_ATOMIC_BUFFER (1ull << BRW_STATE_ATOMIC_BUFFER)
#define BRW_NEW_IMAGE_UNITS (1ull << BRW_STATE_IMAGE_UNITS)
#define BRW_NEW_META_IN_PROGRESS (1ull << BRW_STATE_META_IN_PROGRESS)
#define BRW_NEW_PUSH_CONSTANT_ALLOCATION (1ull << BRW_STATE_PUSH_CONSTANT_ALLOCATION)
void brw_upload_ubo_surfaces(struct brw_context *brw, struct gl_program *prog,
struct brw_stage_state *stage_state,
struct brw_stage_prog_data *prog_data);
-void brw_upload_abo_surfaces(struct brw_context *brw,
- const struct gl_program *prog,
- struct brw_stage_state *stage_state,
- struct brw_stage_prog_data *prog_data);
void brw_upload_image_surfaces(struct brw_context *brw,
const struct gl_program *prog,
struct brw_stage_state *stage_state,
.emit = brw_upload_gs_ubo_surfaces,
};
-static void
-brw_upload_gs_abo_surfaces(struct brw_context *brw)
-{
- /* _NEW_PROGRAM */
- const struct gl_program *gp = brw->programs[MESA_SHADER_GEOMETRY];
-
- if (gp) {
- /* BRW_NEW_GS_PROG_DATA */
- brw_upload_abo_surfaces(brw, gp, &brw->gs.base, brw->gs.base.prog_data);
- }
-}
-
-const struct brw_tracked_state brw_gs_abo_surfaces = {
- .dirty = {
- .mesa = _NEW_PROGRAM,
- .brw = BRW_NEW_ATOMIC_BUFFER |
- BRW_NEW_BATCH |
- BRW_NEW_GS_PROG_DATA,
- },
- .emit = brw_upload_gs_abo_surfaces,
-};
-
static void
brw_upload_gs_image_surfaces(struct brw_context *brw)
{
extern const struct brw_tracked_state brw_sf_vp;
extern const struct brw_tracked_state brw_cs_texture_surfaces;
extern const struct brw_tracked_state brw_vs_ubo_surfaces;
-extern const struct brw_tracked_state brw_vs_abo_surfaces;
extern const struct brw_tracked_state brw_vs_image_surfaces;
extern const struct brw_tracked_state brw_tcs_ubo_surfaces;
-extern const struct brw_tracked_state brw_tcs_abo_surfaces;
extern const struct brw_tracked_state brw_tcs_image_surfaces;
extern const struct brw_tracked_state brw_tes_ubo_surfaces;
-extern const struct brw_tracked_state brw_tes_abo_surfaces;
extern const struct brw_tracked_state brw_tes_image_surfaces;
extern const struct brw_tracked_state brw_gs_ubo_surfaces;
-extern const struct brw_tracked_state brw_gs_abo_surfaces;
extern const struct brw_tracked_state brw_gs_image_surfaces;
extern const struct brw_tracked_state brw_renderbuffer_surfaces;
extern const struct brw_tracked_state brw_renderbuffer_read_surfaces;
extern const struct brw_tracked_state brw_tcs_binding_table;
extern const struct brw_tracked_state brw_vs_binding_table;
extern const struct brw_tracked_state brw_wm_ubo_surfaces;
-extern const struct brw_tracked_state brw_wm_abo_surfaces;
extern const struct brw_tracked_state brw_wm_image_surfaces;
extern const struct brw_tracked_state brw_cs_ubo_surfaces;
-extern const struct brw_tracked_state brw_cs_abo_surfaces;
extern const struct brw_tracked_state brw_cs_image_surfaces;
extern const struct brw_tracked_state brw_psp_urb_cbs;
ctx->DriverFlags.NewUniformBuffer = BRW_NEW_UNIFORM_BUFFER;
ctx->DriverFlags.NewShaderStorageBuffer = BRW_NEW_UNIFORM_BUFFER;
ctx->DriverFlags.NewTextureBuffer = BRW_NEW_TEXTURE_BUFFER;
- ctx->DriverFlags.NewAtomicBuffer = BRW_NEW_ATOMIC_BUFFER;
+ ctx->DriverFlags.NewAtomicBuffer = BRW_NEW_UNIFORM_BUFFER;
ctx->DriverFlags.NewImageUnits = BRW_NEW_IMAGE_UNITS;
ctx->DriverFlags.NewDefaultTessLevels = BRW_NEW_DEFAULT_TESS_LEVELS;
ctx->DriverFlags.NewIntelConservativeRasterization = BRW_NEW_CONSERVATIVE_RASTERIZATION;
DEFINE_BIT(BRW_NEW_RASTERIZER_DISCARD),
DEFINE_BIT(BRW_NEW_STATS_WM),
DEFINE_BIT(BRW_NEW_UNIFORM_BUFFER),
- DEFINE_BIT(BRW_NEW_ATOMIC_BUFFER),
DEFINE_BIT(BRW_NEW_IMAGE_UNITS),
DEFINE_BIT(BRW_NEW_META_IN_PROGRESS),
DEFINE_BIT(BRW_NEW_PUSH_CONSTANT_ALLOCATION),
.emit = brw_upload_tcs_ubo_surfaces,
};
-static void
-brw_upload_tcs_abo_surfaces(struct brw_context *brw)
-{
- /* _NEW_PROGRAM */
- const struct gl_program *tcp = brw->programs[MESA_SHADER_TESS_CTRL];
-
- if (tcp) {
- /* BRW_NEW_TCS_PROG_DATA */
- brw_upload_abo_surfaces(brw, tcp, &brw->tcs.base,
- brw->tcs.base.prog_data);
- }
-}
-
-const struct brw_tracked_state brw_tcs_abo_surfaces = {
- .dirty = {
- .mesa = _NEW_PROGRAM,
- .brw = BRW_NEW_ATOMIC_BUFFER |
- BRW_NEW_BATCH |
- BRW_NEW_TCS_PROG_DATA,
- },
- .emit = brw_upload_tcs_abo_surfaces,
-};
-
static void
brw_upload_tcs_image_surfaces(struct brw_context *brw)
{
.emit = brw_upload_tes_ubo_surfaces,
};
-static void
-brw_upload_tes_abo_surfaces(struct brw_context *brw)
-{
- /* _NEW_PROGRAM */
- const struct gl_program *tep = brw->programs[MESA_SHADER_TESS_EVAL];
-
- if (tep) {
- /* BRW_NEW_TES_PROG_DATA */
- brw_upload_abo_surfaces(brw, tep, &brw->tes.base,
- brw->tes.base.prog_data);
- }
-}
-
-const struct brw_tracked_state brw_tes_abo_surfaces = {
- .dirty = {
- .mesa = _NEW_PROGRAM,
- .brw = BRW_NEW_ATOMIC_BUFFER |
- BRW_NEW_BATCH |
- BRW_NEW_TES_PROG_DATA,
- },
- .emit = brw_upload_tes_abo_surfaces,
-};
-
static void
brw_upload_tes_image_surfaces(struct brw_context *brw)
{
.emit = brw_upload_vs_ubo_surfaces,
};
-static void
-brw_upload_vs_abo_surfaces(struct brw_context *brw)
-{
- /* _NEW_PROGRAM */
- const struct gl_program *vp = brw->programs[MESA_SHADER_VERTEX];
-
- if (vp) {
- /* BRW_NEW_VS_PROG_DATA */
- brw_upload_abo_surfaces(brw, vp, &brw->vs.base, brw->vs.base.prog_data);
- }
-}
-
-const struct brw_tracked_state brw_vs_abo_surfaces = {
- .dirty = {
- .mesa = _NEW_PROGRAM,
- .brw = BRW_NEW_ATOMIC_BUFFER |
- BRW_NEW_BATCH |
- BRW_NEW_VS_PROG_DATA,
- },
- .emit = brw_upload_vs_abo_surfaces,
-};
-
static void
brw_upload_vs_image_surfaces(struct brw_context *brw)
{
{
struct gl_context *ctx = &brw->ctx;
- if (!prog)
+ if (!prog || (prog->info.num_ubos == 0 &&
+ prog->info.num_ssbos == 0 &&
+ prog->info.num_abos == 0))
return;
uint32_t *ubo_surf_offsets =
ISL_FORMAT_R32G32B32A32_FLOAT, 0);
}
- uint32_t *ssbo_surf_offsets =
- &stage_state->surf_offset[prog_data->binding_table.ssbo_start] +
- prog->info.num_abos;
+ uint32_t *abo_surf_offsets =
+ &stage_state->surf_offset[prog_data->binding_table.ssbo_start];
+ uint32_t *ssbo_surf_offsets = abo_surf_offsets + prog->info.num_abos;
+
+ for (int i = 0; i < prog->info.num_abos; i++) {
+ struct gl_buffer_binding *binding =
+ &ctx->AtomicBufferBindings[prog->sh.AtomicBuffers[i]->Binding];
+ upload_buffer_surface(brw, binding, &abo_surf_offsets[i],
+ ISL_FORMAT_RAW, RELOC_WRITE);
+ }
for (int i = 0; i < prog->info.num_ssbos; i++) {
struct gl_buffer_binding *binding =
}
stage_state->push_constants_dirty = true;
-
- if (prog->info.num_ubos || prog->info.num_ssbos)
- brw->ctx.NewDriverState |= BRW_NEW_SURFACES;
+ brw->ctx.NewDriverState |= BRW_NEW_SURFACES;
}
static void
.emit = brw_upload_cs_ubo_surfaces,
};
-void
-brw_upload_abo_surfaces(struct brw_context *brw,
- const struct gl_program *prog,
- struct brw_stage_state *stage_state,
- struct brw_stage_prog_data *prog_data)
-{
- struct gl_context *ctx = &brw->ctx;
- uint32_t *surf_offsets =
- &stage_state->surf_offset[prog_data->binding_table.ssbo_start];
-
- if (prog->info.num_abos) {
- for (unsigned i = 0; i < prog->info.num_abos; i++) {
- struct gl_buffer_binding *binding =
- &ctx->AtomicBufferBindings[prog->sh.AtomicBuffers[i]->Binding];
- upload_buffer_surface(brw, binding, &surf_offsets[i],
- ISL_FORMAT_RAW, RELOC_WRITE);
- }
-
- brw->ctx.NewDriverState |= BRW_NEW_SURFACES;
- }
-}
-
-static void
-brw_upload_wm_abo_surfaces(struct brw_context *brw)
-{
- /* _NEW_PROGRAM */
- const struct gl_program *wm = brw->programs[MESA_SHADER_FRAGMENT];
-
- if (wm) {
- /* BRW_NEW_FS_PROG_DATA */
- brw_upload_abo_surfaces(brw, wm, &brw->wm.base, brw->wm.base.prog_data);
- }
-}
-
-const struct brw_tracked_state brw_wm_abo_surfaces = {
- .dirty = {
- .mesa = _NEW_PROGRAM,
- .brw = BRW_NEW_ATOMIC_BUFFER |
- BRW_NEW_BATCH |
- BRW_NEW_FS_PROG_DATA,
- },
- .emit = brw_upload_wm_abo_surfaces,
-};
-
-static void
-brw_upload_cs_abo_surfaces(struct brw_context *brw)
-{
- /* _NEW_PROGRAM */
- const struct gl_program *cp = brw->programs[MESA_SHADER_COMPUTE];
-
- if (cp) {
- /* BRW_NEW_CS_PROG_DATA */
- brw_upload_abo_surfaces(brw, cp, &brw->cs.base, brw->cs.base.prog_data);
- }
-}
-
-const struct brw_tracked_state brw_cs_abo_surfaces = {
- .dirty = {
- .mesa = _NEW_PROGRAM,
- .brw = BRW_NEW_ATOMIC_BUFFER |
- BRW_NEW_BATCH |
- BRW_NEW_CS_PROG_DATA,
- },
- .emit = brw_upload_cs_abo_surfaces,
-};
-
static void
brw_upload_cs_image_surfaces(struct brw_context *brw)
{
*/
&brw_vs_pull_constants,
&brw_vs_ubo_surfaces,
- &brw_vs_abo_surfaces,
&brw_tcs_pull_constants,
&brw_tcs_ubo_surfaces,
- &brw_tcs_abo_surfaces,
&brw_tes_pull_constants,
&brw_tes_ubo_surfaces,
- &brw_tes_abo_surfaces,
&brw_gs_pull_constants,
&brw_gs_ubo_surfaces,
- &brw_gs_abo_surfaces,
&brw_wm_pull_constants,
&brw_wm_ubo_surfaces,
- &brw_wm_abo_surfaces,
&gen6_renderbuffer_surfaces,
&brw_renderbuffer_read_surfaces,
&brw_texture_surfaces,
*/
&brw_vs_pull_constants,
&brw_vs_ubo_surfaces,
- &brw_vs_abo_surfaces,
&brw_tcs_pull_constants,
&brw_tcs_ubo_surfaces,
- &brw_tcs_abo_surfaces,
&brw_tes_pull_constants,
&brw_tes_ubo_surfaces,
- &brw_tes_abo_surfaces,
&brw_gs_pull_constants,
&brw_gs_ubo_surfaces,
- &brw_gs_abo_surfaces,
&brw_wm_pull_constants,
&brw_wm_ubo_surfaces,
- &brw_wm_abo_surfaces,
&gen6_renderbuffer_surfaces,
&brw_renderbuffer_read_surfaces,
&brw_texture_surfaces,
&genX(cs_push_constants),
&genX(cs_pull_constants),
&brw_cs_ubo_surfaces,
- &brw_cs_abo_surfaces,
&brw_cs_texture_surfaces,
&brw_cs_work_groups_surface,
&genX(cs_samplers),
if (intel_obj->Base.UsageHistory & USAGE_TEXTURE_BUFFER)
brw->ctx.NewDriverState |= BRW_NEW_TEXTURE_BUFFER;
if (intel_obj->Base.UsageHistory & USAGE_ATOMIC_COUNTER_BUFFER)
- brw->ctx.NewDriverState |= BRW_NEW_ATOMIC_BUFFER;
+ brw->ctx.NewDriverState |= BRW_NEW_UNIFORM_BUFFER;
mark_buffer_inactive(intel_obj);
mark_buffer_invalid(intel_obj);