vkd3d-shader: Dump shaders as soon as possible.

So that they are dumped even if parsing fails, which is a circumstance
in which one likely wants to see the problematic shader.

The downside of that is that for shader types other than HLSL
the profile is not written any more in the filename. This should
not be a big problem, because in those cases the shader describes
its own type.

When dumping an HLSL shader, the id is brought in front of the profile
in the file name, in order to make it more tab-friendly: when dealing
with a directory full of shaders it's likely that the id determines
the profile, but the other way around.
This commit is contained in:
Giovanni Mascellani
2023-10-21 21:35:08 +02:00
committed by Alexandre Julliard
parent ab09c0b45b
commit dd96fe50e2
Notes: Alexandre Julliard 2023-11-02 22:49:26 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/424
4 changed files with 29 additions and 18 deletions

View File

@@ -1324,8 +1324,7 @@ void vkd3d_shader_vnote(struct vkd3d_shader_message_context *context, const stru
void vkd3d_shader_vwarning(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
enum vkd3d_shader_error error, const char *format, va_list args);
void vkd3d_shader_dump_shader(enum vkd3d_shader_source_type source_type,
const char *prefix, const struct vkd3d_shader_code *shader);
void vkd3d_shader_dump_shader(const struct vkd3d_shader_compile_info *compile_info);
void vkd3d_shader_trace_text_(const char *text, size_t size, const char *function);
#define vkd3d_shader_trace_text(text, size) \
vkd3d_shader_trace_text_(text, size, __FUNCTION__)