mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/fx: Add an option to include empty buffers in the effect binary.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
c509c85f63
commit
e1e6367210
Notes:
Alexandre Julliard
2024-04-03 00:23:27 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/742
@@ -90,6 +90,7 @@ struct fx_write_context
|
||||
int status;
|
||||
|
||||
bool child_effect;
|
||||
bool include_empty_buffers;
|
||||
|
||||
const struct fx_write_context_ops *ops;
|
||||
};
|
||||
@@ -191,6 +192,7 @@ static void fx_write_context_init(struct hlsl_ctx *ctx, const struct fx_write_co
|
||||
list_init(&fx->types);
|
||||
|
||||
fx->child_effect = fx->ops->are_child_effects_supported && ctx->child_effect;
|
||||
fx->include_empty_buffers = version == 4 && ctx->include_empty_buffers;
|
||||
|
||||
hlsl_block_init(&block);
|
||||
hlsl_prepend_global_uniform_copy(fx->ctx, &block);
|
||||
@@ -1065,7 +1067,9 @@ static void write_buffers(struct fx_write_context *fx)
|
||||
|
||||
LIST_FOR_EACH_ENTRY(buffer, &fx->ctx->buffers, struct hlsl_buffer, entry)
|
||||
{
|
||||
if (!buffer->size)
|
||||
if (!buffer->size && !fx->include_empty_buffers)
|
||||
continue;
|
||||
if (!strcmp(buffer->name, "$Params"))
|
||||
continue;
|
||||
|
||||
write_fx_4_buffer(buffer, fx);
|
||||
|
@@ -3622,6 +3622,10 @@ static bool hlsl_ctx_init(struct hlsl_ctx *ctx, const struct vkd3d_shader_compil
|
||||
ctx->warn_implicit_truncation = option->value;
|
||||
break;
|
||||
|
||||
case VKD3D_SHADER_COMPILE_OPTION_INCLUDE_EMPTY_BUFFERS_IN_EFFECTS:
|
||||
ctx->include_empty_buffers = option->value;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -927,6 +927,7 @@ struct hlsl_ctx
|
||||
|
||||
bool semantic_compat_mapping;
|
||||
bool child_effect;
|
||||
bool include_empty_buffers;
|
||||
bool warn_implicit_truncation;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user