GPU: Fix a bug in GPUEngineBase::_CompositeVRAMLineDeferred() where compInfo.target.xCustom was overstepping its bounds in X-dimension only custom buffers. This had the effect of causing undefined coloring when running at custom resolutions. (Regression from commit 8e9e7c4. Fixes #228 and fixes #229.)

This commit is contained in:
rogerman 2018-11-29 13:12:56 -08:00
parent f6938dc80a
commit 6bcd19b3cb
1 changed files with 10 additions and 0 deletions

View File

@ -4011,6 +4011,11 @@ void GPUEngineBase::_CompositeVRAMLineDeferred(GPUEngineCompositorInfo &compInfo
const size_t ssePixCount = (compInfo.line.pixelCount - (compInfo.line.pixelCount % 16)); const size_t ssePixCount = (compInfo.line.pixelCount - (compInfo.line.pixelCount % 16));
for (; i < ssePixCount; i+=16, compInfo.target.xCustom+=16, compInfo.target.xNative = _gpuDstToSrcIndex[compInfo.target.xCustom], compInfo.target.lineColor16+=16, compInfo.target.lineColor32+=16, compInfo.target.lineLayerID+=16) for (; i < ssePixCount; i+=16, compInfo.target.xCustom+=16, compInfo.target.xNative = _gpuDstToSrcIndex[compInfo.target.xCustom], compInfo.target.lineColor16+=16, compInfo.target.lineColor32+=16, compInfo.target.lineLayerID+=16)
{ {
if (compInfo.target.xCustom >= compInfo.line.widthCustom)
{
compInfo.target.xCustom -= compInfo.line.widthCustom;
}
__m128i src[4]; __m128i src[4];
__m128i passMask8; __m128i passMask8;
@ -4076,6 +4081,11 @@ void GPUEngineBase::_CompositeVRAMLineDeferred(GPUEngineCompositorInfo &compInfo
#endif #endif
for (; i < compInfo.line.pixelCount; i++, compInfo.target.xCustom++, compInfo.target.xNative = _gpuDstToSrcIndex[compInfo.target.xCustom], compInfo.target.lineColor16++, compInfo.target.lineColor32++, compInfo.target.lineLayerID++) for (; i < compInfo.line.pixelCount; i++, compInfo.target.xCustom++, compInfo.target.xNative = _gpuDstToSrcIndex[compInfo.target.xCustom], compInfo.target.lineColor16++, compInfo.target.lineColor32++, compInfo.target.lineLayerID++)
{ {
if (compInfo.target.xCustom >= compInfo.line.widthCustom)
{
compInfo.target.xCustom -= compInfo.line.widthCustom;
}
if ( WILLPERFORMWINDOWTEST && (this->_didPassWindowTestNative[compInfo.renderState.selectedLayerID][compInfo.target.xNative] == 0) ) if ( WILLPERFORMWINDOWTEST && (this->_didPassWindowTestNative[compInfo.renderState.selectedLayerID][compInfo.target.xNative] == 0) )
{ {
continue; continue;