Browse Source

Made odd height clipping safer by removing the interval directly.

David Piuva 5 years ago
parent
commit
806d4bff37
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Source/DFPSR/render/shader/Shader.cpp

+ 5 - 1
Source/DFPSR/render/shader/Shader.cpp

@@ -270,9 +270,13 @@ inline static void fillShapeSuper(const Shader& shader, ImageRgbaU8Impl *colorBu
 		int outerBlockEnd = roundUpEven(outerEnd);
 		int innerBlockStart = roundUpEven(innerStart);
 		int innerBlockEnd = roundDownEven(innerEnd);
+		// Clip last row if outside on odd height
+		if (y2 >= maxHeight) {
+			lowerRow.right = lowerRow.left;
+		}
 		// Avoid reading outside of the given bound
 		bool hasTop = upperRow.right > upperRow.left;
-		bool hasBottom = lowerRow.right > lowerRow.left && y2 < maxHeight;
+		bool hasBottom = lowerRow.right > lowerRow.left;
 		if (hasTop || hasBottom) {
 			// Initialize pointers
 			if (COLOR_WRITE) {