Fragment Shader Sample Mask Control in Graphics Pipeline

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional graphics processing hardware lacks the ability for a fragment shader to completely control and modify the coverage information generated during rasterization, limiting the implementation of certain algorithms that require changing the coverage status of specific samples.

Innovation Solution

A method is introduced where a fragment shader generates a sample mask, which replaces the coverage information for each fragment, allowing the fragment shader to control the coverage status of samples, and writes the result to memory, enabling full control over the sample mask in the graphics processing pipeline.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If conventional hardware is used for rasterization, then the graphics processing pipeline operates with fixed coverage information, but the fragment shader cannot control or modify the sample mask

Engineering Contradiction:
Improvefragment shader control over sample maskVSAvoidhardware configuration
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent makes the sample mask dynamic by allowing the fragment shader to programmatically control and modify it. Instead of a fixed hardware-determined mask, the sample mask becomes a variable that can be adjusted through shader code, enabling algorithms to change coverage information arbitrarily during the rendering process.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent introduces an intermediary mechanism between the rasterization stage and the fragment shading stage. A new sample mask variable is created that acts as a bridge, allowing information to flow from the fragment shader back to control the coverage status of samples, thus mediating the interaction between these two traditionally unidirectional stages.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If coverage information is fixed during rasterization, then hardware operation is simple, but advanced rendering techniques cannot be implemented

Engineering Contradiction:
Improverendering algorithm flexibilityVSAvoidhardware operation
Core Design Contradiction:
Adaptability or versatilityVSEase of operation

Solution Approach 1:

The sample mask transitions from a static hardware-determined value to a dynamic variable that can be modified by the fragment shader. This dynamic control enables advanced rendering techniques such as path rendering and multi-sample color buffers while maintaining relatively simple hardware operation through programmable interfaces.

Inventive Principle:
Principle #15Dynamics

3Adaptability or versatility

If the fragment shader can generate arbitrary sample masks, then complete control over coverage information is achieved, but the hardware must support additional functionality

Engineering Contradiction:
Improvesample mask controlVSAvoidhardware capability
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent implements a universal sample mask control mechanism that serves multiple functions: it maintains backward compatibility with existing rendering pipelines while enabling advanced techniques. The same hardware infrastructure supports both traditional fixed coverage information and the new programmable sample mask approach, making the system multi-functional without requiring completely separate hardware paths.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS9978171B2Control of a sample mask from a fragment shader program
Publication Date: 2018.05.22 NVIDIA CORP
  • US9978171B2 patent drawing
  • US9978171B2 patent drawing
  • US9978171B2 patent drawing

AI summary

A method, system, and computer program product for controlling a sample mask from a fragment shader are disclosed. The method includes the steps of generating a fragment for each pixel that is covered, at least in part, by a primitive and determining coverage information for each fragment corresponding to the primitive. Then, for each fragment, the method includes the steps of generating a sample mask by a fragment shader, replacing the coverage information for the fragment with the sample mask, and writing, based on the sample mask, a result generated by the fragment shader to a memory. The method may be implemented on a parallel processing unit configured to implement, at least in part, a graphics processing pipeline.