diff options
author | Rob Clark <[email protected]> | 2017-06-03 13:36:25 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2017-06-07 12:32:00 -0400 |
commit | 5b60004525876616c4719bb790108db4650b1f49 (patch) | |
tree | cc11b8987407f837a7967a8b2a4087d3a3deaed2 /src/gallium/drivers/freedreno/a5xx/fd5_zsa.c | |
parent | 313f6360aa1204eea8639112d5ddce697a7aabdf (diff) |
freedreno/a5xx: LRZ support
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a5xx/fd5_zsa.c')
-rw-r--r-- | src/gallium/drivers/freedreno/a5xx/fd5_zsa.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_zsa.c b/src/gallium/drivers/freedreno/a5xx/fd5_zsa.c index 7b2be934146..ee8e0fce375 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_zsa.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_zsa.c @@ -45,6 +45,26 @@ fd5_zsa_state_create(struct pipe_context *pctx, so->base = *cso; + switch (cso->depth.func) { + case PIPE_FUNC_LESS: + case PIPE_FUNC_LEQUAL: + so->gras_lrz_cntl = A5XX_GRAS_LRZ_CNTL_ENABLE; + break; + + case PIPE_FUNC_GREATER: + case PIPE_FUNC_GEQUAL: + so->gras_lrz_cntl = A5XX_GRAS_LRZ_CNTL_ENABLE | A5XX_GRAS_LRZ_CNTL_GREATER; + break; + + default: + /* LRZ not enabled */ + so->gras_lrz_cntl = 0; + break; + } + + if (!(cso->stencil->enabled || cso->alpha.enabled || !cso->depth.writemask)) + so->lrz_write = true; + so->rb_depth_cntl |= A5XX_RB_DEPTH_CNTL_ZFUNC(cso->depth.func); /* maps 1:1 */ |