return program;
}
-void
-brw_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params)
-{
- switch (brw->gen) {
- case 6:
- gen6_blorp_exec(brw, params);
- break;
- case 7:
- if (brw->is_haswell)
- gen75_blorp_exec(brw, params);
- else
- gen7_blorp_exec(brw, params);
- break;
- case 8:
- gen8_blorp_exec(brw, params);
- break;
- case 9:
- gen9_blorp_exec(brw, params);
- break;
- default:
- /* BLORP is not supported before Gen6. */
- unreachable("not reached");
- }
-}
-
void
blorp_gen6_hiz_op(struct brw_context *brw, struct brw_blorp_surf *surf,
unsigned level, unsigned layer, enum gen6_hiz_op op)
unreachable("not reached");
}
- brw_blorp_exec(brw, ¶ms);
+ struct blorp_batch batch;
+ blorp_batch_init(&brw->blorp, &batch, brw);
+ brw->blorp.exec(&batch, ¶ms);
+ blorp_batch_finish(&batch);
}
extern "C" {
#endif
+struct blorp_batch;
+struct brw_blorp_params;
+
struct blorp_context {
void *driver_ctx;
const void *kernel, uint32_t kernel_size,
const void *prog_data, uint32_t prog_data_size,
uint32_t *kernel_out, void *prog_data_out);
+ void (*exec)(struct blorp_batch *batch,
+ const struct brw_blorp_params *params);
};
void blorp_init(struct blorp_context *blorp, void *driver_ctx,
swizzle_to_scs(GET_SWZ(src_swizzle, i));
}
- brw_blorp_exec(brw, ¶ms);
+ struct blorp_batch batch;
+ blorp_batch_init(&brw->blorp, &batch, brw);
+ brw->blorp.exec(&batch, ¶ms);
+ blorp_batch_finish(&batch);
}
brw_blorp_surface_info_init(brw, ¶ms.dst, surf, level, layer,
surf->surf->format, true);
- brw_blorp_exec(brw, ¶ms);
+ struct blorp_batch batch;
+ blorp_batch_init(&brw->blorp, &batch, brw);
+ brw->blorp.exec(&batch, ¶ms);
+ blorp_batch_finish(&batch);
}
brw_blorp_surface_info_init(brw, ¶ms.dst, surf, level, layer,
format, true);
- brw_blorp_exec(brw, ¶ms);
+ struct blorp_batch batch;
+ blorp_batch_init(&brw->blorp, &batch, brw);
+ brw->blorp.exec(&batch, ¶ms);
+ blorp_batch_finish(&batch);
}
void
brw_blorp_params_get_clear_kernel(brw, ¶ms, true);
- brw_blorp_exec(brw, ¶ms);
+ struct blorp_batch batch;
+ blorp_batch_init(&brw->blorp, &batch, brw);
+ brw->blorp.exec(&batch, ¶ms);
+ blorp_batch_finish(&batch);
}
void
brw_blorp_params_init(struct brw_blorp_params *params);
-void
-brw_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params);
-
-void
-gen6_blorp_exec(struct brw_context *brw,
- const struct brw_blorp_params *params);
-
-void
-gen7_blorp_exec(struct brw_context *brw,
- const struct brw_blorp_params *params);
-
-void
-gen75_blorp_exec(struct brw_context *brw,
- const struct brw_blorp_params *params);
-
-void
-gen8_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params);
-
-void
-gen9_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params);
-
struct brw_blorp_blit_prog_key
{
/* Number of samples per pixel that have been configured in the surface
brw->blorp.mocs.tex = 0;
brw->blorp.mocs.rb = 0;
brw->blorp.mocs.vb = 0;
+ brw->blorp.exec = gen6_blorp_exec;
break;
case 7:
brw->blorp.mocs.tex = GEN7_MOCS_L3;
brw->blorp.mocs.rb = GEN7_MOCS_L3;
brw->blorp.mocs.vb = GEN7_MOCS_L3;
+ if (brw->is_haswell) {
+ brw->blorp.exec = gen75_blorp_exec;
+ } else {
+ brw->blorp.exec = gen7_blorp_exec;
+ }
break;
case 8:
brw->blorp.mocs.tex = BDW_MOCS_WB;
brw->blorp.mocs.rb = BDW_MOCS_PTE;
brw->blorp.mocs.vb = BDW_MOCS_WB;
+ brw->blorp.exec = gen8_blorp_exec;
break;
case 9:
brw->blorp.mocs.tex = SKL_MOCS_WB;
brw->blorp.mocs.rb = SKL_MOCS_PTE;
brw->blorp.mocs.vb = SKL_MOCS_WB;
+ brw->blorp.exec = gen9_blorp_exec;
break;
default:
unreachable("Invalid gen");
intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+void gen6_blorp_exec(struct blorp_batch *batch,
+ const struct brw_blorp_params *params);
+void gen7_blorp_exec(struct blorp_batch *batch,
+ const struct brw_blorp_params *params);
+void gen75_blorp_exec(struct blorp_batch *batch,
+ const struct brw_blorp_params *params);
+void gen8_blorp_exec(struct blorp_batch *batch,
+ const struct brw_blorp_params *params);
+void gen9_blorp_exec(struct blorp_batch *batch,
+ const struct brw_blorp_params *params);
+
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "genX_blorp_exec.h"
+#include "brw_blorp.h"
+
static void *
blorp_emit_dwords(struct blorp_batch *batch, unsigned n)
{
}
void
-genX(blorp_exec)(struct brw_context *brw,
+genX(blorp_exec)(struct blorp_batch *batch,
const struct brw_blorp_params *params)
{
+ assert(batch->blorp->driver_ctx == batch->driver_batch);
+ struct brw_context *brw = batch->driver_batch;
struct gl_context *ctx = &brw->ctx;
const uint32_t estimated_max_batch_usage = GEN_GEN >= 8 ? 1800 : 1500;
bool check_aperture_failed_once = false;
brw_emit_depth_stall_flushes(brw);
- struct blorp_batch batch;
- blorp_batch_init(&brw->blorp, &batch, brw);
- blorp_exec(&batch, params);
- blorp_batch_finish(&batch);
+ blorp_exec(batch, params);
/* Make sure we didn't wrap the batch unintentionally, and make sure we
* reserved enough space that a wrap will never happen.