mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader: Introduce struct vkd3d_shader_source_list.
This commit is contained in:
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
@@ -7190,23 +7190,19 @@ declaration_statement_list:
|
||||
preproc_directive:
|
||||
PRE_LINE STRING
|
||||
{
|
||||
const char **new_array = NULL;
|
||||
|
||||
ctx->location.line = $1;
|
||||
if (strcmp($2, ctx->location.source_name))
|
||||
new_array = hlsl_realloc(ctx, ctx->source_files,
|
||||
sizeof(*ctx->source_files) * (ctx->source_files_count + 1));
|
||||
|
||||
if (new_array)
|
||||
{
|
||||
ctx->source_files = new_array;
|
||||
ctx->source_files[ctx->source_files_count++] = $2;
|
||||
ctx->location.source_name = $2;
|
||||
}
|
||||
else
|
||||
{
|
||||
vkd3d_free($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];
|
||||
}
|
||||
}
|
||||
vkd3d_free($2);
|
||||
}
|
||||
|
||||
struct_declaration_without_vars:
|
||||
|
Reference in New Issue
Block a user