From 8bfb34fd0adf23fdb73cf5e4253b42cb2da58188 Mon Sep 17 00:00:00 2001 From: Alok Hota Date: Mon, 22 Oct 2018 11:53:38 -0500 Subject: [PATCH] swr/rast: enforce use of tile offsets Reviewed-by: Bruce Cherniak --- src/gallium/drivers/swr/rasterizer/core/backend_impl.h | 1 + src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp | 1 + .../drivers/swr/rasterizer/core/backend_singlesample.cpp | 1 + src/gallium/drivers/swr/rasterizer/core/state.h | 2 ++ 4 files changed, 5 insertions(+) diff --git a/src/gallium/drivers/swr/rasterizer/core/backend_impl.h b/src/gallium/drivers/swr/rasterizer/core/backend_impl.h index 83d662bd9a7..b3de4e3e4e9 100644 --- a/src/gallium/drivers/swr/rasterizer/core/backend_impl.h +++ b/src/gallium/drivers/swr/rasterizer/core/backend_impl.h @@ -1056,6 +1056,7 @@ void BackendPixelRate(DRAW_CONTEXT* pDC, { const bool useAlternateOffset = ((xx & SIMD_TILE_X_DIM) != 0); + psContext.alternateOffset = useAlternateOffset ? 1 : 0; simdscalar activeLanes; if (!(work.anyCoveredSamples & MASK)) diff --git a/src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp b/src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp index 9b0b80f766f..03152bb0cf7 100644 --- a/src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp @@ -83,6 +83,7 @@ void BackendSampleRate(DRAW_CONTEXT* pDC, { const bool useAlternateOffset = ((xx & SIMD_TILE_X_DIM) != 0); + psContext.alternateOffset = useAlternateOffset ? 1 : 0; if (T::InputCoverage != SWR_INPUT_COVERAGE_NONE) { diff --git a/src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp b/src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp index 46aabcdf34b..fe76d50fbfa 100644 --- a/src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp @@ -84,6 +84,7 @@ void BackendSingleSample(DRAW_CONTEXT* pDC, { const bool useAlternateOffset = ((xx & SIMD_TILE_X_DIM) != 0); + psContext.alternateOffset = useAlternateOffset ? 1 : 0; simdmask coverageMask = work.coverageMask[0] & MASK; diff --git a/src/gallium/drivers/swr/rasterizer/core/state.h b/src/gallium/drivers/swr/rasterizer/core/state.h index 3f8123250c6..a4d5e873d51 100644 --- a/src/gallium/drivers/swr/rasterizer/core/state.h +++ b/src/gallium/drivers/swr/rasterizer/core/state.h @@ -380,6 +380,8 @@ struct SWR_PS_CONTEXT uint8_t* pColorBuffer[SWR_NUM_RENDERTARGETS]; // IN: Pointers to render target hottiles + uint32_t alternateOffset; // IN: for 8x2 tile backend, which 4x2 do we need to read from + SWR_SHADER_STATS stats; // OUT: shader statistics used for archrast. }; -- 2.30.2