summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nvc0')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_3d.xml.h2
-rw-r--r--src/gallium/drivers/nvc0/nvc0_context.h2
-rw-r--r--src/gallium/drivers/nvc0/nvc0_program.c4
-rw-r--r--src/gallium/drivers/nvc0/nvc0_shader_state.c5
-rw-r--r--src/gallium/drivers/nvc0/nvc0_state_validate.c8
5 files changed, 7 insertions, 14 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_3d.xml.h b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
index 18d27865d71..05f967313eb 100644
--- a/src/gallium/drivers/nvc0/nvc0_3d.xml.h
+++ b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
@@ -84,7 +84,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_LINE_WIDTH_SEPARATE 0x0000020c
-#define NVC0_3D_EARLY_FRAGMENT_TESTS 0x00000210
+#define NVC0_3D_FORCE_EARLY_FRAGMENT_TESTS 0x00000210
#define NVC0_3D_MEM_BARRIER 0x0000021c
#define NVC0_3D_MEM_BARRIER_UNK0 0x00000001
diff --git a/src/gallium/drivers/nvc0/nvc0_context.h b/src/gallium/drivers/nvc0/nvc0_context.h
index 4b35330ef8a..7342a6e664f 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.h
+++ b/src/gallium/drivers/nvc0/nvc0_context.h
@@ -78,7 +78,7 @@ struct nvc0_context {
struct {
boolean flushed;
boolean rasterizer_discard;
- boolean early_z;
+ boolean early_z_forced;
boolean prim_restart;
uint32_t instance_elts; /* bitmask of per-instance elements */
uint32_t instance_base;
diff --git a/src/gallium/drivers/nvc0/nvc0_program.c b/src/gallium/drivers/nvc0/nvc0_program.c
index b403e2ee9f2..e867461fb2e 100644
--- a/src/gallium/drivers/nvc0/nvc0_program.c
+++ b/src/gallium/drivers/nvc0/nvc0_program.c
@@ -479,10 +479,6 @@ nvc0_fp_gen_header(struct nvc0_program *fp, struct nv50_ir_prog_info *info)
}
fp->fp.early_z = info->prop.fp.earlyFragTests;
- if (fp->fp.early_z == FALSE && fp->code_size >= 0x400)
- fp->fp.early_z = !(info->prop.fp.writesDepth ||
- info->prop.fp.usesDiscard ||
- (info->io.globalAccess & 2));
return 0;
}
diff --git a/src/gallium/drivers/nvc0/nvc0_shader_state.c b/src/gallium/drivers/nvc0/nvc0_shader_state.c
index 9d688843473..6cbaaf9d1d8 100644
--- a/src/gallium/drivers/nvc0/nvc0_shader_state.c
+++ b/src/gallium/drivers/nvc0/nvc0_shader_state.c
@@ -110,6 +110,11 @@ nvc0_fragprog_validate(struct nvc0_context *nvc0)
return;
nvc0_program_update_context_state(nvc0, fp, 4);
+ if (fp->fp.early_z != nvc0->state.early_z_forced) {
+ nvc0->state.early_z_forced = fp->fp.early_z;
+ IMMED_NVC0(push, NVC0_3D(FORCE_EARLY_FRAGMENT_TESTS), fp->fp.early_z);
+ }
+
BEGIN_NVC0(push, NVC0_3D(SP_SELECT(5)), 2);
PUSH_DATA (push, 0x51);
PUSH_DATA (push, fp->code_base);
diff --git a/src/gallium/drivers/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nvc0/nvc0_state_validate.c
index f235ba57e36..4211fcdefd5 100644
--- a/src/gallium/drivers/nvc0/nvc0_state_validate.c
+++ b/src/gallium/drivers/nvc0/nvc0_state_validate.c
@@ -442,16 +442,8 @@ static void
nvc0_validate_derived_1(struct nvc0_context *nvc0)
{
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
- boolean early_z;
boolean rasterizer_discard;
- early_z = nvc0->fragprog->fp.early_z && !nvc0->zsa->pipe.alpha.enabled;
-
- if (early_z != nvc0->state.early_z) {
- nvc0->state.early_z = early_z;
- IMMED_NVC0(push, NVC0_3D(EARLY_FRAGMENT_TESTS), early_z);
- }
-
rasterizer_discard = (!nvc0->fragprog || !nvc0->fragprog->hdr[18]) &&
!nvc0->zsa->pipe.depth.enabled && !nvc0->zsa->pipe.stencil[0].enabled;
rasterizer_discard = rasterizer_discard ||