Single-Pass GPU Shader Batching Strokes and Fills

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current path rendering algorithms in computer graphics require two-pass rendering, leading to bottlenecks due to GPU state changes and inefficiencies, especially when dealing with complicated scenes and dynamic content, and lack efficient methods for anti-aliasing and rendering on resource-constrained platforms.

Innovation Solution

The implementation of a single-pass GPU shader algorithm using coverage counting and pixel local storage, which stores coverage count, framebuffer original color, path ID, and texture-backed color to enable anti-aliased path rendering with reduced state changes, eliminating the need for stencil or MSAA, and allowing batched rendering of strokes and fills.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Manufacturing precision

If two-pass rendering is used for path rendering, then anti-aliasing quality is improved, but GPU state changes increase and rendering efficiency deteriorates

Engineering Contradiction:
Improveanti-aliasing qualityVSAvoidrendering efficiency
Core Design Contradiction:
Manufacturing precisionVSProductivity

Solution Approach 1:

The patent combines multiple rendering operations (stencil buffer operations, coverage counting, and final rendering) into a single GPU pass. By merging these previously separate operations into one unified rendering pass that uses pixel local storage to track coverage counts, the system eliminates the need for multiple state changes between passes while maintaining anti-aliasing quality through fractional coverage accumulation.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent enables continuous rendering of multiple paths and shapes in a single uninterrupted GPU pass. By using pixel local storage to maintain coverage counts across different path rendering operations without requiring state changes or buffer clears between operations, the system achieves continuous useful action that eliminates the idle time and overhead associated with traditional two-pass rendering.

Inventive Principle:
Principle #20Continuity of useful action

2Manufacturing precision

If stencil buffer and MSAA are used for anti-aliasing, then rendering precision is improved, but device complexity and memory usage increase

Engineering Contradiction:
Improverendering precisionVSAvoidbuffer complexity
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The patent extracts the anti-aliasing functionality from traditional complex buffer systems (stencil buffer, MSAA) and implements it using a simpler pixel local storage mechanism. By taking out the anti-aliasing logic from specialized buffers and implementing it through fractional coverage counting in pixel local storage, the system achieves the same rendering precision with significantly reduced device complexity and memory requirements.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent uses pixel local storage as a temporary, lightweight mechanism for tracking coverage counts during rendering. This disposable storage mechanism is automatically cleared when the shader program ends, eliminating the need for persistent complex buffer structures. The coverage counts are recomputed in each rendering pass, using cheap temporary storage instead of expensive permanent buffer structures.

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

3Adaptability or versatility

If multiple draw calls are used for strokes and fills, then rendering flexibility is improved, but processing time and state changes increase

Engineering Contradiction:
Improverendering flexibilityVSAvoidprocessing time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent merges stroke and fill rendering operations into a single shader program that can handle both types of operations in one draw call. By combining previously separate rendering passes for strokes and fills into one unified shader that processes both operation types sequentially without state changes, the system maintains rendering flexibility while eliminating the time loss associated with multiple draw calls and state transitions.

Inventive Principle:
Principle #5Merging (Combining)

4Ease of manufacture

If resolution-dependent bitmapped graphics are used, then rendering simplicity is improved, but scalability and quality at different resolutions deteriorate

Engineering Contradiction:
Improverendering simplicityVSAvoidresolution scalability
Core Design Contradiction:
Ease of manufactureVSAdaptability or versatility

Solution Approach 1:

The patent changes the fundamental parameter of path representation from fixed-resolution bitmaps to resolution-independent vector paths with fractional coverage. By representing graphics as mathematical paths with sub-pixel coverage values that can be computed at any resolution, the system achieves resolution scalability while maintaining rendering simplicity through the same shader-based approach that works at all scales.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20240169613A1System and Method for Batching of Strokes and Fills in a Single Draw Call
Publication Date: 2024.05.23 RIVE INC
  • US20240169613A1 patent drawing
  • US20240169613A1 patent drawing
  • US20240169613A1 patent drawing

AI summary

An improved algorithm and technique for use in interactive graphics is disclosed. The new algorithm is configured to render a path, which may be stroked quickly using shaders. However, it should be recognized that it is common for path strokes and fills to be interleaved, and an application can quickly become bottlenecked by GPU state changes if it uses a separate shader for stroking. The present invention discloses a single-pass GPU shader that is capable of either stroking or filling a path, and can batch together any number or combination of strokes and fills.