Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions renderer/src/shaders/draw_path_common.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down
6 changes: 5 additions & 1 deletion renderer/src/shaders/minify.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,11 @@ def emit_tokens_to_rewritten_glsl(self, out, *, preserve_exported_switches, call
# Adding this calling_token_type != 'DEFINE' prevents us from adding a new line to stringify macros
if is_directive and not is_newline and calling_token_type != 'DEFINE':
out.write('\n')
elif needs_whitespace and lasttoken_needs_whitespace:
# Mesa 20.3 can merge a function-like macro's expansion with an
# immediately following identifier (e.g. OUT(float2)A -> out float2A).
elif (needs_whitespace and lasttoken_needs_whitespace) or (
tok.type == "ID" and lasttoken.type == "OP" and lasttoken.value == ")"
):
out.write(' ')

# is_newline will be false once we output the token (unless this value otherwise gets
Expand Down