static void
crocus_alloc_push_constants(struct crocus_batch *batch)
{
-#if GFX_VERx10 == 75
- const unsigned push_constant_kb = batch->screen->devinfo.gt == 3 ? 32 : 16;
-#elif GFX_VER == 8
- const unsigned push_constant_kb = 32;
-#else
- const unsigned push_constant_kb = 16;
-#endif
+ const unsigned push_constant_kb =
+ batch->screen->devinfo.max_constant_urb_size_kb;
unsigned size_per_stage = push_constant_kb / 5;
/* For now, we set a static partitioning of the push constant area,
if (devinfo->ver >= 12)
urb_size_kB -= 4 * devinfo->l3_banks;
- const unsigned push_constant_kB =
- (devinfo->ver >= 8 || (devinfo->is_haswell && devinfo->gt == 3)) ? 32 : 16;
+ const unsigned push_constant_kB = devinfo->max_constant_urb_size_kb;
const bool active[4] = { true, tess_present, tess_present, gs_present };
.has_64bit_float = true, \
.has_surface_tile_offset = true, \
.timestamp_frequency = 12500000, \
+ .max_constant_urb_size_kb = 16, \
.cs_prefetch_size = 512
static const struct intel_device_info intel_device_info_ivb_gt1 = {
[MESA_SHADER_GEOMETRY] = 640,
},
},
+ .max_constant_urb_size_kb = 32,
.simulator_id = 9,
};
.max_gs_threads = 504, \
.max_wm_threads = 384, \
.timestamp_frequency = 12500000, \
+ .max_constant_urb_size_kb = 32, \
.cs_prefetch_size = 512
static const struct intel_device_info intel_device_info_bdw_gt1 = {
unsigned max_entries[4];
} urb;
+ /* Maximum size in Kb that can be allocated to constants in the URB, this
+ * is usually divided among the stages for implementing push constants.
+ * See 3DSTATE_PUSH_CONSTANT_ALLOC_*.
+ */
+ unsigned max_constant_urb_size_kb;
+
/**
* Size of the command streamer prefetch. This is important to know for
* self modifying batches.
assert(devinfo.num_thread_per_eu != 0);
assert(devinfo.timestamp_frequency != 0);
assert(devinfo.cs_prefetch_size > 0);
+
+ assert(devinfo.ver < 7 || devinfo.max_constant_urb_size_kb > 0);
}
return 0;
if (stages == cmd_buffer->state.gfx.push_constant_stages)
return;
-#if GFX_VER >= 8
- const unsigned push_constant_kb = 32;
-#elif GFX_VERx10 == 75
- const unsigned push_constant_kb = cmd_buffer->device->info.gt == 3 ? 32 : 16;
-#else
- const unsigned push_constant_kb = 16;
-#endif
+ const unsigned push_constant_kb =
+ cmd_buffer->device->info.max_constant_urb_size_kb;
const unsigned num_stages =
util_bitcount(stages & VK_SHADER_STAGE_ALL_GRAPHICS);
bool tess_present = brw->programs[MESA_SHADER_TESS_EVAL];
unsigned avail_size = 16;
- unsigned multiplier =
- (devinfo->ver >= 8 || (devinfo->is_haswell && devinfo->gt == 3)) ? 2 : 1;
+ unsigned multiplier = devinfo->max_constant_urb_size_kb / 16;
int stages = 2 + gs_present + 2 * tess_present;