mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader: Allocate temporary registers for anonymous expressions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
16163021b9
commit
e957d3a346
@ -171,6 +171,7 @@ struct hlsl_ir_node
|
|||||||
* true even for loops, since currently we can't have a reference to a
|
* true even for loops, since currently we can't have a reference to a
|
||||||
* value generated in an earlier iteration of the loop. */
|
* value generated in an earlier iteration of the loop. */
|
||||||
unsigned int index, last_read;
|
unsigned int index, last_read;
|
||||||
|
struct hlsl_reg reg;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hlsl_src
|
struct hlsl_src
|
||||||
|
@ -747,6 +747,18 @@ static void allocate_temp_registers_recurse(struct list *instrs, struct liveness
|
|||||||
|
|
||||||
LIST_FOR_EACH_ENTRY(instr, instrs, struct hlsl_ir_node, entry)
|
LIST_FOR_EACH_ENTRY(instr, instrs, struct hlsl_ir_node, entry)
|
||||||
{
|
{
|
||||||
|
if (!instr->reg.allocated && instr->last_read)
|
||||||
|
{
|
||||||
|
if (instr->data_type->reg_size > 1)
|
||||||
|
instr->reg = allocate_range(liveness, instr->index,
|
||||||
|
instr->last_read, instr->data_type->reg_size);
|
||||||
|
else
|
||||||
|
instr->reg = allocate_register(liveness, instr->index,
|
||||||
|
instr->last_read, instr->data_type->dimx);
|
||||||
|
TRACE("Allocated anonymous expression @%u to %s (liveness %u-%u).\n", instr->index,
|
||||||
|
debug_register('r', instr->reg, instr->data_type), instr->index, instr->last_read);
|
||||||
|
}
|
||||||
|
|
||||||
switch (instr->type)
|
switch (instr->type)
|
||||||
{
|
{
|
||||||
case HLSL_IR_IF:
|
case HLSL_IR_IF:
|
||||||
|
Reference in New Issue
Block a user