-
Notifications
You must be signed in to change notification settings - Fork 279
Driver issues
Nicolas Silva edited this page Oct 5, 2023
·
105 revisions
See also:
#1157 - Varying structs
- Description: Using varying structs can cause shader errors.
- Workaround: Not use structs for varyings.
- OS: Windows (GL and ANGLE)
- Vendors: Intel, Nvidia
- Driver versions: NVIDIA 381.65, ???
- See also: Issue#1136
Servo#13953 - Mac glsl compiler bug.
- Description: GLSL complier fails to parse the function get_fetch_uv in prim_shared.glsl.
- Workaround: This particular function was turned into a
#define
macro. - OS: Mac
- Vendors:Intel
- Driver versions: Intel Iris 6100, Intel HD 5300, Intel HD 6000
??? - Mac glsl compiler bug realted to logical operators in #if
blocks.
- Description: Found the diff but not the detailed issue. Most likely a shader compiler error with logical opertors in
#if
conditions like#if FOO == 1 && BAR == 1
. - Workaround: Nest #if blocks instead.
- OS: Mac
- Vendors: ???
- Driver versions: ???
#105 - Inset shadow with border radius crash
- Workaround: issue, accidentally fixed, we don't know how.
- OS: Mac
#650 - Terrible performance of sub-texture uploads on some mobile devices.
- Description: glTexSubImage is extremely slow on some devices (usually old ones).
- Workaround: None (maybe driver blocklist?).
- OS: Android
- Devices: SGX540, SGX530, Adreno200, Adreno205, (...)
#1242 - LLVM hang during shader compilation
- Description: Heavy inlining of the shader code may cause a hangup in llvmpipe. Note: while this appears to be particularly bad in llvmpipe, other shader compilers are noticeably affected.
- Workaround: Move function invocations outside of the
switch/case
arms. - OS: Any
- Description: a GLSL return statement with a heavy struct constructor fails to compile
- Workaround: move the construction outside of the return
- OS: Windows 10 Fall Creators Update x64, other?
- Vendor: Intel
- Driver versions: Intel HD Graphics 530 version 22.20.16.4735, other?
#1285 - declarations in switch cases
- Description: declarations inside a
case
arm of aswitch
statement confuse the shader compiler. This also applies to ternary operators, which don't appear to be declarations but are actually expanded with the use of temporary variables by Angle. - Workaround: wrap the
case
handling code into curly{
braces}
as a block. - OS: Any
#1395 - TODO
#1403 - TODO
#1260 - Broken GL context reports max texture size equal to zero.
- Description: A maximum texture size of zero is reported which causes webrender to hit an assertion as soon as a it decides to allocate a page for the texture cache.
- Workaround: Detect this during initialization and cancel the initialization with a meaningful error message.
- Configurations: Some versions of the proprietary nvidia driver on linux (TODO: need details).
#1601 - GPR limit exceeded (shader requiring too many registers).
- Description: Shader compilation fails with error log:
EE r600_shader.c:3661 r600_shader_from_tgsi - GPR limit exceeded - shader requires 305 registers
EE r600_shader.c:183 r600_pipe_shader_create - translation from TGSI failed !
- Configurations: Radeon HD 2400 XT running Mesa 17.1.6 on Linux
#1694 - texelFetchOffset
is very buggy on some Android GPUs.
- Description: See https://bugs.chromium.org/p/chromium/issues/detail?id=642605
- Workaround: rewrite
texelFetchOfsset
totexelFetch
. - OS: Android
- Devices: Google Pixel, Nexus 6, (...)
- Description: e.g.
bvec2(glyph_index % 2 == 1)
- Workaround:
bvec2(glyph_index % 2 != 0)
- OS: macOS, ???
- Vendor: Intel
- Driver versions: Intel HD Graphics 530, 550, ???
#1810 - Incorrect integer arithmetic in shader on Mac under certain conditions.
- Description: reading from integer variables (or integer arguments) when doing any kind of integer calculation, in the right circumstances, produces incorrect results. Integer function arguments seem to be part of the circumstances.
- Workaround: Pass/store some values as floats and cast them to integers or move pieces of the code until the "right circumstances go away".
- Vendor: Intel
- Driver versions: Intel HD graphics 530, ???
pathfinder/#55 - Early return condition is never taken on macOS Nvidia
- Edit: This may actually be an instance of https://bugs.chromium.org/p/chromium/issues/detail?id=307751 since the condition did involve a short-circuiting operator.
- Description: Some early return if conditions are never taken when they should be, whether it crops up seems to also depend on control flow later on. Edit: it might be ones with short-circuiting logical operators.
- Workaround: Put the condition in a new
bool
variable and useif(myVar)
instead of putting the condition expression in the if statement. - Vendor: Nvidia/Apple
- Driver versions: Whatever is used for the Nvidia GT 750m in 2014 rMBPs
#2280 - Resizing with glTexImage3D
on ANGLE.
- Description: ANGLE is confused when calling
glTexImage3D
with similar parameters that the texture already has, causing some elements to flicker. - Workaround: Reset the 3d texture contents before resizing.
- OS: Windows
- Vendor: ANGLE.
- Versions: ??
- Upstream fix: https://chromium-review.googlesource.com/c/angle/angle/+/862256
- Description: When converting shaders to HLSL with SPIRV-Cross, any switch statement without
default
case fails to compile with error "Not all control paths return a value" - Workaround: Add
default
case. - OS: Windows
- Vendor: SPIRV-Cross
- Description: Angle doesn't update the driver metadata about samplers on program change. This metadata has
baseLevel
that is forcefully used in ourtextureSize
as Angle's internal workaround for some NVidia hardware. As a result,baseLevel
may turn out to be garbage, andtextureSize
returns zeroes at best, and crashes the driver at worst. - Workaround: Convince Angle that
sCacheXXX
samplers are always used in all shaders. - OS: Windows Angle
- Vendors: Nvidia
- Versions: ?
- Upstream fix: https://chromium-review.googlesource.com/c/angle/angle/+/949412
#2530 - Division by zero on SandyBridge in the fragment shader
- Description: https://bugzilla.mozilla.org/show_bug.cgi?id=1441025. We were unpremultiplying by dividing by the alpha component, applying a filter and then repremultiplying. It seems like Sandybridge doesn't guarantee that (x/0.)*0. = 0.
- Workaround: Don't divide by zero
- OS: Linux Mesa
- Vendors: Intel
- Versions: ?
#2623 - Unused vertex attributes in SPIR-V
- Description: unused vertex attributes are successfully compiled out by a driver's GLSL compiler. However, this is not the case for GLSL -> SPIRV shader pipelines we are going to use for supporting Vulkan, DX12, and Metal.
- Workaround: make sure that no vertex attribute declarations present in the shader code by accident/laziness
#2826 - Varying arrays
- Description: using varying arrays or matrices works fine for
OpenGL
,GLSL -> SPIRV -> Vulkan
andDX12
. But causes an error forMetal
:"The vertex function output structure may not include a matrix or array."
- Workaround: Don't use matrix or array in vertex output structure.
#2864 - Mac glsl compiler bug with integer comparisons.
- Description: GLSL compiler produces undefined results when comparing for equality with a reasonably large integer constant.
- Workaround: in our particular case, replacing "==" with ">=" worked
- OS: Mac
- Vendors:Intel
- Driver versions: Intel Graphics 550, 6100
- Broken code:
if (index == 0x7FFF) { //special sentinel task index
...
} else {
#3540 - Mac glsl compiler bug with integer comparison (take two).
- Description: Might be the same as the previous item. The GLSL compiler produces undefined results when comparing for equality with a constant (not necessarily large).
- Workaround: Replaced the
if
branch with aswitch
statement. - OS: Mac (Mojave)
- Hardware: Intel HD Graphics 515 (not reproduced on Intel Iris Pro 1536 MB, Mac High Sierra)
- Broken code:
if (raster_space == RASTER_SCREEN) {
...
} else {
...
}
Bug 1679700 - Mac glsl compiler bug with integer comparison (take three).
- Description: Might be the same as the previous item. The GLSL compiler produces undefined results when comparing for equality with a constant (not necessarily large).
- Workaround: Casted the integer to a float before doing the comparison
- Broken code:
vec3 get_yuv_offset_vector(int color_space) {
if (color_space == YUV_COLOR_SPACE_IDENTITY) {
return vec3(0.0, 0.0, 0.0);
} else {
return vec3(0.06275, 0.50196, 0.50196);
}
}
- OS: macOS 10.15/11.0
- Hardware: Intel HD Graphics
#3004 - Slow flat varying implementation in ANGLE
- Description: Because D3D11 and GLES3 don't use the same provoking vertex, ANGLE generates a geometry shader to paper over the difference. See https://chromium-review.googlesource.com/c/angle/angle/+/309155 and https://bugs.chromium.org/p/angleproject/issues/detail?id=754
- OS: Windows
- Workaround: Use the
ANGLE_provoking_vertex
extension to set the default provoking vertex, see https://searchfox.org/mozilla-central/rev/2e06f92ba068e32a9a7213ee726e8171f91605c7/gfx/wr/webrender/src/device/gl.rs#1473 See also the ANGLE patch that added support for the extension.
Bug 1496168 - ANGLE generates mipmaps in places where we don't want them
- Description: (TODO)
- Workaround: Using glTexStorage where available.
- OS: Windows
Bug 1505664 - Increasing shared texture cache to 64 layers breaks rendering on mac intel OpenGL driver
- Description: https://searchfox.org/mozilla-central/rev/358f816f63da072145c593e9e2ac36b7250ecd25/gfx/wr/webrender/src/texture_cache.rs#526
- Workaround: Limit the shared texture cache to 32 layers on mac.
- OS: Mac (MBP, integrated Intel graphics (discrete Radeon GPU does not have this problem).
Bug 1505508 - glBlitFramebuffer and glCopyTex(Sub)Image* don't work correctly with texture arrays on Adreno
- Description: On Adreno GPUs glBlitFramebuffer always writes to the 0th layer of a texture array, regardless of which layer is actually bound to the draw framebuffer. Similarily, glCopyTex(Sub)Image* always reads from the 0th layer. This means we cannot copy texture data directly from one texture array to another using these methods.
- OS: Android
- Workaround: glBlitFramebuffer from src layer in to a renderbuffer, then glCopyTexSubImage3D from renderbuffer to dst layer. This is an extra copy but will work everywhere. glCopyImageSubData would be the optimal workaround, but is not always available.
Bug 1513185 Blitting from a texture array to the main framebuffer broken on Adreno 3xx
- Description: It seems like blitting layer i actually blits layers i..n, which means we're copying pixels a lot more times than we want to.
- OS Android
- Hardware: Adreno 3xx
- Workaround: At the moment we only blit from textrue arrays to framebuffer in the texture cache debug overlay. We might want to only ask it to blit layer 0 rather than 0..n.
Bug 1513185 Broken PBO uploads depending on stride on Adreno 3xx
- Description: PBO uploads where the stride is a multiple of 128 bytes always write the data to the 0th layer of a texture array.
- OS Android
- Hardware: Adreno 3xx
Bug 1505871 - Assignment to varying flat arrays inside switch statement of vertex shader suspected miscompile on Windows
- Description: On Windows there seems to be a miscompilation when assigning to a varying flat array inside a switch statement in a vertex shader. The assignments don't happen unless you do them outside the switch statement. See comment 34 of the bug for more details.
- Workaround: Move the assignment out of the switch statement.
- OS: Windows
Bug 1532245 - switch statement inside control flow inside switch statement fails to compile on some Android phones
- Description: On some Android phones you get a shader compile error if you have a switch statement inside some other control flow inside a switch statement: "ERROR: 0:1448: '' : No default label can be nested inside other control flow nested within their corresponding switch"
- Workaround: refactor the nested switch statement and/or control flow to a function
- OS: Android
Bug 1570736 - texture swizzling affects wrap modes on some Intel GPUs
- Description: On some Mac+Intel configurations, configuring the texture unit's
GL_TEXTURE_SWIZZLE_?
parameters changes the wrap modes, breaking any sampling from the texture. The platform affected reportsGL_ARB_texture_swizzle
to be supported. - OS: Mac
- Hardware: Intel HD4000 and HD3000.
- Workaround: don't use swizzling - set
RendererOptions::allow_texture_swizzling = false
via blocklist on affected configurations.
Bug 1555056 - Android emulator version 29 claims to support BGRA textures but errors for 3d textures
- Description: Previous versions of the android emulator did not claim to support GL_EXT_texture_format_BGRA8888, but version 29+ does. However, glTexImage3D always fails with a GL_INVALID_ENUM error. This has been reported upstream here. It has been fixed for the GPU backend, but not for the swiftshader backend yet.
- Workaround: Use swizzling (or use the GPU backend, or one day we might use only 2d textures)
Bug 1555002 - glBlitFramebuffer fails on the Android emulator when blitting to or from a 3D texture
- Description: glBlitFramebuffer fails and results in a GL_INVALID_OPERATION error when blitting to or from a framebuffer attached to a 3D texture layer. This only affects the swiftshader backend. It has been reported upstream here. It has been fixed in swiftshader, but the version of swiftshader used by the emulator has not yet been updated.
- Workaround: Use the emulator's GPU backend
Bug 1558167 - Texture uploads require the byte stride of 256 on AMD GPUs with macOS 10.15
- Description: We upload data to textures using PBOs. OpenGL allows any stride between lines, but in this case we see the data corruption if the stride is not aligned to 256 bytes.
- Workaround: Forcefully align the stride before uploading.
- OS: macOS 10.15
- Hardware: AMD
Bug 1603783 PBO uploads with non-zero broken on AMD MacOS 10.15
- Descrition: See https://bugzilla.mozilla.org/show_bug.cgi?id=1603783#c2
- OS: MacOS 10.15
- Hardware: AMD
Bug 1591945 - Android emulator crash reading non-null-terminated shader sources with length argument.
- Description: When the length argument in glShaderSource is not zero, the shader compiler should read up to the specified length instead of looking for
\0
. On the Android emulator this causes a crash. - Platform: Android emulator.
Bug 1598440 - Webrender on android emulator fails to initialize
- Description: On certain platforms (Linux with AMD for example), Webrender does not initialize on the android emulator even after forcing it as it requires OpenGL ES 3.0.
- Workaround: To force enable the emulator to allow OpenGL ES 3, you can run this on host:
echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini
- Platform: Android emulator
Bug 1594128 - GLSL on macOS is confused by a function that just returns a constant.
- Description: using an empty function like
int vecs_per_brush() { return VECS_PER_SPECIFIC_BRUSH; }
doesn't produce the expected result - Workaround: use a define instead of a function
- Platform: macOS
Bug 1601060 - Shader compilation error when masking a signed integer.
- Description: If the bit mask is a literal that can't be represented as a signed integer, some shader compilers detect it and throw an error about the overflow.
- Workarounds: avoid masks that involve the sign bit or make sure the involved integers are unsigned.
- Platform: Z3C running LineageOS 16 (Android 9) Adreno 330
Bug 1613595 - Incorrect gradient rendering on Adreno 510.
- Description: Gradient render incorrectly. Changes to the shader code's structure lead to changes in the glitch.
- Platform: Adreno 510 (Xiaomi Redmi Note 3)
The number of layers in a texture array affects rendering (bug 1616901)
- Description: Changing the number of allocated layers in the texture cache's texture array caused a lot of fuzzy differences in reftests on Android and Mac. We suspect that it affects some arithmetic behind texture coordinates and sampling.
- Platforms: Android, Mac
Bug 1652763 - Glitches on macOS Intel with clears
- Description: when we stop using per-vertex attributes, scissored clears become occasionally broken.
- Workaround: use quad drawing instead of scissored clears
- OS: MacOS 10.15
- Hardware: Intel
Bug 1640960 - FBO readback is broken on macOS Intel in some contexts
- Description: when we stop using per-vertex attributes, FBO readbacks mostly don't work
- Workaround: bind a VAO with the first attribute enabled (per-vertex) before doing the readback
- OS: MacOS 10.15
- Hardware: Intel
Bug 1640960 - SSBO updates are sometimes broken on OsMesa
- Description: when enabling the SSBO path instead of instanced attributes, sometimes the data appears corrupted when read by shaders. Presumably, this happens if it exceeds a certain size.
- Workaround: don't use SSBO path on OsMesa
- Description: Not a bug per say, but impacts design decisions. Despite existing since 2011, we can't rely on base-instance everywhere, making it hard to group multiple batches into large vertex buffers.
- Workaround: Bug 1640960
Bug 1663355 and Bug 1558374 - Partial updates to offscreen render targets sometimes fail on Mali-Gxx
- Description: Partial updates to offscreen render targets can fail (leaving previous texture contents or a mixture of old and new behind). The pattern of stale content appears to be in small squares, perhaps 16x16 indicating a bug in Mali's tiler.
- Workaround: Clear entire render target (with scissor test disabled) before rendering
Bug 1663344 - brush_blend vertex shader switch statement miscompiles on Intel Gen6 when lowered to if chain by glslopt.
- Workaround manually lower the switch statement into an if chain to avoid glslopt doing it.
Bug 1678924 - yuv vertex shader switch statement miscompiles on Intel Gen6 when lowered to if chain by glslopt.
- Likely the same problem as bug 1663344.
- Workaround manually lower the switch statement into an if chain to avoid glslopt doing it.
Bug 1677757 - Using glBlitFramebuffers with GL_LINEAR filter to copy GPU cache texture (RGBAF32 format) results in corruption on Mali-Txxx and Mali-Gxx
- Description: Using the glBlitFramebuffers path in
blit_renderable_texture
with GL_LINEAR filter results in some visual artefacts and blurry text when the GPU cache is resized. - Workaround: use glCopyImageSubData or GL_NEAREST filter
Bug 1683936 - Persistently mapped buffer uploads failure on Andoid 6 Adreno
- Description: There is a driver bug on old versions of the Adreno driver which prevents usage of persistenly mapped buffers for texture uploads. Creating and mapping the buffer works correctly, but attempting to upload to a texture from the buffer results in an error due to the buffer still being mapped. No texture data is uploaded, essentially meaning that we do not render anything at all.
- OS: Android 6
- Hardware: Adreno (4xx and 5xx at least, maybe more versions).
Bug 1688017 - Crashes playing video on twitter (and other sites) on Mali-G76 and G72 on Android 11
- Description: Crashes in glDrawElements when using brush_image_TEXTURE_EXTERNAL shader. Caused by the textureSize(samplerExternalOES) call in the vertex shader without any sample calls. Tricking the driver in to thinking the texture may be sampled avoids the crash.
- Workaround: Sample from the texture in the vertex shader. (In a dynamic branch that is not taken is fine, as long as the compiler doesn't optimize it away)
- Description: Using texelFetchOffset on Mac Intel causes miscompilations. This was the root cause of a number of bugs above.
- Description: Removing an integer comparison workaround caused a bug on Intel Gen6 on Windows (maybe only Win10)
Bug 1679681 - Texture array shader variant incorrectly used on AMD+Linux
- Description: Texture array shader seem to be used instead of the texture 2D one, causing gltiches.
- Workaround: Removed the texture array shader variants.
- Hardware: AMD R600
- OS: Linux
- See also: Bug 1673939
Bug 1695912 - Some Adreno 3xx drivers do not pack varyings as efficiently as they should
- Description: Errors in glLinkProgram for some shaders due to varyings not fitting in 16 vectors. Angle's CheckVariablesWithinPackingLimits() (which implements the spec's packing algorithm) thinks the varyings should fit.
- Workaround: Manually pack varyings in to vectors. Add test that we don't exceed 16 vectors without any additional packing.
Bug 1630356 - Flat scalar varyings used to calculate UV coordinates result in entire UV coordinate calculation being performed as if flat on Adreno 3xx.
- Description: Flat scalar varyings that are used to calculate UV coordinates in fragment shader (such as
flat int vLayer
in composite.glsl andflat float v_perspective
in brush_image cause the UV coordinates to be flat. This results in solid-coloured triangles being rendered, the color being the texture sample at the UV coordinate calculated for the provoking vertex. - Workaround: Pack the varying in a vector (eg
vec2
orivec2
).
Bug 1704783 - Texture swizzling doesn't appear to work correctly on PowerVR Rogue devices
- Description: Red and green channels appear swapped when rendering textures on PowerVR rogue. We were using RGBA internal format textures, uploading BGRA CPU data with an RGBA external format, and using texture swizzling.
- Workaround: Use BGRA internal format textures with no swizzling.
Bug 1696039 - Texture uploads fail / appear corrupted on Adreno 3xx devices if stride of data in PBO is not a multiple of 128 bytes
- Description: Some glyphs were intermittently missing or distorted when browsing on Adreno 3xx. Aligning the stride to a multiple of 128 bytes avoids the issue. Note this is different than on Adreno 5xx and 6xx where we align the stride to 64 pixels for performance reasons. And also bug 1513185, where uploads with a stride aligned to 128 pixels on Adreno 3xx are broken because they always upload to the 0th layer of a texture array.
- Workaround: Pack PBO so that stride of data is aligned to 128 bytes on Adreno. Additionally, don't use texture arrays so that we don't hit bug 1513185.
Bug 1712290 - Draw calls appear to use stale vertex buffer data after buffer orphaning on Adreno 3xx Android 9
- Description: Prior to draw calls we orphan the instance buffer and upload the new instance data. In cases where the buffer size is identical to a previous buffer (which is the common case when compositing picture cache tiles as they are not batched) the driver gets confused and appears to use the stale orphaned buffer data rather than the new buffer for the subsequent draw call.
- Workaround: Unbind and rebind the VAO after orphaning the VBO
Bug 1720841 - Loop with dynamic number of iteration causing crash on Adreno 305/330
- Description: A for loop in a (fragment) shader with a number of iteation that depends on a varrying variable causes crashes, even though the number of iterations is low in practice.
- OS: Android
- Hardware: Adreno 330, Adreno 305
- Workaround: Limit the maximum number of iterations to something conservatively large.
Bug 1726792 Shader compilation fails with GL_OES_EGL_image_external_essl3 on intel chromebook
- Description: The GL context reports thatit supports the extension GL_OES_EGL_image_external_essl3, however vertex shader compilation fails with
textureSize(samplerExternalOES, int)
. - OS: ChromeOS
- hardware: Octopus (x86), Mesa driver
Bug 1731758 Brush blend renders garbage when using an ivec4
varying on Adreno 3xx
- Description: The brush_blend shader was broken on Adreno 3xx due to using an
ivec4
varying forv_funcs
. Garbage was rendered for all blend ops, not just component transfer. It's not clear why, but using anint
orivec2
avoided the bug, whereas anivec3
orivec4
causes it. - Workaround: Pack the func values in to a single component of an
ivec2
using bitshifting, rather than using anivec4
. We must use anivec2
instead of anint
due to bug 1630356. - OS: Android
- hardware: Adreno 3xx
Bug 1732726 Mapping a PBO can fail with DXGI_ERROR_WAS_STILL_DRAWING with ANGLE even if synchronized via a fence
- Description: At the end of each frame we associate used PBOs with a GL_SYNC_COMMANDS_COMPLETE fence object. At the beginning of each frame we poll the sync objects and enqueue PBOs associated to signaed fences for reuse. On ANGLE, however mapping the buffer of a recycled PBO sometimes fail with DXGI_ERROR_WAS_STILL_DRAWING. The problem was caught in various tests on CI.
- Workaround: Wait for a fixed amount of frames when recycling PBOs on ANGLE.
- OS: Windows
Bug 1744334 Corrupted glyphs (Windows 11)
- Missing and corrupted glyphs in some places.
- Hardware: TODO: reportedly Dell 7706 2in1 with IRIS XE and nvidia MX350, need more precisions.
- OS: Windows 11
Bug 1633628 Dual source blending followed by ClearView on Sandybridge
- Description: Calling ClearView after using dual source blending causes a TDR
- Hardware: Sandybridge
- OS: Windows
Bug 1784093 Driver hangs after using dual source blending
- OS: Windows
- Hardware: Sandybridge and Ivybridge
Bug 1708937 Gen6 shader miscompilation
- OS: Windows
- Description: standalone test case: https://github.com/jrmuizel/gen6-miscompilation
- Hardware: Intel Gen6
Bug 1825518 Crash with mediump on Mali-T
- Description: Crash in the driver if a certain varrying is medium float instead of highp float.
- OS: Android
- Hardware: Arm Mali-T (from T628 through to T820)
Bug 1856546 Missing rounded corners
- TODO affects a small amount of users