summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2018-02-23 18:51:18 -0600
committerGeorge Kyriazis <[email protected]>2018-03-09 09:35:52 -0600
commitcfdd35beaf7bf336a096d4ceec13913bc3527049 (patch)
tree69c13087231d9bd2f5b64d6d343997fa55aafc87 /src/gallium/drivers/swr
parent9e25f298eb169c03a566eaea07cf2cc1329012fe (diff)
swr/rast: Add support for generalized late and early z/stencil stats
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r--src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp45
-rw-r--r--src/gallium/drivers/swr/rasterizer/archrast/events.proto28
2 files changed, 73 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp b/src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp
index 918616157eb..0728a85e020 100644
--- a/src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp
+++ b/src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp
@@ -90,6 +90,15 @@ namespace ArchRast
//earlyStencil test compute
mDSSingleSample.earlyStencilTestPassCount += _mm_popcnt_u32(event.data.stencilPassMask);
mDSSingleSample.earlyStencilTestFailCount += _mm_popcnt_u32((!event.data.stencilPassMask) & event.data.coverageMask);
+
+ //earlyZ test single and multi sample
+ mDSCombined.earlyZTestPassCount += _mm_popcnt_u32(event.data.depthPassMask);
+ mDSCombined.earlyZTestFailCount += _mm_popcnt_u32((!event.data.depthPassMask) & event.data.coverageMask);
+
+ //earlyStencil test single and multi sample
+ mDSCombined.earlyStencilTestPassCount += _mm_popcnt_u32(event.data.stencilPassMask);
+ mDSCombined.earlyStencilTestFailCount += _mm_popcnt_u32((!event.data.stencilPassMask) & event.data.coverageMask);
+
mNeedFlush = true;
}
@@ -102,6 +111,15 @@ namespace ArchRast
//earlyStencil test compute
mDSSampleRate.earlyStencilTestPassCount += _mm_popcnt_u32(event.data.stencilPassMask);
mDSSampleRate.earlyStencilTestFailCount += _mm_popcnt_u32((!event.data.stencilPassMask) & event.data.coverageMask);
+
+ //earlyZ test single and multi sample
+ mDSCombined.earlyZTestPassCount += _mm_popcnt_u32(event.data.depthPassMask);
+ mDSCombined.earlyZTestFailCount += _mm_popcnt_u32((!event.data.depthPassMask) & event.data.coverageMask);
+
+ //earlyStencil test single and multi sample
+ mDSCombined.earlyStencilTestPassCount += _mm_popcnt_u32(event.data.stencilPassMask);
+ mDSCombined.earlyStencilTestFailCount += _mm_popcnt_u32((!event.data.stencilPassMask) & event.data.coverageMask);
+
mNeedFlush = true;
}
@@ -126,6 +144,15 @@ namespace ArchRast
//lateStencil test compute
mDSSingleSample.lateStencilTestPassCount += _mm_popcnt_u32(event.data.stencilPassMask);
mDSSingleSample.lateStencilTestFailCount += _mm_popcnt_u32((!event.data.stencilPassMask) & event.data.coverageMask);
+
+ //lateZ test single and multi sample
+ mDSCombined.lateZTestPassCount += _mm_popcnt_u32(event.data.depthPassMask);
+ mDSCombined.lateZTestFailCount += _mm_popcnt_u32((!event.data.depthPassMask) & event.data.coverageMask);
+
+ //lateStencil test single and multi sample
+ mDSCombined.lateStencilTestPassCount += _mm_popcnt_u32(event.data.stencilPassMask);
+ mDSCombined.lateStencilTestFailCount += _mm_popcnt_u32((!event.data.stencilPassMask) & event.data.coverageMask);
+
mNeedFlush = true;
}
@@ -138,6 +165,16 @@ namespace ArchRast
//lateStencil test compute
mDSSampleRate.lateStencilTestPassCount += _mm_popcnt_u32(event.data.stencilPassMask);
mDSSampleRate.lateStencilTestFailCount += _mm_popcnt_u32((!event.data.stencilPassMask) & event.data.coverageMask);
+
+
+ //lateZ test single and multi sample
+ mDSCombined.lateZTestPassCount += _mm_popcnt_u32(event.data.depthPassMask);
+ mDSCombined.lateZTestFailCount += _mm_popcnt_u32((!event.data.depthPassMask) & event.data.coverageMask);
+
+ //lateStencil test single and multi sample
+ mDSCombined.lateStencilTestPassCount += _mm_popcnt_u32(event.data.stencilPassMask);
+ mDSCombined.lateStencilTestFailCount += _mm_popcnt_u32((!event.data.stencilPassMask) & event.data.coverageMask);
+
mNeedFlush = true;
}
@@ -223,6 +260,12 @@ namespace ArchRast
EventHandlerFile::Handle(EarlyStencilSampleRate(drawId, mDSSampleRate.earlyStencilTestPassCount, mDSSampleRate.earlyStencilTestFailCount));
EventHandlerFile::Handle(LateStencilSampleRate(drawId, mDSSampleRate.lateStencilTestPassCount, mDSSampleRate.lateStencilTestFailCount));
+ //combined
+ EventHandlerFile::Handle(EarlyZ(drawId, mDSCombined.earlyZTestPassCount, mDSCombined.earlyZTestFailCount));
+ EventHandlerFile::Handle(LateZ(drawId, mDSCombined.lateZTestPassCount, mDSCombined.lateZTestFailCount));
+ EventHandlerFile::Handle(EarlyStencil(drawId, mDSCombined.earlyStencilTestPassCount, mDSCombined.earlyStencilTestFailCount));
+ EventHandlerFile::Handle(LateStencil(drawId, mDSCombined.lateStencilTestPassCount, mDSCombined.lateStencilTestFailCount));
+
//pixelRate
EventHandlerFile::Handle(EarlyZPixelRate(drawId, mDSPixelRate.earlyZTestPassCount, mDSPixelRate.earlyZTestFailCount));
EventHandlerFile::Handle(LateZPixelRate(drawId, mDSPixelRate.lateZTestPassCount, mDSPixelRate.lateZTestFailCount));
@@ -238,6 +281,7 @@ namespace ArchRast
//Reset Internal Counters
mDSSingleSample = {};
mDSSampleRate = {};
+ mDSCombined = {};
mDSPixelRate = {};
mDSNullPS = {};
@@ -287,6 +331,7 @@ namespace ArchRast
DepthStencilStats mDSSingleSample = {};
DepthStencilStats mDSSampleRate = {};
DepthStencilStats mDSPixelRate = {};
+ DepthStencilStats mDSCombined = {};
DepthStencilStats mDSNullPS = {};
DepthStencilStats mDSOmZ = {};
CStats mClipper = {};
diff --git a/src/gallium/drivers/swr/rasterizer/archrast/events.proto b/src/gallium/drivers/swr/rasterizer/archrast/events.proto
index 4a71e0d36a3..ee5d75b5f2f 100644
--- a/src/gallium/drivers/swr/rasterizer/archrast/events.proto
+++ b/src/gallium/drivers/swr/rasterizer/archrast/events.proto
@@ -175,6 +175,34 @@ event LateStencilSampleRate
uint64_t failCount;
};
+event EarlyZ
+{
+ uint32_t drawId;
+ uint64_t passCount;
+ uint64_t failCount;
+};
+
+event LateZ
+{
+ uint32_t drawId;
+ uint64_t passCount;
+ uint64_t failCount;
+};
+
+event EarlyStencil
+{
+ uint32_t drawId;
+ uint64_t passCount;
+ uint64_t failCount;
+};
+
+event LateStencil
+{
+ uint32_t drawId;
+ uint64_t passCount;
+ uint64_t failCount;
+};
+
event EarlyZNullPS
{
uint32_t drawId;