aco,radeonsi: GFX11 dEQP-GLES31.functional.separate_shader.random.0 fail when AMD_DEBUG=useaco
This test will use VS+PS shader, compiled two times: as normal program and as program pipeline. Program pipeline is OpenGL way to compile program which only contains VS or PS, then combine two programs into a pipeline for draw. This test compile same shader, so expect the draw result should be the same.
But the ACO compiled pipeline program has corruption (pink pixels):
Normal program results:
Narrow down the problem to ACO compiled PS. Input NIR is same for both LLVM and ACO.
The pink pixels are caused by last flat input var7
. When compiled with normal program, linker will pack PS inputs, while pipeline program won't, so it reach to attr8.
The corruption result looks like !25492 (c7e08acd)
If I remove this fix, llvm will generate similar results but the corruption input is not var7
.
Here is a simple program to reproduce: https://github.com/yuq/gfx/tree/master/base/gbm-surface-program-pipeline
AMD_DEBUG=useaco,ps,nir,asm ./test.out # use normal program
AMD_DEBUG=useaco,ps,nir,asm ./test.out 1 # use program pipeline