mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
i965/fs: Combine assign_constant_locations and move_uniform_array_access_to_pull_constants
The comment above move_uniform_array_access_to_pull_constants was completely bogus because it has nothing to do with lowering instructions. Instead, it's assiging locations of pull constants. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
c999a58f50
commit
dfacae3a56
2 changed files with 11 additions and 30 deletions
|
|
@ -1766,21 +1766,21 @@ fs_visitor::compact_virtual_grfs()
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Implements array access of uniforms by inserting a
|
* Assign UNIFORM file registers to either push constants or pull constants.
|
||||||
* PULL_CONSTANT_LOAD instruction.
|
|
||||||
*
|
*
|
||||||
* Unlike temporary GRF array access (where we don't support it due to
|
* We allow a fragment shader to have more than the specified minimum
|
||||||
* the difficulty of doing relative addressing on instruction
|
* maximum number of fragment shader uniform components (64). If
|
||||||
* destinations), we could potentially do array access of uniforms
|
* there are too many of these, they'd fill up all of register space.
|
||||||
* that were loaded in GRF space as push constants. In real-world
|
* So, this will push some of them out to the pull constant buffer and
|
||||||
* usage we've seen, though, the arrays being used are always larger
|
* update the program to load them. We also use pull constants for all
|
||||||
* than we could load as push constants, so just always move all
|
* indirect constant loads because we don't support indirect accesses in
|
||||||
* uniform array access out to a pull constant buffer.
|
* registers yet.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
fs_visitor::move_uniform_array_access_to_pull_constants()
|
fs_visitor::assign_constant_locations()
|
||||||
{
|
{
|
||||||
|
/* Only the first compile (SIMD8 mode) gets to decide on locations. */
|
||||||
if (dispatch_width != 8)
|
if (dispatch_width != 8)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -1817,23 +1817,6 @@ fs_visitor::move_uniform_array_access_to_pull_constants()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Assign UNIFORM file registers to either push constants or pull constants.
|
|
||||||
*
|
|
||||||
* We allow a fragment shader to have more than the specified minimum
|
|
||||||
* maximum number of fragment shader uniform components (64). If
|
|
||||||
* there are too many of these, they'd fill up all of register space.
|
|
||||||
* So, this will push some of them out to the pull constant buffer and
|
|
||||||
* update the program to load them.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
fs_visitor::assign_constant_locations()
|
|
||||||
{
|
|
||||||
/* Only the first compile (SIMD8 mode) gets to decide on locations. */
|
|
||||||
if (dispatch_width != 8)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Find which UNIFORM registers are still in use. */
|
/* Find which UNIFORM registers are still in use. */
|
||||||
bool is_live[uniforms];
|
bool is_live[uniforms];
|
||||||
|
|
@ -4805,7 +4788,6 @@ fs_visitor::optimize()
|
||||||
|
|
||||||
split_virtual_grfs();
|
split_virtual_grfs();
|
||||||
|
|
||||||
move_uniform_array_access_to_pull_constants();
|
|
||||||
assign_constant_locations();
|
assign_constant_locations();
|
||||||
demote_pull_constants();
|
demote_pull_constants();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,6 @@ public:
|
||||||
void spill_reg(int spill_reg);
|
void spill_reg(int spill_reg);
|
||||||
void split_virtual_grfs();
|
void split_virtual_grfs();
|
||||||
bool compact_virtual_grfs();
|
bool compact_virtual_grfs();
|
||||||
void move_uniform_array_access_to_pull_constants();
|
|
||||||
void assign_constant_locations();
|
void assign_constant_locations();
|
||||||
void demote_pull_constants();
|
void demote_pull_constants();
|
||||||
void invalidate_live_intervals();
|
void invalidate_live_intervals();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue