IP Library Granted Patent US 12,154,209
Granted Patent B2
US 12,154,209 · App. 17/849,539 · Granted Nov 26, 2024

Efficient convolution operations with a kernel shader

Inventors: Rostam King (Hertfordshire, GB); William Thomas (Hertfordshire, GB)
Assignee: Imagination Technologies Limited
G06T15/005G06T15/04G06T15/10G06T15/20G06T15/80
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,154,209
App. No.
17/849,539
Granted
Nov 26, 2024
Kind
B2
Abstract

A method of improving texture fetching by a texturing/shading unit in a GPU pipeline by performing efficient convolution operations, includes receiving a shader and determining whether the shader is a kernel shader. In response to determining that the shader is a kernel shader, the shader is modified to perform a collective fetch of all texels used in convolution operations for a group of output pixels instead of performing independent fetches of texels for each output pixel in the group of output pixels.

Claims (48)

1. A computer system comprising one or more processors and a memory, the memory comprising computer readable instructions that, when executed by the one or more processors, cause the computer system to:

receive a shader;

determine whether the shader is a kernel shader; and

in response to determining that the shader is a kernel shader, modifying the shader to perform a collective fetch of all texels used in convolution operations for a group of output pixels instead of performing independent fetches of texels for each output pixel in the group of output pixels.

2. A non-transitory computer readable storage medium having stored thereon computer readable instructions that, when executed at a computer system, cause the computer system to:

receive a shader;

determine whether the shader is a kernel shader; and

in response to determining that the shader is a kernel shader, modifying the shader to perform a collective fetch of all texels used in convolution operations for a group of output pixels instead of performing independent fetches of texels for each output pixel in the group of output pixels.

3. A method comprising:

receiving a shader;

determining whether the shader is a kernel shader; and

in response to determining that the shader is a kernel shader, modifying the shader to perform a collective fetch of all texels used in convolution operations for a group of output pixels instead of performing independent fetches of texels for each output pixel in the group of output pixels.

4. The method according to claim 3 , wherein modifying the shader to perform a collective fetch of all texels used in convolution operations for a group of output pixels instead of performing independent fetches of texels for each output pixel in the group of output pixels comprises:

modifying the shader to include a plurality of fetch instructions for different sample positions, each sample position being offset from a texel centre and defining a different, non-overlapping patch of adjacent texels to be fetched.

5. The method according to claim 3 , wherein modifying the shader to perform a collective fetch of all texels used in convolution operations for a group of output pixels instead of performing independent fetches of texels for each output pixel in the group of output pixels comprises:

modifying the shader to include a plurality of gather operations for different sample positions, each sample position being offset by integer values from a centre of one of the output pixels and defining a different, non-overlapping patch of adjacent texels to be fetched.

6. The method according to claim 3 , wherein determining whether the shader is a kernel shader comprises:

determining if there is a 1:1 correspondence between texels and sampling points in the received shader, wherein if there is no correspondence the shader is not a kernel shader.

7. The method according to claim 3 , further comprising:

in response to determining that the shader is not a kernel shader, leaving the shader unmodified.

8. The method according to claim 3 , further comprising:

determining whether the shader is an optimized kernel shader that uses bilinear interpolation; and

in response to determining that the shader is an optimized kernel shader:

adapting the shader to reverse the bilinear interpolation;

modifying the adapted shader to perform a collective fetch of all texels used in convolution operations for a group of output pixels instead of performing independent fetches of texels for each output pixel in the group of output pixels.

9. The method according to claim 8 , wherein adapting the shader to reverse the bilinear interpolation comprises:

modifying each offset sample position in the shader to explicitly fetch two adjacent texels; and

defining separate weights for each of the two adjacent texels.

10. The method according to claim 9 , wherein defining separate weights for each of the two adjacent texels comprises:

allocating a weight associated with the offset sample position to each of the adjacent texels; and

for each of the adjacent texels, modifying the allocated weight based on an offset of the offset sample position.

11. The method according to claim 9 , wherein adapting the shader to reverse the bilinear interpolation further comprises:

for any non-offset sample position in the shader, leaving the sample position and associated weight unchanged.

12. The method according to claim 8 , wherein determining whether the shader is an optimized kernel shader that uses bilinear interpolation comprises:

determining whether sample positions in the shader are spread around a common coordinate with offsets, wherein if the sample positions are spread around a common coordinate, the shader is an optimized kernel shader.

13. The method according to claim 8 , wherein determining whether the shader is an optimized kernel shader that uses bilinear interpolation comprises:

determining whether convolution weights in the shader are all consistently distributed except for one convolution weight, wherein if all except for one of the convolution weights in the shader are consistently distributed, the shader is an optimized kernel shader.

14. The method according to claim 8 , further comprising:

in response to determining that the shader is not a kernel shader or an optimized kernel shader, leaving the shader unmodified.

15. The method according to claim 3 , wherein determining whether the shader is an optimized kernel shader that uses bilinear interpolation comprises:

determining whether the shader fetches an even number of texels, wherein if the shader fetches an even number of texels, the shader is an optimized kernel shader.

16. The method according to claim 3 , further comprising:

validating the modified shader; and

in response to the validation failing, reverting to the received, unmodified, shader.

17. The method according to claim 16 , wherein validating the secondary shader comprises:

checking that all the texels used in convolution operations for the group of output pixels fall within a predefined maximum patch size.

18. The method according to claim 3 , further comprising:

generating a secondary shader configured to validate the modified shader when executed, in response to the validation passing, to trigger use of the modified shader and in response to the validation failing, to trigger use of the received, unmodified, shader.

Assignments (2)
SECURITY INTEREST Recorded Jul 31, 2024
From: IMAGINATION TECHNOLOGIES LIMITED
To: FORTRESS INVESTMENT GROUP (UK) LTD
Reel/Frame 068221/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 14, 2022
From: KING, ROSTAM; THOMAS, WILLIAM
To: IMAGINATION TECHNOLOGIES LIMITED
Reel/Frame 061765/0183 →