Skip to content

nvc0: avoid converting a too large value from int to uint8_t

Thomas Andersen requested to merge phomes/mesa:nvc0-conversion into main

I do not understand the code here well enough to tell what the correct behavior is. prog->num_gprs is a unit8_t, so my guess is that the MIN is there to make sure we stay within the limit of that. However the current logic is a bit strange. If info_out.bin.maxGPR + 5 is bellow 256 we use that. If not then we write 256 which converts to 0 in a uint8_t...

The patch changes the upper value to 255.

Fixes a warning with clang

Merge request reports