diff options
author | Jason Ekstrand <[email protected]> | 2018-10-19 11:14:47 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-12-16 21:03:02 +0000 |
commit | 44227453ec03f5462f1cff5760909a9dba95c61a (patch) | |
tree | 2e66d5f032c9d5c25b6ae4fed259851d06bb7def /src/compiler/nir/nir_builder.h | |
parent | 11dc1307794e811aa8cfa5c9dace713d82db09ec (diff) |
nir: Switch to using 1-bit Booleans for almost everything
This is a squash of a few distinct changes:
glsl,spirv: Generate 1-bit Booleans
Revert "Use 32-bit opcodes in the NIR producers and optimizations"
Revert "nir/builder: Generate 32-bit bool opcodes transparently"
nir/builder: Generate 1-bit Booleans in nir_build_imm_bool
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Tested-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_builder.h')
-rw-r--r-- | src/compiler/nir/nir_builder.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index d8abb7fd027..826e549019a 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -212,9 +212,9 @@ nir_imm_bool(nir_builder *build, bool x) nir_const_value v; memset(&v, 0, sizeof(v)); - v.u32[0] = x ? NIR_TRUE : NIR_FALSE; + v.b[0] = x; - return nir_build_imm(build, 1, 32, v); + return nir_build_imm(build, 1, 1, v); } static inline nir_ssa_def * @@ -976,13 +976,13 @@ nir_load_param(nir_builder *build, uint32_t param_idx) static inline nir_ssa_def * nir_f2b(nir_builder *build, nir_ssa_def *f) { - return nir_f2b32(build, f); + return nir_f2b1(build, f); } static inline nir_ssa_def * nir_i2b(nir_builder *build, nir_ssa_def *i) { - return nir_i2b32(build, i); + return nir_i2b1(build, i); } static inline nir_ssa_def * |