const VkPipelineShaderStageCreateInfo *info;
uint8_t spirv_hash[SHA1_DIGEST_LENGTH];
uint8_t dxil_hash[SHA1_DIGEST_LENGTH];
+ uint8_t nir_hash[SHA1_DIGEST_LENGTH];
uint8_t link_hashes[SHA1_DIGEST_LENGTH][2];
} stages[MESA_VULKAN_SHADER_STAGES] = { 0 };
const uint8_t *dxil_hashes[MESA_VULKAN_SHADER_STAGES] = { 0 };
nir_opts.lower_base_vertex = true;
u_foreach_bit(stage, active_stage_mask) {
struct mesa_sha1 nir_hash_ctx;
- uint8_t nir_hash[SHA1_DIGEST_LENGTH];
const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *subgroup_size =
(const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *)
}
_mesa_sha1_update(&nir_hash_ctx, &subgroup_enum, sizeof(subgroup_enum));
_mesa_sha1_update(&nir_hash_ctx, stages[stage].spirv_hash, sizeof(stages[stage].spirv_hash));
- _mesa_sha1_final(&nir_hash_ctx, nir_hash);
+ _mesa_sha1_final(&nir_hash_ctx, stages[stage].nir_hash);
}
struct dzn_nir_options options = {
};
ret = dzn_pipeline_get_nir_shader(device, layout,
- cache, nir_hash,
+ cache, stages[stage].nir_hash,
stages[stage].info, stage,
&options,
&pipeline->templates.shaders[stage].nir);
struct mesa_sha1 dxil_hash_ctx;
_mesa_sha1_init(&dxil_hash_ctx);
-
- if (stage == MESA_SHADER_VERTEX)
- _mesa_sha1_update(&dxil_hash_ctx, attribs_hash, sizeof(attribs_hash));
-
- if (stage == last_raster_stage) {
- _mesa_sha1_update(&dxil_hash_ctx, &yz_flip_mode, sizeof(yz_flip_mode));
- _mesa_sha1_update(&dxil_hash_ctx, &y_flip_mask, sizeof(y_flip_mask));
- _mesa_sha1_update(&dxil_hash_ctx, &z_flip_mask, sizeof(z_flip_mask));
- }
-
- if (stage == MESA_SHADER_FRAGMENT) {
- _mesa_sha1_update(&dxil_hash_ctx, &force_sample_rate_shading, sizeof(force_sample_rate_shading));
- _mesa_sha1_update(&dxil_hash_ctx, &pipeline->use_gs_for_polygon_mode_point, sizeof(pipeline->use_gs_for_polygon_mode_point));
- }
-
+ _mesa_sha1_update(&dxil_hash_ctx, stages[stage].nir_hash, sizeof(stages[stage].nir_hash));
_mesa_sha1_update(&dxil_hash_ctx, stages[stage].spirv_hash, sizeof(stages[stage].spirv_hash));
_mesa_sha1_update(&dxil_hash_ctx, stages[stage].link_hashes[0], sizeof(stages[stage].link_hashes[0]));
_mesa_sha1_update(&dxil_hash_ctx, stages[stage].link_hashes[1], sizeof(stages[stage].link_hashes[1]));
struct mesa_sha1 dxil_hash_ctx;
_mesa_sha1_init(&dxil_hash_ctx);
+ _mesa_sha1_update(&dxil_hash_ctx, nir_hash, sizeof(nir_hash));
_mesa_sha1_update(&dxil_hash_ctx, spirv_hash, sizeof(spirv_hash));
_mesa_sha1_update(&dxil_hash_ctx, bindings_hash, sizeof(bindings_hash));
_mesa_sha1_final(&dxil_hash_ctx, dxil_hash);