[Mesa-dev] [PATCH 0/1] r600g: work around shaders allocating too many superflous temporaries
Gert Wollny
gw.fossdev at gmail.com
Tue May 30 12:14:02 UTC 2017
Dear all,
like I pointed out yesterday I've got a workaround for shaders that allocate
too many temporaries after the TGSI pass that can actually be discarded in the
sb pass but would fail before that in the tgsi-to-bc stage.
The patch should not interfere with most shaders that worked before, the only
problem could be with shaders that reserve a valid number of GPRs close to the
limit of 124.
Since I'm only starting to learn how the tgsi to bytecode translation works
I'm not sure about the implications when temporaries are reserved in the
kcache bank range (even though they are later discarded). Maybe
r600_shader_from_tgsi() should actually return with an error
the moment ctx.temp_reg >= 124 or r600_get_temp() > 124.
I'm also aware the it would actually be better to optimize the shader in the
TGSI representation in order to avoid the problem altogether, but before I
can look into that I'll probably have t learn a lot more about the code.
In any case, this patch fixes the problem I had with the Unreal Editor, the tests
are still passing, piglit didn't show me any regressions, and so far I also didn't
see breakage in other program using mesa.
Many thanks for any comments,
Gert Wollny (1):
r600g: work around shaders allocating too many superflous temporaries
src/gallium/drivers/r600/r600_shader.c | 52 +++++++++++++++++++++++++++-------
1 file changed, 42 insertions(+), 10 deletions(-)
--
2.13.0
More information about the mesa-dev
mailing list