anv: get rid of duplicated values from gen_device_info

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Lionel Landwerlin
2016-09-23 01:04:25 +03:00
parent 94d0e7dc08
commit 6b21728c4a
6 changed files with 28 additions and 43 deletions

View File

@@ -924,8 +924,9 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
if (size == 0) {
/* We own the lock. Allocate a buffer */
struct anv_physical_device *physical_device =
const struct anv_physical_device *physical_device =
&device->instance->physicalDevice;
const struct gen_device_info *devinfo = &physical_device->info;
/* WaCSScratchSize:hsw
*
@@ -944,14 +945,14 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
*/
const unsigned subslices = MAX2(physical_device->subslice_total, 1);
const unsigned scratch_ids_per_subslice =
device->info.is_haswell ? 16 * 8 : physical_device->max_cs_threads;
device->info.is_haswell ? 16 * 8 : devinfo->max_cs_threads;
uint32_t max_threads[] = {
[MESA_SHADER_VERTEX] = physical_device->max_vs_threads,
[MESA_SHADER_TESS_CTRL] = physical_device->max_hs_threads,
[MESA_SHADER_TESS_EVAL] = physical_device->max_ds_threads,
[MESA_SHADER_GEOMETRY] = physical_device->max_gs_threads,
[MESA_SHADER_FRAGMENT] = physical_device->max_wm_threads,
[MESA_SHADER_VERTEX] = devinfo->max_vs_threads,
[MESA_SHADER_TESS_CTRL] = devinfo->max_hs_threads,
[MESA_SHADER_TESS_EVAL] = devinfo->max_ds_threads,
[MESA_SHADER_GEOMETRY] = devinfo->max_gs_threads,
[MESA_SHADER_FRAGMENT] = devinfo->max_wm_threads,
[MESA_SHADER_COMPUTE] = scratch_ids_per_subslice * subslices,
};