r600g: make condition clearer
The second check in the old code looked pretty much unreachable, esp. because it's not obvious that "max_entries" could be zero. To find out that it was intentional I had to run some checks, and to dig into the old versions of the file. So, rewrite the check to make the intention clear. v2: s/r600/r600g in the title, and per Dieter Nützel's comment wrap lines of condition. Signed-off-by: Constantine Kharlamov <Hi-Angel@yandex.ru> Signed-off-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Dieter Nützel <Dieter@nuetzel-hh.de> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
This commit is contained in:

committed by
Marek Olšák

parent
36e029d356
commit
64cbbd2888
@@ -1688,10 +1688,12 @@ int r600_bytecode_build(struct r600_bytecode *bc)
|
|||||||
unsigned addr;
|
unsigned addr;
|
||||||
int i, r;
|
int i, r;
|
||||||
|
|
||||||
if (!bc->nstack) // If not 0, Stack_size already provided by llvm
|
if (!bc->nstack) { // If not 0, Stack_size already provided by llvm
|
||||||
|
if (bc->stack.max_entries)
|
||||||
bc->nstack = bc->stack.max_entries;
|
bc->nstack = bc->stack.max_entries;
|
||||||
|
else if (bc->type == PIPE_SHADER_VERTEX ||
|
||||||
if ((bc->type == PIPE_SHADER_VERTEX || bc->type == PIPE_SHADER_TESS_EVAL || bc->type == PIPE_SHADER_TESS_CTRL) && !bc->nstack) {
|
bc->type == PIPE_SHADER_TESS_EVAL ||
|
||||||
|
bc->type == PIPE_SHADER_TESS_CTRL)
|
||||||
bc->nstack = 1;
|
bc->nstack = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user