summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2017-06-26 16:46:05 -0500
committerTim Rowley <[email protected]>2017-07-13 08:47:10 -0500
commit185b37f641ca7e9f66b649011cd77d1e4b28040f (patch)
tree26e3aff1ea5d48bfcc7b5ff46fd75496bdbd763e /src/gallium/drivers/swr
parentd8ebcad540e4d34a32d039779bd69f8652e0a450 (diff)
swr/rast: Add support for read-only render targets
Core will ensure hot tiles are loaded for read and write render targets, and will skip all output merger for read-only render targets. Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/api.cpp11
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/state.h3
2 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp
index 49058903c12..855d133920a 100644
--- a/src/gallium/drivers/swr/rasterizer/core/api.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp
@@ -957,13 +957,14 @@ void SetupPipeline(DRAW_CONTEXT *pDC)
(pState->state.depthStencilState.stencilTestEnable ||
pState->state.depthStencilState.stencilWriteEnable)) ? true : false;
- pState->state.colorHottileEnable = pState->state.psState.renderTargetMask;
+
+ uint32_t hotTileEnable = pState->state.psState.renderTargetMask;
// Disable hottile for surfaces with no writes
if (psState.pfnPixelShader != nullptr)
{
DWORD rt;
- uint32_t rtMask = pState->state.colorHottileEnable;
+ uint32_t rtMask = pState->state.psState.renderTargetMask;
while (_BitScanForward(&rt, rtMask))
{
rtMask &= ~(1 << rt);
@@ -973,10 +974,14 @@ void SetupPipeline(DRAW_CONTEXT *pDC)
pState->state.blendState.renderTarget[rt].writeDisableGreen &&
pState->state.blendState.renderTarget[rt].writeDisableBlue)
{
- pState->state.colorHottileEnable &= ~(1 << rt);
+ hotTileEnable &= ~(1 << rt);
}
}
}
+
+ pState->state.colorHottileEnable = hotTileEnable;
+
+
// Setup depth quantization function
if (pState->state.depthHottileEnable)
{
diff --git a/src/gallium/drivers/swr/rasterizer/core/state.h b/src/gallium/drivers/swr/rasterizer/core/state.h
index d9e92807411..7af3f821c53 100644
--- a/src/gallium/drivers/swr/rasterizer/core/state.h
+++ b/src/gallium/drivers/swr/rasterizer/core/state.h
@@ -1139,11 +1139,12 @@ struct SWR_PS_STATE
uint32_t writesODepth : 1; // pixel shader writes to depth
uint32_t usesSourceDepth : 1; // pixel shader reads depth
uint32_t shadingRate : 2; // shading per pixel / sample / coarse pixel
- uint32_t renderTargetMask : 8; // number of render target outputs in use (0-8)
uint32_t posOffset : 2; // type of offset (none, sample, centroid) to add to pixel position
uint32_t barycentricsMask : 3; // which type(s) of barycentric coords does the PS interpolate attributes with
uint32_t usesUAV : 1; // pixel shader accesses UAV
uint32_t forceEarlyZ : 1; // force execution of early depth/stencil test
+
+ uint8_t renderTargetMask; // Mask of render targets written
};
// depth bounds state