return (Mask != 0);
}
+#define _BitScanForward64 _BitScanForward
+#define _BitScanReverse64 _BitScanReverse
+
inline
void *AlignedMalloc(size_t size, size_t alignment)
{
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));
}
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];
_mm_store_ps((float*)pPrimDataAttrib, attrib[v]);
}
- soMask &= ~(1 << slot);
+ soMask &= ~(uint64_t(1) << slot);
}
// Update pPrimData pointer
// 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.
JitManager::DumpToFile(soFunc, "SoFunc_optimized");
+
return soFunc;
}
};
pJitMgr->DumpAsm(func, "SoFunc_optimized");
+
return pfnStreamOut;
}