WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
212240
PVRTC compressed textures are failing with ANGLE backend
https://bugs.webkit.org/show_bug.cgi?id=212240
Summary
PVRTC compressed textures are failing with ANGLE backend
Dean Jackson
Reported
2020-05-21 16:51:27 PDT
extensions/webgl-compressed-texture-pvrtc.html is failing. uploading data with COMPRESSED_RGB_PVRTC_2BPPV1_IMG produces an INVALID_VALUE
Attachments
Patch for testing
(4.60 KB, patch)
2020-05-21 19:33 PDT
,
Kenneth Russell
no flags
Details
Formatted Diff
Diff
Patch
(7.24 KB, patch)
2020-05-21 20:16 PDT
,
Dean Jackson
kbr
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-05-21 16:51:39 PDT
<
rdar://problem/63517385
>
Kenneth Russell
Comment 2
2020-05-21 17:15:20 PDT
Inside ANGLE, ValidateCompressedTexImage2D in src/libANGLE/validationES2.cpp, this is the code which is failing: GLuint blockSize = 0; if (!formatInfo.computeCompressedImageSize(Extents(width, height, 1), &blockSize)) { context->validationError(GL_INVALID_OPERATION, kIntegerOverflow); return false; } if (imageSize < 0 || static_cast<GLuint>(imageSize) != blockSize) { context->validationError(GL_INVALID_VALUE, kCompressedTextureDimensionsMustMatchData); // <--- fails return false; } Here, imageSize is 32 but blockSize is 0. computeCompressedImageSize failed to compute the compressed image size.
Dean Jackson
Comment 3
2020-05-21 17:23:16 PDT
It comes from formatutils.cpp AddCompressedFormat(&map, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG.... produces a pixelBytes value of 0, because compressedBlockSize is 1, and it is divided by 8 to produce 0.
Dean Jackson
Comment 4
2020-05-21 18:20:06 PDT
If I update the values in formatutils.cpp to use 32 and 16 for blocksize on 4bpp and 2bpp respectively, things start working much better. The rendering looks good too. I still get some errors though: testing COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 4x4 PASS getError was expected value: NO_ERROR : uploading compressed texture PASS getError was expected value: INVALID_OPERATION : trying to generate mipmaps from compressed texture expected actual PASS texture rendered correctly PASS getError was expected value: INVALID_VALUE : non 0 border FAIL getError expected: INVALID_OPERATION. Was INVALID_VALUE : invalid dimensions FAIL getError expected: INVALID_OPERATION. Was INVALID_VALUE : invalid dimensions FAIL getError expected: INVALID_OPERATION. Was INVALID_VALUE : invalid dimensions FAIL getError expected: INVALID_OPERATION. Was INVALID_VALUE : invalid dimensions PASS getError was expected value: NO_ERROR : compressedTexSubImage2D allowed for reloading of complete textures PASS getError was expected value: INVALID_OPERATION : compressedTexSubImage2D not allowed for partial texture updates PASS getError was expected value: INVALID_OPERATION : compressedTexSubImage2D not allowed for partial texture updates PASS getError was expected value: INVALID_OPERATION : compressedTexSubImage2D not allowed for partial texture updates PASS getError was expected value: INVALID_OPERATION : compressedTexSubImage2D not allowed for partial texture updates
Kenneth Russell
Comment 5
2020-05-21 19:33:47 PDT
Created
attachment 400013
[details]
Patch for testing Patch for testing
Kenneth Russell
Comment 6
2020-05-21 19:35:00 PDT
Dean, could you try this patch instead? From reading the PVRTC extension spec:
https://www.khronos.org/registry/OpenGL/extensions/IMG/IMG_texture_compression_pvrtc.txt
I think the compressed block size for 2BPP textures is 16x8, and for 4BPP textures, 8x8. This equates to a block size of 256 bits for both formats.
Dean Jackson
Comment 7
2020-05-21 20:16:27 PDT
Created
attachment 400016
[details]
Patch
EWS Watchlist
Comment 8
2020-05-21 20:17:11 PDT
Note that there are important steps to take when updating ANGLE. See
http://trac.webkit.org/wiki/UpdatingANGLE
Kenneth Russell
Comment 9
2020-05-21 20:17:35 PDT
Comment on
attachment 400016
[details]
Patch LGTM
Kenneth Russell
Comment 10
2020-05-21 20:17:54 PDT
Looks good to me but I think the CQ's going to reject my review bit!
Dean Jackson
Comment 11
2020-05-21 20:21:47 PDT
I will land manually to avoid any robots checking your status!
Dean Jackson
Comment 12
2020-05-21 20:26:46 PDT
Committed
r262044
: <
https://trac.webkit.org/changeset/262044
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug