nir/lower_io: Use b2b for shader and function temporaries
This way we can avoid some unnecessary conversions because there's no need to sanitize to 0/1 for scratch. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5927>
This commit is contained in:
parent
3a2975db98
commit
4815ae51d7
|
@ -920,7 +920,9 @@ build_explicit_io_load(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||||
* standard encoding for booleans rather than forcing a 0/1 boolean.
|
* standard encoding for booleans rather than forcing a 0/1 boolean.
|
||||||
* This should save an instruction or two.
|
* This should save an instruction or two.
|
||||||
*/
|
*/
|
||||||
if (mode == nir_var_mem_shared)
|
if (mode == nir_var_mem_shared ||
|
||||||
|
mode == nir_var_shader_temp ||
|
||||||
|
mode == nir_var_function_temp)
|
||||||
result = nir_b2b1(b, result);
|
result = nir_b2b1(b, result);
|
||||||
else
|
else
|
||||||
result = nir_i2b(b, result);
|
result = nir_i2b(b, result);
|
||||||
|
@ -970,7 +972,9 @@ build_explicit_io_store(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||||
*
|
*
|
||||||
* TODO: Make the native bool bit_size an option.
|
* TODO: Make the native bool bit_size an option.
|
||||||
*/
|
*/
|
||||||
if (mode == nir_var_mem_shared)
|
if (mode == nir_var_mem_shared ||
|
||||||
|
mode == nir_var_shader_temp ||
|
||||||
|
mode == nir_var_function_temp)
|
||||||
value = nir_b2b32(b, value);
|
value = nir_b2b32(b, value);
|
||||||
else
|
else
|
||||||
value = nir_b2i(b, value, 32);
|
value = nir_b2i(b, value, 32);
|
||||||
|
|
Loading…
Reference in New Issue