vkd3d-shader: Use a hash to build the filename when dumping shaders.

This way the same shader is always dumped to the same path and when
launching the same program over and over we avoid both creating new
copies of the same file each time and overwriting different dumped
shaders.
This commit is contained in:
Giovanni Mascellani
2024-08-12 15:17:30 +02:00
committed by Henri Verbeet
parent 0e72aba0bc
commit 1a0d6a4db4
Notes: Henri Verbeet 2024-08-29 19:26:26 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/992
4 changed files with 70 additions and 26 deletions

View File

@@ -1580,7 +1580,13 @@ int spirv_compile(struct vsir_program *program, uint64_t config_flags,
const struct vkd3d_shader_compile_info *compile_info,
struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context);
void vkd3d_compute_dxbc_checksum(const void *dxbc, size_t size, uint32_t checksum[4]);
enum vkd3d_md5_variant
{
VKD3D_MD5_STANDARD,
VKD3D_MD5_DXBC,
};
void vkd3d_compute_md5(const void *dxbc, size_t size, uint32_t checksum[4], enum vkd3d_md5_variant variant);
int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info,
struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context);