vkd3d-shader/hlsl: Pass a vkd3d_shader_source_list pointer to hlsl_ctx_init().

Instead of storing the list inside struct hlsl_ctx. The source file
names in the list are used by the location information that the HLSL
frontend produces, and end up being referenced by the vsir program. If
we want the vsir program to be able to outlive the hlsl_ctx, its
location information can't reference data owned by the hlsl_ctx.
This commit is contained in:
Henri Verbeet
2025-08-05 21:17:34 +02:00
parent 7c37fc6a8b
commit e7be5aa9fd
Notes: Henri Verbeet 2025-08-07 20:51:41 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1671
3 changed files with 27 additions and 18 deletions

View File

@@ -7192,14 +7192,14 @@ preproc_directive:
{
if (strcmp($2, ctx->location.source_name))
{
if (!vkd3d_shader_source_list_append(&ctx->source_files, $2))
if (!vkd3d_shader_source_list_append(ctx->source_files, $2))
{
ctx->result = VKD3D_ERROR_OUT_OF_MEMORY;
}
else
{
ctx->location.line = $1;
ctx->location.source_name = ctx->source_files.sources[ctx->source_files.count - 1];
ctx->location.source_name = ctx->source_files->sources[ctx->source_files->count - 1];
}
}
vkd3d_free($2);