Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uptexelFetchOffset wrong value on Android? #18464
Closed
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'm researching some Android problems (#17621 and #17851). I found that both problems happen on some Android devices (Google Pixel and Nexus 6) but work ok in Samsung Galaxy 7.
I have created a small test with just a 262x372 image in a html and the image is upside down on Google Pixel but ok in S7.
Doing some tests in the ps_image.vs shader I found that the image.sub_rect contains [-1.0, -1.0, -1.0, -1.0] values as expected on the S7, but [262.0, 372.0, 0.0, 0.0] values in the Google Pixel, causing it to go to the else branch.
Another hint on the Google Pixel: image.sub_rect == image.stretch_size_and_tile_spacing. This values are got using the resource cache:
It seems that the texelFetchOffset function is getting the same values for both vec4s on the Pixel. It doesn't make any sense because I printed the sResourceCache texture contents after each update from PBO (creating a helper FBO and using readPixels) and it contains the expected values in the primitive address sent in instanced :
draw_instanced_batch: [PrimitiveInstance { data: [1016, 0, 2147483647, 0, 0, 2050, 0, 0] }]
Pixel 1016x0: 8 8 262 372
Pixel 1017x0: 8 8 262 372
Pixel 1018x0: 262 372 0 0 // pi.prim_address + VECS_PER_PRIM_HEADER = 1016 + 2 = 1018
Pixel 1019x0: -1 -1 -1 -1
The sResourceCache texture contents of Pixel and S7 are exactly the same, but the texelFetchOffset call from fetch_image(prim.specific_prim_address) is getting different values on each device. Any idea what might be going on? I tried to change texture filters and increase sCacheTextureSize to test if the problem only happens in the texture border uvs but no luck yet.