diff --git a/renderer/src/shaders/draw_path_common.glsl b/renderer/src/shaders/draw_path_common.glsl index 7d022032..c84e76a8 100644 --- a/renderer/src/shaders/draw_path_common.glsl +++ b/renderer/src/shaders/draw_path_common.glsl @@ -862,6 +862,11 @@ INLINE half incremental_clockwise_coverage(half c0, half c1, half paintAlpha) return (c1 - c0) / max(1. - c0 * paintAlpha, EPSILON_FP16_NON_DENORM); } +// Older Adreno GLSL compilers can miscompile non-atomic path shaders when they +// contain the unused unsigned shifts below. Keep this helper in storage-buffer +// PLS and clockwise-atomic variants, where it is used or was already present. +#if defined(@PLS_IMPL_STORAGE_BUFFER) || \ + defined(@RENDER_MODE_CLOCKWISE_ATOMIC) // Converts an x,y image coordinate into a buffer index, swizzling into // BUFFER_IMAGE_TILE_SIZE x BUFFER_IMAGE_TILE_SIZE tiles for better cache // performance. @@ -879,6 +884,7 @@ INLINE uint swizzle_image_buffer_idx(uint2 imageCoord, uint imageWidth) idx += ((imageCoord.y & 0x3u) << 2) + (imageCoord.x & 0x3u); return idx; } +#endif #ifdef @RENDER_MODE_CLOCKWISE_ATOMIC