summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-03-17 12:22:43 -0600
committerTim Rowley <[email protected]>2016-03-25 14:45:39 -0500
commit9111d63228afffed301bb888eb71af287a0887d3 (patch)
tree85484192ab18841e154464a4a4cfb0f489a873d4 /src/gallium/drivers
parent257db3610a91a9355d8301b8fb6123346f9c1b07 (diff)
swr: [rasterizer] Fix run-time check asserts
One innocuous (uninitialized variable), and one not so innocuous (stack corruption).
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/frontend.cpp4
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/frontend.h11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
index 27afc9640c7..e780ffbf175 100644
--- a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
@@ -243,8 +243,8 @@ void ProcessDiscardInvalidateTiles(
macroTileEndY = (rect.bottom + macroHeight - 1) / macroHeight;
}
- SWR_ASSERT(macroTileEndX < KNOB_NUM_HOT_TILES_X);
- SWR_ASSERT(macroTileEndY < KNOB_NUM_HOT_TILES_Y);
+ SWR_ASSERT(macroTileEndX <= KNOB_NUM_HOT_TILES_X);
+ SWR_ASSERT(macroTileEndY <= KNOB_NUM_HOT_TILES_Y);
macroTileEndX = std::min<uint32_t>(macroTileEndX, KNOB_NUM_HOT_TILES_X);
macroTileEndY = std::min<uint32_t>(macroTileEndY, KNOB_NUM_HOT_TILES_Y);
diff --git a/src/gallium/drivers/swr/rasterizer/core/frontend.h b/src/gallium/drivers/swr/rasterizer/core/frontend.h
index d11de79b01f..f92f88c3226 100644
--- a/src/gallium/drivers/swr/rasterizer/core/frontend.h
+++ b/src/gallium/drivers/swr/rasterizer/core/frontend.h
@@ -146,14 +146,13 @@ float calcDeterminantInt(const __m128i vA, const __m128i vB)
//vMul = [A1*B2 - B1*A2]
vMul = _mm_sub_epi64(vMul, vMul2);
- // According to emmintrin.h __mm_store1_pd(), address must be 16-byte aligned
- OSALIGN(int64_t, 16) result;
- _mm_store1_pd((double*)&result, _mm_castsi128_pd(vMul));
+ int64_t result;
+ _mm_store_sd((double*)&result, _mm_castsi128_pd(vMul));
- double fResult = (double)result;
- fResult = fResult * (1.0 / FIXED_POINT16_SCALE);
+ double dResult = (double)result;
+ dResult = dResult * (1.0 / FIXED_POINT16_SCALE);
- return (float)fResult;
+ return (float)dResult;
}
INLINE