summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen6_queryobj.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-12-12 00:44:11 -0800
committerKenneth Graunke <kenneth@whitecape.org>2014-01-20 15:38:23 -0800
commitf7e76e00b6d476ad045a70db34908cce31e767fa (patch)
tree1e091c90089815d07c25ef5f846b2e261e8e1a02 /src/mesa/drivers/dri/i965/gen6_queryobj.c
parentf5dd608db2d6a67cfe27efed948408414a057fe3 (diff)
downloadexternal_mesa3d-f7e76e00b6d476ad045a70db34908cce31e767fa.zip
external_mesa3d-f7e76e00b6d476ad045a70db34908cce31e767fa.tar.gz
external_mesa3d-f7e76e00b6d476ad045a70db34908cce31e767fa.tar.bz2
i965: Re-combine the Gen4-5 and Gen6+ write_depth_count functions.
Now that we have a helper function that handles the PIPE_CONTROL variations between the various platforms, these are basically the same. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen6_queryobj.c')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_queryobj.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_queryobj.c b/src/mesa/drivers/dri/i965/gen6_queryobj.c
index e765623..06ac645 100644
--- a/src/mesa/drivers/dri/i965/gen6_queryobj.c
+++ b/src/mesa/drivers/dri/i965/gen6_queryobj.c
@@ -39,22 +39,6 @@
#include "intel_batchbuffer.h"
#include "intel_reg.h"
-/**
- * Emit PIPE_CONTROLs to write the PS_DEPTH_COUNT register into a buffer.
- */
-static void
-write_depth_count(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
-{
- /* Emit Sandybridge workaround flush: */
- if (brw->gen == 6)
- intel_emit_post_sync_nonzero_flush(brw);
-
- brw_emit_pipe_control_write(brw,
- PIPE_CONTROL_WRITE_DEPTH_COUNT
- | PIPE_CONTROL_DEPTH_STALL,
- query_bo, idx * sizeof(uint64_t), 0, 0);
-}
-
/*
* Write an arbitrary 64-bit register to a buffer via MI_STORE_REGISTER_MEM.
*
@@ -252,7 +236,7 @@ gen6_begin_query(struct gl_context *ctx, struct gl_query_object *q)
case GL_ANY_SAMPLES_PASSED:
case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
case GL_SAMPLES_PASSED_ARB:
- write_depth_count(brw, query->bo, 0);
+ brw_write_depth_count(brw, query->bo, 0);
break;
case GL_PRIMITIVES_GENERATED:
@@ -291,7 +275,7 @@ gen6_end_query(struct gl_context *ctx, struct gl_query_object *q)
case GL_ANY_SAMPLES_PASSED:
case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
case GL_SAMPLES_PASSED_ARB:
- write_depth_count(brw, query->bo, 1);
+ brw_write_depth_count(brw, query->bo, 1);
break;
case GL_PRIMITIVES_GENERATED: