# US 12,112,420 B2 · Method and apparatus for improving the image quality of variable rate shading using gradients

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,112,420 B2
- Document ID: US12112420B2
- Status: Granted
- Kind: B2
- Application number: 17/834,907
- Filed: 2022-06-07
- Published: 2023-06-08
- Granted: 2024-10-08
- Earliest claimed: 2021-12-07
- Assignees: Samsung Electronics Co., Ltd.
- Applicants: Samsung Electronics Co., Ltd.
- Inventors: Gabriel T. Dagani; Raun Krisch
- Web page: https://patentgrep.com/patent/US12112420B2

## CPC

- G06T 15/005: {General purpose rendering architectures}
- G06T 15/80: Shading
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

A system and a method are disclosed for post-processing variable pixel rate shader output using gradients in a graphics processing unit. A block of pixels is selected that corresponds to a predetermined kernel size for variable rate shading in a draw call of an application. A pixel shader run is instantiated to generate pixel shading values for at least two pixels located within the block of pixels. A gradient output is generated based on an interpolation of the pixel shading values for the at least two pixels over the block of pixels. The predetermined kernel size may include at least one of a 4×2 block of pixels, a 2×4 block of pixels, a 4×4 block of pixels, an 8×4 block of pixels, a 4×8 block of pixels, and an 8×8 block of pixels or larger. The at least two pixels may be corner pixels of the block of pixels.

## Claims

### Claim 1

A method to post-process variable pixel rate output using gradients in a Graphics Processing Unit (GPU), the method comprising:
detecting, by the GPU, a block of pixels that corresponds to a predetermined kernel size for variable rate shading in a draw call of an application;
instantiating, by the GPU, a pixel shader run to generate pixel shading values for at least two pixels located within the block of pixels; and
generating, by the GPU, a gradient output for the block of pixels based, at least in part, on an interpolation of the pixel shading values for the at least two pixels over the block of pixels, wherein the predetermined kernel size and a location of the two pixels located within the block of pixels are based on a variable rate shading rate profile.

### Claim 2 (depends on 1)

The method of claim 1, wherein the predetermined kernel size comprises at least one of a 4×2 block of pixels, a 2×4 block of pixels, a 4×4 block of pixels, an 8×4 block of pixels, a 4×8 block of pixels, an 8×8 block of pixels, and a 16×16 block of pixels.

### Claim 3 (depends on 1)

The method of claim 1, wherein generating the gradient output for the block of pixels is further based, at least in part, on a gradient direction.

### Claim 4 (depends on 1)

The method of claim 1, wherein the at least two pixels comprise corner pixels of the block of pixels.

### Claim 5 (depends on 1)

The method of claim 1, wherein generating the gradient output for the block of pixels is further based, at least in part, on a gradient type that comprises a linear gradient or an oriented gradient.

### Claim 6 (depends on 1)

The method of claim 1, wherein instantiating the pixel shader run to generate pixel shading values for the at least two pixels comprises instantiating pixel shader runs for four pixels located within the block of pixels, and
wherein generating the gradient output for the block of pixels is based, at least in part, on an interpolation of the pixel shading values for the four pixels over the block of pixels.

### Claim 7 (depends on 1)

The method of claim 1, wherein the pixel shading values are based, at least in part, on a programmable shading output comprising at least one of linear shading, radial shading, and interpolation-based shading.

### Claim 8

A method to post-process variable pixel rate output using gradients in a Graphics Processing Unit (GPU), the method comprising:
determining, by the GPU, that variable rate shading is enabled for a draw call of an application;
determining, by the GPU, that gradient processing is enabled for variable rate shading;
determining, by the GPU, a block of pixels that corresponds to a predetermined kernel size in the draw call;
instantiating, by the GPU, a pixel shader run to generate pixel shading values for at least two pixels located within the block of pixels; and
generating, by the GPU, a gradient output for the block of pixels based, at least in part, on an interpolation of the pixel shading values for the at least two pixels over the block of pixels, wherein the predetermined kernel size and a location of the two pixels located within the block of pixels are based on a variable rate shading rate profile.

### Claim 9 (depends on 8)

The method of claim 8, wherein the predetermined kernel size comprises at least one of a 4×2 block of pixels, a 2×4 block of pixels, a 4×4 block of pixels, an 8×4 block of pixels, a 4×8 block of pixels, an 8×8 block of pixels, and a 16×16 block of pixels.

### Claim 10 (depends on 8)

The method of claim 8, wherein generating the gradient output for the block of pixels is further based, at least in part, on a gradient direction.

### Claim 11 (depends on 8)

The method of claim 8, wherein the at least two pixels comprise corner pixels of the block of pixels.

### Claim 12 (depends on 8)

The method of claim 8, wherein generating the gradient output for the block of pixels is further based, at least in part, on a gradient type that comprises a linear gradient or an oriented gradient.

### Claim 13 (depends on 8)

The method of claim 8, wherein instantiating the pixel shader run to generate pixel shading values for the at least two pixels comprises instantiating pixel shader runs for four pixels located within the block of pixels, and
wherein generating the gradient output for the block of pixels is based, at least in part, on an interpolation of the pixel shading values for the four pixels over the block of pixels.

### Claim 14 (depends on 8)

The method of claim 8, wherein the pixel shading values are based, at least in part, on programmable shading output comprising at least one of linear shading, radial shading and interpolation-based shading.

### Claim 15

A graphics processing unit (GPU), comprising:
a graphics pipeline configured to increase a pixel rate of rendered content; and
a controller coupled to the graphics pipeline, the controller being configured to:
detect a block of pixels that corresponds to a predetermined kernel size for variable rate shading in a draw call of an application,
instantiate a pixel shader run to generate pixel shading values for at least two pixels located within the block of pixels, and
generate a gradient output for the block of pixels based, at least in part, on an interpolation of the pixel shading values for the at least two pixels over the block of pixels, wherein the predetermined kernel size and a location of the two pixels located within the block of pixels are based on a variable rate shading rate profile.

### Claim 16 (depends on 15)

The GPU of claim 15, wherein the predetermined kernel size comprises at least one of a 4×2 block of pixels, a 2×4 block of pixels, a 4×4 block of pixels, an 8×4 block of pixels, a 4×8 block of pixels, and an 8×8 block of pixels.

### Claim 17 (depends on 15)

The GPU of claim 15, wherein the controller is further configured to generate the gradient output for the block of pixels further based, at least in part, on a gradient direction.

### Claim 18 (depends on 15)

The GPU of claim 15, wherein the at least two pixels comprise corner pixels of the block of pixels.

### Claim 19 (depends on 15)

The GPU of claim 15, wherein the controller is further configured to generate the gradient output for the block of pixels further based, at least in part, on a gradient type that comprises a linear gradient or an oriented gradient.

### Claim 20 (depends on 15)

The GPU of claim 15, wherein the controller instantiates the pixel shader run to generate pixel shading values for the at least two pixels by instantiating pixel shader runs for four pixels located within the block of pixels, and
wherein the gradient output generated for the block of pixels is based, at least in part, on an interpolation of the pixel shading values for the four pixels over the block of pixels.
