summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2018-04-16 23:18:28 -0500
committerGeorge Kyriazis <[email protected]>2018-04-27 14:36:41 -0500
commit7986519d501a183dad06c175518e0ee0ad2cb6e4 (patch)
tree6a8d02e694b749e6d5953287b899eabc2b4d7679 /src/gallium
parent6b1c852ebc98f4328b83bc0c9c2024ff8da4cb9d (diff)
swr/rast: Use different handing for stream masks
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/swr/rasterizer/common/os.h3
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/api.cpp4
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/frontend.cpp6
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/state.h2
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp2
5 files changed, 11 insertions, 6 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/common/os.h b/src/gallium/drivers/swr/rasterizer/common/os.h
index 5cfd12ff72a..e779562225e 100644
--- a/src/gallium/drivers/swr/rasterizer/common/os.h
+++ b/src/gallium/drivers/swr/rasterizer/common/os.h
@@ -209,6 +209,9 @@ unsigned char _BitScanReverse(unsigned int *Index, unsigned int Mask)
return (Mask != 0);
}
+#define _BitScanForward64 _BitScanForward
+#define _BitScanReverse64 _BitScanReverse
+
inline
void *AlignedMalloc(size_t size, size_t alignment)
{
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp
index e37e2e4a538..a2ee85d12b8 100644
--- a/src/gallium/drivers/swr/rasterizer/core/api.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp
@@ -976,14 +976,14 @@ void SetupPipeline(DRAW_CONTEXT *pDC)
if (pState->state.soState.soEnable)
{
- uint32_t streamMasks = 0;
+ uint64_t streamMasks = 0;
for (uint32_t i = 0; i < 4; ++i)
{
streamMasks |= pState->state.soState.streamMasks[i];
}
DWORD maxAttrib;
- if (_BitScanReverse(&maxAttrib, streamMasks))
+ if (_BitScanReverse64(&maxAttrib, streamMasks))
{
pState->state.feNumAttributes = std::max(pState->state.feNumAttributes, (uint32_t)(maxAttrib + 1));
}
diff --git a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
index 6e2bab3e234..1847c3e822d 100644
--- a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
@@ -528,10 +528,10 @@ static void StreamOut(
for (uint32_t primIndex = 0; primIndex < numPrims; ++primIndex)
{
DWORD slot = 0;
- uint32_t soMask = soState.streamMasks[streamIndex];
+ uint64_t soMask = soState.streamMasks[streamIndex];
// Write all entries into primitive data buffer for SOS.
- while (_BitScanForward(&slot, soMask))
+ while (_BitScanForward64(&slot, soMask))
{
simd4scalar attrib[MAX_NUM_VERTS_PER_PRIM]; // prim attribs (always 4 wide)
uint32_t paSlot = slot + soState.vertexAttribOffset[streamIndex];
@@ -551,7 +551,7 @@ static void StreamOut(
_mm_store_ps((float*)pPrimDataAttrib, attrib[v]);
}
- soMask &= ~(1 << slot);
+ soMask &= ~(uint64_t(1) << slot);
}
// Update pPrimData pointer
diff --git a/src/gallium/drivers/swr/rasterizer/core/state.h b/src/gallium/drivers/swr/rasterizer/core/state.h
index 217cf44c58f..f160913a652 100644
--- a/src/gallium/drivers/swr/rasterizer/core/state.h
+++ b/src/gallium/drivers/swr/rasterizer/core/state.h
@@ -702,7 +702,7 @@ struct SWR_STREAMOUT_STATE
// The stream masks specify which attributes are sent to which streams.
// These masks help the FE to setup the pPrimData buffer that is passed
// the Stream Output Shader (SOS) function.
- uint32_t streamMasks[MAX_SO_STREAMS];
+ uint64_t streamMasks[MAX_SO_STREAMS];
// Number of attributes, including position, per vertex that are streamed out.
// This should match number of bits in stream mask.
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp b/src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp
index 15a6bc40289..f804900291e 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp
@@ -313,6 +313,7 @@ struct StreamOutJit : public Builder
JitManager::DumpToFile(soFunc, "SoFunc_optimized");
+
return soFunc;
}
};
@@ -333,6 +334,7 @@ PFN_SO_FUNC JitStreamoutFunc(HANDLE hJitMgr, const HANDLE hFunc)
pJitMgr->DumpAsm(func, "SoFunc_optimized");
+
return pfnStreamOut;
}