Open Bug 1417182 Opened 8 years ago Updated 3 years ago

GLSL fragment shader Texture2D mis-sampled unless refactored to temporary variable

Categories

(Core :: Graphics: CanvasWebGL, defect, P3)

57 Branch
x86_64
Windows 10
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jameswilddev, Unassigned)

Details

(Whiteboard: [gfx-noted])

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299 Steps to reproduce: I'm currently doing some graphics experiments, and have found a scenario in which Firefox's WebGL implementation on Windows acts strangely. This graphics experiment can be seen at http://test.sunruse.co.uk/toon-engine-firefox-repro-1/ I've found a workaround for this; open the shader editor, and replace the following line: gl_FragColor = vec4(pow(pow(texture2D(u_palette, texture2D(u_gbuffer, v_uv).rg).rgb, vec3(2.2)) * (texture2D(u_accumulator, v_uv).rgb + u_ambientColor), vec3(1.0 / 2.2)), 1.0); With: vec2 paletteUV = texture2D(u_gbuffer, v_uv).rg; gl_FragColor = vec4(pow(pow(texture2D(u_palette, paletteUV).rgb, vec3(2.2)) * (texture2D(u_accumulator, v_uv).rgb + u_ambientColor), vec3(1.0 / 2.2)), 1.0); This should be functionally identical (getting a colour from a palette texture by reading from a G-buffer texture has been split into separately sampling the G-buffer and palette as two separate statements rather than in one expression). Actual results: In Firefox, the scene is blue with only outlines visible. Expected results: In Edge or Chrome, different parts of the scene have colour.
Component: Untriaged → Canvas: WebGL
OS: Unspecified → Windows 10
Product: Firefox → Core
Hardware: Unspecified → x86_64
Michael, could you check this? Maybe it's related to libangle update.
Flags: needinfo?(cleu)
Whiteboard: [gfx-noted]
I have checked it with Firefox beta(58) and Nightly (59) in Windows, it has already been fixed. :jameswilddev, could you help us download Firefox Beta and try it again? Thanks!
Flags: needinfo?(cleu)
Just tried it and all looks good from here. Thanks!
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.