Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texelFetchOffset wrong value on Android? #18464

Closed
MortimerGoro opened this issue Sep 12, 2017 · 1 comment
Closed

texelFetchOffset wrong value on Android? #18464

MortimerGoro opened this issue Sep 12, 2017 · 1 comment

Comments

@MortimerGoro
Copy link
Contributor

@MortimerGoro MortimerGoro commented Sep 12, 2017

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.

if (image.sub_rect.x < 0.0) {
    uv0 = res.uv_rect.xy;
    uv1 = res.uv_rect.zw;
} else {
    uv0 = res.uv_rect.xy + image.sub_rect.xy;
    uv1 = res.uv_rect.xy + image.sub_rect.zw;
}

Another hint on the Google Pixel: image.sub_rect == image.stretch_size_and_tile_spacing. This values are got using the resource cache:

Image fetch_image(int address) {
    vec4 data[2] = fetch_from_resource_cache_2(address);
    return Image(data[0], data[1]);
}

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.

@MortimerGoro
Copy link
Contributor Author

@MortimerGoro MortimerGoro commented Sep 12, 2017

ups, I wanted to create this on Webrender repo, not in Servo. Moved to servo/webrender#1694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.