Created attachment 105711 [details] Use bool from UBO as if-statement condition The attached shader causes the following assertion failure: shader_runner: brw_vec4_visitor.cpp:856: void brw::vec4_visitor::emit_bool_to_cond_code(ir_rvalue*, brw_predicate*): Assertion `!"not reached"' failed. I have only tested on a fairly stale version of my gles3conform-v5 branch, so this issue may not exist in 10.3 or master branches. If I don't submit a bug, I'll forget about it...
Changing the line if (b1) to if (b1 == true) causes it to not assert.
Created attachment 105714 [details] Use bool from UBO as if-statement condition (in FS) Yeah, we need to handle ir_unop_ubo_load in that switch statement. In both backends.
Created attachment 105715 [details] Use bool for UBO as if-statement condition (in FS, v2) Whoops, that FS test had the wrong result. Here's a better one.
Patches on the mailing list: http://lists.freedesktop.org/archives/mesa-dev/2014-September/067204.html http://lists.freedesktop.org/archives/mesa-dev/2014-September/067206.html http://lists.freedesktop.org/archives/mesa-dev/2014-September/067205.html The last one should fix it. It may or may not depend on the second. The first is just a bug fix while I was in the area :)
Fixed by: commit a20cc2796f5d55e49956ac0bc5d61ca027eec7f9 Author: Kenneth Graunke <kenneth@whitecape.org> Date: Thu Sep 4 00:18:45 2014 -0700 i965: Handle ir_binop_ubo_load in boolean expression code. UBO loads can be boolean-valued expressions, too, so we need to handle them in emit_bool_to_cond_code() and emit_if_gen6(). However, unlike most expressions, it doesn't make sense to evaluate their operands, then do something with the results. We just want to evaluate the UBO load as a whole---which performs the read from memory---then load the boolean result into the flag register. Instead of adding code to handle it, we can simply bypass the ir_expression handling, and fall through to the default code, which will do exactly that. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83468 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Cc: mesa-stable@lists.freedesktop.org Commit a318e2f3 on 10.3 branch.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.