summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nouveau_mm.c
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-06-19 16:57:50 -0400
committerIlia Mirkin <[email protected]>2016-07-16 11:45:30 -0400
commit062c6b8e54c14adcc1ec603fad524f38fe058e67 (patch)
treebcb4774e8d9225d7f8bf557f299061f310f6f85f /src/gallium/drivers/nouveau/nouveau_mm.c
parentcc46fc3c0921c86baa0fbe25ba6a9c4858f04ab3 (diff)
nv50: fix alphatest for non-blendable formats
The hardware can only do alphatest when using a blendable format. This means that the various *16 norm formats didn't work with alphatest. It appears that Talos Principle uses such formats, as well as alpha tests, for some internal renders, which made them be incorrect. However this does not appear to affect the final renders, but in a different game it easily could. The approach we take is that when alphatests are enabled and a suitable format is used (which we anticipate is the vast minority of the time), we insert code into the shader to perform the comparison and discard. Once inserted, that code lives in the shader forever, and we re-upload it each time the function changes with a fixed-up compare. To avoid re-uploading too often, if we switch back to a blendable format, the test is (effectively) disabled and the hw alphatest functionality is used. Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_mm.c')
0 files changed, 0 insertions, 0 deletions