Created attachment 131825 [details] Piglit test reproducing the problem When comparing a constant to the result of a call to the ballotARB function, or a variable containing the result, an assert in void glsl_to_tgsi_visitor::copy_propagate() can fail. If assertions are disabled, then copy_propagate writes over the end of an allocation, corrupting memory instead. The attached patch to piglit adds a test reproducing the problem. Steps to reproduce: 1) Apply attached patch to piglit 2) Run ./piglit run -t arb_shader_ballot shader results/ballot The newly added test will crash. The test crashes with: state_tracker/st_glsl_to_tgsi.cpp:4936: void glsl_to_tgsi_visitor::copy_propagate(): Assertion `inst->dst[0].file != PROGRAM_TEMPORARY || inst->dst[0].index < this->next_temp' failed. I'm using mesa ada3c3aa3da5d04bd597014dc1b5d4b028313513 with an AMD RX480.
Hi James, thanks for the report. I can reproduce and am investigating.
Created attachment 131885 [details] [review] fix Please try with the attached patch.
The attached patch fixes the issue for me.
Fixed in Mesa master, commit b28938ffce0580e89e6012826900da2b6013b0df ("st/glsl_to_tgsi: use correct writemask when converting generic intrinsics").
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.