mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-dxbc: Introduce a helper function to apply actions.
This commit is contained in:
committed by
Alexandre Julliard
parent
143b15fc47
commit
8f529cd0ae
Notes:
Alexandre Julliard
2024-04-04 22:42:25 +02:00
Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/755
@@ -539,6 +539,25 @@ static bool emit_dxbc(const struct vkd3d_shader_dxbc_desc *dxbc_desc, const stru
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool apply_actions(struct vkd3d_shader_dxbc_desc *dxbc_desc,
|
||||||
|
size_t action_count, const struct action *actions)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < action_count; ++i)
|
||||||
|
{
|
||||||
|
const struct action *action = &actions[i];
|
||||||
|
|
||||||
|
switch (action->type)
|
||||||
|
{
|
||||||
|
case ACTION_TYPE_EMIT:
|
||||||
|
if (!emit_dxbc(dxbc_desc, &action->u.emit))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct vkd3d_shader_dxbc_desc dxbc_desc;
|
struct vkd3d_shader_dxbc_desc dxbc_desc;
|
||||||
@@ -549,7 +568,6 @@ int main(int argc, char **argv)
|
|||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
int fail = 1;
|
int fail = 1;
|
||||||
FILE *input;
|
FILE *input;
|
||||||
size_t i;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!parse_command_line(argc, argv, &options))
|
if (!parse_command_line(argc, argv, &options))
|
||||||
@@ -597,22 +615,10 @@ int main(int argc, char **argv)
|
|||||||
if (options.list || options.list_data)
|
if (options.list || options.list_data)
|
||||||
dump_dxbc(&dxbc, &dxbc_desc, &options);
|
dump_dxbc(&dxbc, &dxbc_desc, &options);
|
||||||
|
|
||||||
for (i = 0; i < options.action_count; ++i)
|
fail = !apply_actions(&dxbc_desc, options.action_count, options.actions);
|
||||||
{
|
|
||||||
struct action *action = &options.actions[i];
|
|
||||||
|
|
||||||
switch (action->type)
|
|
||||||
{
|
|
||||||
case ACTION_TYPE_EMIT:
|
|
||||||
if (!emit_dxbc(&dxbc_desc, &action->u.emit))
|
|
||||||
goto done;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vkd3d_shader_free_dxbc(&dxbc_desc);
|
vkd3d_shader_free_dxbc(&dxbc_desc);
|
||||||
vkd3d_shader_free_shader_code(&dxbc);
|
vkd3d_shader_free_shader_code(&dxbc);
|
||||||
fail = 0;
|
|
||||||
done:
|
done:
|
||||||
free(options.actions);
|
free(options.actions);
|
||||||
if (close_input)
|
if (close_input)
|
||||||
|
Reference in New Issue
Block a user