mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/dxil: Read global constants in sm6_parser_globals_init().
These are needed for reading metadata.
This commit is contained in:
parent
df4e1b7393
commit
52dc6f252c
Notes:
Alexandre Julliard
2023-10-11 22:54:06 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/400
@ -2156,6 +2156,7 @@ static enum vkd3d_result sm6_parser_globals_init(struct sm6_parser *sm6)
|
|||||||
{
|
{
|
||||||
const struct dxil_block *block = &sm6->root_block;
|
const struct dxil_block *block = &sm6->root_block;
|
||||||
const struct dxil_record *record;
|
const struct dxil_record *record;
|
||||||
|
enum vkd3d_result ret;
|
||||||
uint64_t version;
|
uint64_t version;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
@ -2198,6 +2199,13 @@ static enum vkd3d_result sm6_parser_globals_init(struct sm6_parser *sm6)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < block->child_block_count; ++i)
|
||||||
|
{
|
||||||
|
if (block->child_blocks[i]->id == CONSTANTS_BLOCK
|
||||||
|
&& (ret = sm6_parser_constants_init(sm6, block->child_blocks[i])) < 0)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
return VKD3D_OK;
|
return VKD3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2770,6 +2778,9 @@ static enum vkd3d_result sm6_parser_module_init(struct sm6_parser *sm6, const st
|
|||||||
switch (block->id)
|
switch (block->id)
|
||||||
{
|
{
|
||||||
case CONSTANTS_BLOCK:
|
case CONSTANTS_BLOCK:
|
||||||
|
/* Level 1 (global) constants are already done in sm6_parser_globals_init(). */
|
||||||
|
if (level < 2)
|
||||||
|
break;
|
||||||
function = &sm6->functions[sm6->function_count];
|
function = &sm6->functions[sm6->function_count];
|
||||||
sm6->cur_max_value = function->value_count;
|
sm6->cur_max_value = function->value_count;
|
||||||
return sm6_parser_constants_init(sm6, block);
|
return sm6_parser_constants_init(sm6, block);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user