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_print.c | |
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_print.c')
-rw-r--r-- | src/compiler/nir/nir_print.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 493f44136f4..47932e99639 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -298,6 +298,16 @@ print_constant(nir_constant *c, const struct glsl_type *type, print_state *state unsigned i, j; switch (glsl_get_base_type(type)) { + case GLSL_TYPE_BOOL: + /* Only float base types can be matrices. */ + assert(cols == 1); + + for (i = 0; i < rows; i++) { + if (i > 0) fprintf(fp, ", "); + fprintf(fp, "%s", c->values[0].b[i] ? "true" : "false"); + } + break; + case GLSL_TYPE_UINT8: case GLSL_TYPE_INT8: /* Only float base types can be matrices. */ @@ -322,7 +332,6 @@ print_constant(nir_constant *c, const struct glsl_type *type, print_state *state case GLSL_TYPE_UINT: case GLSL_TYPE_INT: - case GLSL_TYPE_BOOL: /* Only float base types can be matrices. */ assert(cols == 1); |