intel/blorp: Add option to emit packets that disable Mesh
If a driver doesn't support Mesh, don't emit anything. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13660>
This commit is contained in:
@@ -406,7 +406,7 @@ genX(crocus_init_blorp)(struct crocus_context *ice)
|
|||||||
{
|
{
|
||||||
struct crocus_screen *screen = (struct crocus_screen *)ice->ctx.screen;
|
struct crocus_screen *screen = (struct crocus_screen *)ice->ctx.screen;
|
||||||
|
|
||||||
blorp_init(&ice->blorp, ice, &screen->isl_dev);
|
blorp_init(&ice->blorp, ice, &screen->isl_dev, NULL);
|
||||||
ice->blorp.compiler = screen->compiler;
|
ice->blorp.compiler = screen->compiler;
|
||||||
ice->blorp.lookup_shader = crocus_blorp_lookup_shader;
|
ice->blorp.lookup_shader = crocus_blorp_lookup_shader;
|
||||||
ice->blorp.upload_shader = crocus_blorp_upload_shader;
|
ice->blorp.upload_shader = crocus_blorp_upload_shader;
|
||||||
|
@@ -407,7 +407,7 @@ genX(init_blorp)(struct iris_context *ice)
|
|||||||
{
|
{
|
||||||
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
|
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
|
||||||
|
|
||||||
blorp_init(&ice->blorp, ice, &screen->isl_dev);
|
blorp_init(&ice->blorp, ice, &screen->isl_dev, NULL);
|
||||||
ice->blorp.compiler = screen->compiler;
|
ice->blorp.compiler = screen->compiler;
|
||||||
ice->blorp.lookup_shader = iris_blorp_lookup_shader;
|
ice->blorp.lookup_shader = iris_blorp_lookup_shader;
|
||||||
ice->blorp.upload_shader = iris_blorp_upload_shader;
|
ice->blorp.upload_shader = iris_blorp_upload_shader;
|
||||||
|
@@ -48,10 +48,14 @@ blorp_shader_type_to_name(enum blorp_shader_type type)
|
|||||||
|
|
||||||
void
|
void
|
||||||
blorp_init(struct blorp_context *blorp, void *driver_ctx,
|
blorp_init(struct blorp_context *blorp, void *driver_ctx,
|
||||||
struct isl_device *isl_dev)
|
struct isl_device *isl_dev, const struct blorp_config *config)
|
||||||
{
|
{
|
||||||
|
memset(blorp, 0, sizeof(*blorp));
|
||||||
|
|
||||||
blorp->driver_ctx = driver_ctx;
|
blorp->driver_ctx = driver_ctx;
|
||||||
blorp->isl_dev = isl_dev;
|
blorp->isl_dev = isl_dev;
|
||||||
|
if (config)
|
||||||
|
blorp->config = *config;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -38,6 +38,10 @@ extern "C" {
|
|||||||
struct blorp_batch;
|
struct blorp_batch;
|
||||||
struct blorp_params;
|
struct blorp_params;
|
||||||
|
|
||||||
|
struct blorp_config {
|
||||||
|
bool use_mesh_shading;
|
||||||
|
};
|
||||||
|
|
||||||
struct blorp_context {
|
struct blorp_context {
|
||||||
void *driver_ctx;
|
void *driver_ctx;
|
||||||
|
|
||||||
@@ -56,10 +60,12 @@ struct blorp_context {
|
|||||||
uint32_t prog_data_size,
|
uint32_t prog_data_size,
|
||||||
uint32_t *kernel_out, void *prog_data_out);
|
uint32_t *kernel_out, void *prog_data_out);
|
||||||
void (*exec)(struct blorp_batch *batch, const struct blorp_params *params);
|
void (*exec)(struct blorp_batch *batch, const struct blorp_params *params);
|
||||||
|
|
||||||
|
struct blorp_config config;
|
||||||
};
|
};
|
||||||
|
|
||||||
void blorp_init(struct blorp_context *blorp, void *driver_ctx,
|
void blorp_init(struct blorp_context *blorp, void *driver_ctx,
|
||||||
struct isl_device *isl_dev);
|
struct isl_device *isl_dev, const struct blorp_config *config);
|
||||||
void blorp_finish(struct blorp_context *blorp);
|
void blorp_finish(struct blorp_context *blorp);
|
||||||
|
|
||||||
enum blorp_batch_flags {
|
enum blorp_batch_flags {
|
||||||
|
@@ -1388,6 +1388,19 @@ blorp_emit_pipeline(struct blorp_batch *batch,
|
|||||||
/* Disable Primitive Replication. */
|
/* Disable Primitive Replication. */
|
||||||
blorp_emit(batch, GENX(3DSTATE_PRIMITIVE_REPLICATION), pr);
|
blorp_emit(batch, GENX(3DSTATE_PRIMITIVE_REPLICATION), pr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (batch->blorp->config.use_mesh_shading) {
|
||||||
|
#if GFX_VERx10 >= 125
|
||||||
|
blorp_emit(batch, GENX(3DSTATE_URB_ALLOC_MESH), zero);
|
||||||
|
blorp_emit(batch, GENX(3DSTATE_URB_ALLOC_TASK), zero);
|
||||||
|
|
||||||
|
blorp_emit(batch, GENX(3DSTATE_MESH_SHADER), zero);
|
||||||
|
blorp_emit(batch, GENX(3DSTATE_TASK_SHADER), zero);
|
||||||
|
|
||||||
|
blorp_emit(batch, GENX(3DSTATE_MESH_CONTROL), zero);
|
||||||
|
blorp_emit(batch, GENX(3DSTATE_TASK_CONTROL), zero);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/******** This is the end of the pipeline setup code ********/
|
/******** This is the end of the pipeline setup code ********/
|
||||||
|
@@ -92,7 +92,12 @@ upload_blorp_shader(struct blorp_batch *batch, uint32_t stage,
|
|||||||
void
|
void
|
||||||
anv_device_init_blorp(struct anv_device *device)
|
anv_device_init_blorp(struct anv_device *device)
|
||||||
{
|
{
|
||||||
blorp_init(&device->blorp, device, &device->isl_dev);
|
const struct intel_device_info *devinfo = &device->info;
|
||||||
|
const struct blorp_config config = {
|
||||||
|
.use_mesh_shading = devinfo->has_mesh_shading,
|
||||||
|
};
|
||||||
|
|
||||||
|
blorp_init(&device->blorp, device, &device->isl_dev, &config);
|
||||||
device->blorp.compiler = device->physical->compiler;
|
device->blorp.compiler = device->physical->compiler;
|
||||||
device->blorp.lookup_shader = lookup_blorp_shader;
|
device->blorp.lookup_shader = lookup_blorp_shader;
|
||||||
device->blorp.upload_shader = upload_blorp_shader;
|
device->blorp.upload_shader = upload_blorp_shader;
|
||||||
|
@@ -72,7 +72,7 @@ brw_blorp_init(struct brw_context *brw)
|
|||||||
{
|
{
|
||||||
const struct intel_device_info *devinfo = &brw->screen->devinfo;
|
const struct intel_device_info *devinfo = &brw->screen->devinfo;
|
||||||
|
|
||||||
blorp_init(&brw->blorp, brw, &brw->isl_dev);
|
blorp_init(&brw->blorp, brw, &brw->isl_dev, NULL);
|
||||||
|
|
||||||
brw->blorp.compiler = brw->screen->compiler;
|
brw->blorp.compiler = brw->screen->compiler;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user