zink: do not lower bools to float
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 19 Jul 2019 15:05:19 +0000 (17:05 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:47 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/gallium/drivers/zink/zink_compiler.c

index 74eda10f93fdeb8b5f2ac2dbb4b7722bbe289d7a..0f5e9d4f9f1c978621e1b0766e05261bc5564689 100644 (file)
@@ -1434,7 +1434,7 @@ static SpvId
 get_src_bool(struct ntv_context *ctx, nir_src *src)
 {
    SpvId def = get_src_uint(ctx, src);
-   assert(nir_src_bit_size(*src) == 32);
+   assert(nir_src_bit_size(*src) == 1);
    unsigned num_components = nir_src_num_components(*src);
    return uvec_to_bvec(ctx, def, num_components);
 }
index afe93bff0ed937de732c9bf6b21efb0a37ffa1ac..d5c9a42b29c427d3a6fdf301ca8a133d25a3609a 100644 (file)
@@ -325,7 +325,6 @@ zink_compile_nir(struct zink_screen *screen, struct nir_shader *nir)
    NIR_PASS_V(nir, lower_uniforms_to_ubo);
    NIR_PASS_V(nir, position_to_vulkan);
    NIR_PASS_V(nir, nir_lower_regs_to_ssa);
-   NIR_PASS_V(nir, nir_lower_bool_to_float);
    optimize_nir(nir);
    NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp);
    NIR_PASS_V(nir, lower_discard_if);