Add `formatType` arg to computeSkipBytes.
Fix texture upload format tests:
- Format tests should definitely run on ES3 also.
- Also set filters to NEAREST since some formats aren't filterable.
- Fix RGB9_E5 test reference encoding and add a test for it.
- True int/uint textures require i/usamplers.
Bug: angleproject:2576
Change-Id: Ia5bac34cdee6554a88db339de443689a71a0cf70
Reviewed-on: https://chromium-review.googlesource.com/1068142
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/formatutils.cpp b/src/libANGLE/formatutils.cpp
index e479276..81b910a 100644
--- a/src/libANGLE/formatutils.cpp
+++ b/src/libANGLE/formatutils.cpp
@@ -1139,17 +1139,18 @@
return bytes.ValueOrDie();
}
-ErrorOrResult<GLuint> InternalFormat::computeSkipBytes(GLuint rowPitch,
- GLuint depthPitch,
- const PixelStoreStateBase &state,
- bool is3D) const
+ErrorOrResult<GLuint> InternalFormat::computeSkipBytes(GLenum formatType,
+ GLuint rowPitch,
+ GLuint depthPitch,
+ const PixelStoreStateBase &state,
+ bool is3D) const
{
CheckedNumeric<GLuint> checkedRowPitch(rowPitch);
CheckedNumeric<GLuint> checkedDepthPitch(depthPitch);
CheckedNumeric<GLuint> checkedSkipImages(static_cast<GLuint>(state.skipImages));
CheckedNumeric<GLuint> checkedSkipRows(static_cast<GLuint>(state.skipRows));
CheckedNumeric<GLuint> checkedSkipPixels(static_cast<GLuint>(state.skipPixels));
- CheckedNumeric<GLuint> checkedPixelBytes(pixelBytes);
+ CheckedNumeric<GLuint> checkedPixelBytes(computePixelBytes(formatType));
auto checkedSkipImagesBytes = checkedSkipImages * checkedDepthPitch;
if (!is3D)
{
@@ -1198,7 +1199,8 @@
}
CheckedNumeric<GLuint> checkedSkipBytes = 0;
- ANGLE_TRY_RESULT(computeSkipBytes(rowPitch, depthPitch, state, is3D), checkedSkipBytes);
+ ANGLE_TRY_RESULT(computeSkipBytes(formatType, rowPitch, depthPitch, state, is3D),
+ checkedSkipBytes);
CheckedNumeric<GLuint> endByte = checkedCopyBytes + checkedSkipBytes;