#include <stdio.h>
#include <stdlib.h>
#include "gen_device_info.h"
+#include "compiler/shader_enums.h"
static const struct gen_device_info gen_device_info_i965 = {
.gen = 4,
.urb = {
.size = 32,
.min_vs_entries = 24,
- .max_vs_entries = 256,
- .max_gs_entries = 256,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 256,
+ [MESA_SHADER_GEOMETRY] = 256,
+ },
},
};
.urb = {
.size = 64,
.min_vs_entries = 24,
- .max_vs_entries = 256,
- .max_gs_entries = 256,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 256,
+ [MESA_SHADER_GEOMETRY] = 256,
+ },
},
};
.urb = {
.size = 128,
.min_vs_entries = 32,
- .max_vs_entries = 512,
- .max_tcs_entries = 32,
.min_ds_entries = 10,
- .max_tes_entries = 288,
- .max_gs_entries = 192,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 512,
+ [MESA_SHADER_TESS_CTRL] = 32,
+ [MESA_SHADER_TESS_EVAL] = 288,
+ [MESA_SHADER_GEOMETRY] = 192,
+ },
},
};
.urb = {
.size = 256,
.min_vs_entries = 32,
- .max_vs_entries = 704,
- .max_tcs_entries = 64,
.min_ds_entries = 10,
- .max_tes_entries = 448,
- .max_gs_entries = 320,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 704,
+ [MESA_SHADER_TESS_CTRL] = 64,
+ [MESA_SHADER_TESS_EVAL] = 448,
+ [MESA_SHADER_GEOMETRY] = 320,
+ },
},
};
.urb = {
.size = 128,
.min_vs_entries = 32,
- .max_vs_entries = 512,
- .max_tcs_entries = 32,
.min_ds_entries = 10,
- .max_tes_entries = 288,
- .max_gs_entries = 192,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 512,
+ [MESA_SHADER_TESS_CTRL] = 32,
+ [MESA_SHADER_TESS_EVAL] = 288,
+ [MESA_SHADER_GEOMETRY] = 192,
+ },
},
};
.urb = {
.size = 128,
.min_vs_entries = 32,
- .max_vs_entries = 640,
- .max_tcs_entries = 64,
.min_ds_entries = 10,
- .max_tes_entries = 384,
- .max_gs_entries = 256,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 640,
+ [MESA_SHADER_TESS_CTRL] = 64,
+ [MESA_SHADER_TESS_EVAL] = 384,
+ [MESA_SHADER_GEOMETRY] = 256,
+ },
},
};
.urb = {
.size = 256,
.min_vs_entries = 64,
- .max_vs_entries = 1664,
- .max_tcs_entries = 128,
.min_ds_entries = 10,
- .max_tes_entries = 960,
- .max_gs_entries = 640,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 1664,
+ [MESA_SHADER_TESS_CTRL] = 128,
+ [MESA_SHADER_TESS_EVAL] = 960,
+ [MESA_SHADER_GEOMETRY] = 640,
+ },
},
};
.urb = {
.size = 512,
.min_vs_entries = 64,
- .max_vs_entries = 1664,
- .max_tcs_entries = 128,
.min_ds_entries = 10,
- .max_tes_entries = 960,
- .max_gs_entries = 640,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 1664,
+ [MESA_SHADER_TESS_CTRL] = 128,
+ [MESA_SHADER_TESS_EVAL] = 960,
+ [MESA_SHADER_GEOMETRY] = 640,
+ },
},
};
.urb = {
.size = 192,
.min_vs_entries = 64,
- .max_vs_entries = 2560,
- .max_tcs_entries = 504,
.min_ds_entries = 34,
- .max_tes_entries = 1536,
- .max_gs_entries = 960,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 2560,
+ [MESA_SHADER_TESS_CTRL] = 504,
+ [MESA_SHADER_TESS_EVAL] = 1536,
+ [MESA_SHADER_GEOMETRY] = 960,
+ },
}
};
.urb = {
.size = 384,
.min_vs_entries = 64,
- .max_vs_entries = 2560,
- .max_tcs_entries = 504,
.min_ds_entries = 34,
- .max_tes_entries = 1536,
- .max_gs_entries = 960,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 2560,
+ [MESA_SHADER_TESS_CTRL] = 504,
+ [MESA_SHADER_TESS_EVAL] = 1536,
+ [MESA_SHADER_GEOMETRY] = 960,
+ },
}
};
.urb = {
.size = 384,
.min_vs_entries = 64,
- .max_vs_entries = 2560,
- .max_tcs_entries = 504,
.min_ds_entries = 34,
- .max_tes_entries = 1536,
- .max_gs_entries = 960,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 2560,
+ [MESA_SHADER_TESS_CTRL] = 504,
+ [MESA_SHADER_TESS_EVAL] = 1536,
+ [MESA_SHADER_GEOMETRY] = 960,
+ },
}
};
.urb = {
.size = 192,
.min_vs_entries = 34,
- .max_vs_entries = 640,
- .max_tcs_entries = 80,
.min_ds_entries = 34,
- .max_tes_entries = 384,
- .max_gs_entries = 256,
+ .max_entries = {
+ [MESA_SHADER_VERTEX] = 640,
+ [MESA_SHADER_TESS_CTRL] = 80,
+ [MESA_SHADER_TESS_EVAL] = 384,
+ [MESA_SHADER_GEOMETRY] = 256,
+ },
}
};
.urb = { \
.size = 384, \
.min_vs_entries = 64, \
- .max_vs_entries = 1856, \
- .max_tcs_entries = 672, \
.min_ds_entries = 34, \
- .max_tes_entries = 1120, \
- .max_gs_entries = 640, \
+ .max_entries = { \
+ [MESA_SHADER_VERTEX] = 1856, \
+ [MESA_SHADER_TESS_CTRL] = 672, \
+ [MESA_SHADER_TESS_EVAL] = 1120, \
+ [MESA_SHADER_GEOMETRY] = 640, \
+ }, \
}
#define GEN9_LP_FEATURES \
.size = 192, \
.min_vs_entries = 34, \
.min_ds_entries = 34, \
- .max_vs_entries = 704, \
- .max_tcs_entries = 256, \
- .max_tes_entries = 416, \
- .max_gs_entries = 256, \
+ .max_entries = { \
+ [MESA_SHADER_VERTEX] = 704, \
+ [MESA_SHADER_TESS_CTRL] = 256, \
+ [MESA_SHADER_TESS_EVAL] = 416, \
+ [MESA_SHADER_GEOMETRY] = 256, \
+ }, \
}
#define GEN9_LP_FEATURES_2X6 \
.size = 128, \
.min_vs_entries = 34, \
.min_ds_entries = 34, \
- .max_vs_entries = 352, \
- .max_tcs_entries = 128, \
- .max_tes_entries = 208, \
- .max_gs_entries = 128, \
+ .max_entries = { \
+ [MESA_SHADER_VERTEX] = 352, \
+ [MESA_SHADER_TESS_CTRL] = 128, \
+ [MESA_SHADER_TESS_EVAL] = 208, \
+ [MESA_SHADER_GEOMETRY] = 128, \
+ }, \
}
static const struct gen_device_info gen_device_info_skl_gt1 = {
ALIGN(device->info.urb.min_vs_entries * vs_entry_size_bytes,
chunk_size_bytes) / chunk_size_bytes;
unsigned vs_wants =
- ALIGN(device->info.urb.max_vs_entries * vs_entry_size_bytes,
+ ALIGN(device->info.urb.max_entries[MESA_SHADER_VERTEX] *
+ vs_entry_size_bytes,
chunk_size_bytes) / chunk_size_bytes - vs_chunks;
unsigned gs_chunks = 0;
gs_chunks = ALIGN(MAX2(gs_granularity, 2) * gs_entry_size_bytes,
chunk_size_bytes) / chunk_size_bytes;
gs_wants =
- ALIGN(device->info.urb.max_gs_entries * gs_entry_size_bytes,
+ ALIGN(device->info.urb.max_entries[MESA_SHADER_GEOMETRY] *
+ gs_entry_size_bytes,
chunk_size_bytes) / chunk_size_bytes - gs_chunks;
}
/* Since we rounded up when computing *_wants, this may be slightly more
* than the maximum allowed amount, so correct for that.
*/
- nr_vs_entries = MIN2(nr_vs_entries, device->info.urb.max_vs_entries);
- nr_gs_entries = MIN2(nr_gs_entries, device->info.urb.max_gs_entries);
+ nr_vs_entries = MIN2(nr_vs_entries,
+ device->info.urb.max_entries[MESA_SHADER_VERTEX]);
+ nr_gs_entries = MIN2(nr_gs_entries,
+ device->info.urb.max_entries[MESA_SHADER_GEOMETRY]);
/* Ensure that we program a multiple of the granularity. */
nr_vs_entries = ROUND_DOWN_TO(nr_vs_entries, vs_granularity);
unsigned vs_chunks =
DIV_ROUND_UP(vs_min_entries * vs_entry_size_bytes, chunk_size_bytes);
unsigned vs_wants =
- DIV_ROUND_UP(devinfo->urb.max_vs_entries * vs_entry_size_bytes,
+ DIV_ROUND_UP(devinfo->urb.max_entries[MESA_SHADER_VERTEX] *
+ vs_entry_size_bytes,
chunk_size_bytes) - vs_chunks;
unsigned gs_chunks = 0;
*/
gs_chunks = DIV_ROUND_UP(MAX2(gs_granularity, 2) * gs_entry_size_bytes,
chunk_size_bytes);
- gs_wants = DIV_ROUND_UP(devinfo->urb.max_gs_entries * gs_entry_size_bytes,
+ gs_wants = DIV_ROUND_UP(devinfo->urb.max_entries[MESA_SHADER_GEOMETRY] *
+ gs_entry_size_bytes,
chunk_size_bytes) - gs_chunks;
}
DIV_ROUND_UP(hs_granularity * hs_entry_size_bytes,
chunk_size_bytes);
hs_wants =
- DIV_ROUND_UP(devinfo->urb.max_tcs_entries * hs_entry_size_bytes,
- chunk_size_bytes) - hs_chunks;
+ DIV_ROUND_UP(devinfo->urb.max_entries[MESA_SHADER_TESS_CTRL] *
+ hs_entry_size_bytes, chunk_size_bytes) - hs_chunks;
ds_chunks =
DIV_ROUND_UP(devinfo->urb.min_ds_entries * ds_entry_size_bytes,
chunk_size_bytes);
ds_wants =
- DIV_ROUND_UP(devinfo->urb.max_tes_entries * ds_entry_size_bytes,
- chunk_size_bytes) - ds_chunks;
+ DIV_ROUND_UP(devinfo->urb.max_entries[MESA_SHADER_TESS_EVAL] *
+ ds_entry_size_bytes, chunk_size_bytes) - ds_chunks;
}
/* There should always be enough URB space to satisfy the minimum
/* Since we rounded up when computing *_wants, this may be slightly more
* than the maximum allowed amount, so correct for that.
*/
- nr_vs_entries = MIN2(nr_vs_entries, devinfo->urb.max_vs_entries);
- nr_hs_entries = MIN2(nr_hs_entries, devinfo->urb.max_tcs_entries);
- nr_ds_entries = MIN2(nr_ds_entries, devinfo->urb.max_tes_entries);
- nr_gs_entries = MIN2(nr_gs_entries, devinfo->urb.max_gs_entries);
+ nr_vs_entries =
+ MIN2(nr_vs_entries, devinfo->urb.max_entries[MESA_SHADER_VERTEX]);
+ nr_hs_entries =
+ MIN2(nr_hs_entries, devinfo->urb.max_entries[MESA_SHADER_TESS_CTRL]);
+ nr_ds_entries =
+ MIN2(nr_ds_entries, devinfo->urb.max_entries[MESA_SHADER_TESS_EVAL]);
+ nr_gs_entries =
+ MIN2(nr_gs_entries, devinfo->urb.max_entries[MESA_SHADER_GEOMETRY]);
/* Ensure that we program a multiple of the granularity. */
nr_vs_entries = ROUND_DOWN_TO(nr_vs_entries, vs_granularity);