mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Parse the RestartStrip() method for stream outputs.
This commit is contained in:
Notes:
Henri Verbeet
2025-04-23 18:18:33 +02:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1458
@@ -3733,6 +3733,7 @@ static void dump_ir_resource_store(struct vkd3d_string_buffer *buffer, const str
|
||||
{
|
||||
[HLSL_RESOURCE_STORE] = "store_resource",
|
||||
[HLSL_RESOURCE_STREAM_APPEND] = "stream_append",
|
||||
[HLSL_RESOURCE_STREAM_RESTART] = "stream_restart",
|
||||
};
|
||||
|
||||
VKD3D_ASSERT(store->store_type < ARRAY_SIZE(type_names));
|
||||
|
@@ -898,6 +898,7 @@ enum hlsl_resource_store_type
|
||||
{
|
||||
HLSL_RESOURCE_STORE,
|
||||
HLSL_RESOURCE_STREAM_APPEND,
|
||||
HLSL_RESOURCE_STREAM_RESTART,
|
||||
};
|
||||
|
||||
struct hlsl_ir_resource_store
|
||||
|
@@ -6251,6 +6251,27 @@ static bool add_so_append_method_call(struct hlsl_ctx *ctx, struct hlsl_block *b
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool add_so_restartstrip_method_call(struct hlsl_ctx *ctx, struct hlsl_block *block, struct hlsl_ir_node *object,
|
||||
const char *name, const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
struct hlsl_deref so_deref;
|
||||
|
||||
if (params->args_count)
|
||||
{
|
||||
hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
|
||||
"Wrong number of arguments to method '%s': expected 0.", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!hlsl_init_deref_from_index_chain(ctx, &so_deref, object))
|
||||
return false;
|
||||
|
||||
hlsl_block_add_resource_store(ctx, block, HLSL_RESOURCE_STREAM_RESTART, &so_deref, NULL, NULL, loc);
|
||||
hlsl_cleanup_deref(&so_deref);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static const struct method_function
|
||||
{
|
||||
const char *name;
|
||||
@@ -6297,6 +6318,7 @@ static const struct method_function uav_methods[] =
|
||||
static const struct method_function so_methods[] =
|
||||
{
|
||||
{ "Append", add_so_append_method_call, "" },
|
||||
{ "RestartStrip", add_so_restartstrip_method_call, "" },
|
||||
};
|
||||
|
||||
static int object_method_function_name_compare(const void *a, const void *b)
|
||||
|
Reference in New Issue
Block a user