uint32_t multisample : 1;
};
-union ac_shader_variant_key {
- struct ac_vs_variant_key vs;
- struct ac_fs_variant_key fs;
- struct ac_tes_variant_key tes;
- struct ac_tcs_variant_key tcs;
+struct ac_shader_variant_key {
+ union {
+ struct ac_vs_variant_key vs;
+ struct ac_fs_variant_key fs;
+ struct ac_tes_variant_key tes;
+ struct ac_tcs_variant_key tcs;
+ };
};
struct ac_nir_compiler_options {
struct radv_pipeline_layout *layout;
- union ac_shader_variant_key key;
+ struct ac_shader_variant_key key;
bool unsafe_math;
bool supports_spill;
enum radeon_family family;
static struct radv_shader_variant *radv_shader_variant_create(struct radv_device *device,
struct nir_shader *shader,
struct radv_pipeline_layout *layout,
- const union ac_shader_variant_key *key,
+ const struct ac_shader_variant_key *key,
void** code_out,
unsigned *code_size_out,
bool dump)
gl_shader_stage stage,
const VkSpecializationInfo *spec_info,
struct radv_pipeline_layout *layout,
- const union ac_shader_variant_key *key)
+ const struct ac_shader_variant_key *key)
{
unsigned char sha1[20];
unsigned char gs_copy_sha1[20];
return variant;
}
-static union ac_shader_variant_key
+static struct ac_shader_variant_key
radv_compute_tes_key(bool as_es, bool export_prim_id)
{
- union ac_shader_variant_key key;
+ struct ac_shader_variant_key key;
memset(&key, 0, sizeof(key));
key.tes.as_es = as_es;
/* export prim id only happens when no geom shader */
return key;
}
-static union ac_shader_variant_key
+static struct ac_shader_variant_key
radv_compute_tcs_key(unsigned primitive_mode, unsigned input_vertices)
{
- union ac_shader_variant_key key;
+ struct ac_shader_variant_key key;
memset(&key, 0, sizeof(key));
key.tcs.primitive_mode = primitive_mode;
key.tcs.input_vertices = input_vertices;
nir_shader *tes_nir, *tcs_nir;
void *tes_code = NULL, *tcs_code = NULL;
unsigned tes_code_size = 0, tcs_code_size = 0;
- union ac_shader_variant_key tes_key;
- union ac_shader_variant_key tcs_key;
+ struct ac_shader_variant_key tes_key;
+ struct ac_shader_variant_key tcs_key;
bool dump = (pipeline->device->debug_flags & RADV_DEBUG_DUMP_SHADERS);
tes_key = radv_compute_tes_key(radv_pipeline_has_gs(pipeline),
pipeline->dynamic_state_mask = states;
}
-static union ac_shader_variant_key
+static struct ac_shader_variant_key
radv_compute_vs_key(const VkGraphicsPipelineCreateInfo *pCreateInfo, bool as_es, bool as_ls, bool export_prim_id)
{
- union ac_shader_variant_key key;
+ struct ac_shader_variant_key key;
const VkPipelineVertexInputStateCreateInfo *input_state =
pCreateInfo->pVertexInputState;
}
if (modules[MESA_SHADER_FRAGMENT]) {
- union ac_shader_variant_key key = {0};
+ struct ac_shader_variant_key key = {0};
key.fs.col_format = pipeline->graphics.blend.spi_shader_col_format;
if (pCreateInfo->pMultisampleState &&
pCreateInfo->pMultisampleState->rasterizationSamples > 1)
as_es = true;
else if (pipeline->shaders[MESA_SHADER_FRAGMENT]->info.fs.prim_id_input)
export_prim_id = true;
- union ac_shader_variant_key key = radv_compute_vs_key(pCreateInfo, as_es, as_ls, export_prim_id);
+ struct ac_shader_variant_key key = radv_compute_vs_key(pCreateInfo, as_es, as_ls, export_prim_id);
pipeline->shaders[MESA_SHADER_VERTEX] =
radv_pipeline_compile(pipeline, cache, modules[MESA_SHADER_VERTEX],
}
if (modules[MESA_SHADER_GEOMETRY]) {
- union ac_shader_variant_key key = radv_compute_vs_key(pCreateInfo, false, false, false);
+ struct ac_shader_variant_key key = radv_compute_vs_key(pCreateInfo, false, false, false);
pipeline->shaders[MESA_SHADER_GEOMETRY] =
radv_pipeline_compile(pipeline, cache, modules[MESA_SHADER_GEOMETRY],