summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_wpos_center.c
Commit message (Collapse)AuthorAgeFilesLines
* nir: Fix crash in nir_lower_wpos_center().Kenneth Graunke2016-05-201-1/+1
| | | | | | | | | Otherwise we rewrote the fadd to use itself, causing crashes in validation. Instead, start after the last use like we should. A brown paper bag fix. Fixes crashes in several Vulkan tests. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
* nir: Add a simple nir_lower_wpos_center() pass for Vulkan drivers.Kenneth Graunke2016-05-201-0/+107
nir_lower_wpos_ytransform() is great for OpenGL, which allows applications to choose whether their coordinate system's origin is upper left/lower left, and whether the pixel center should be on integer/half-integer boundaries. Vulkan, however, has much simpler requirements: the pixel center is always half-integer, and the origin is always upper left. No coordinate transform is needed - we just need to add <0.5, 0.5>. This means that we can avoid using (and setting up) a uniform. I thought about adding more options to nir_lower_wpos_ytransform(), but making a new pass that never even touched uniforms seemed simpler. v2: Use normal iterator rather than _safe variant (noticed by Matt). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Rob Clark <robdclark@gmail.com>