Method and graphics processing system for rendering one or more fragments having shader-dependent properties
Abstract
A graphics processing unit and method for processing fragments in a graphics processing system which includes: (i) hidden surface removal logic configured to perform hidden surface removal on fragments, and (ii) processing logic configured to execute shader programs for fragments. Initial processing of fragments is performed at the hidden surface removal logic. Some of the fragments have a shader-dependent property. A shader program for a particular fragment having the shader-dependent property is split into two stages. The initial processing comprises performing a depth test on the particular fragment. In response to the particular fragment passing the depth test of the initial processing in the hidden surface removal logic, a first stage, but not a second stage, of the shader program is executed for the particular fragment at the processing logic. The first stage of the shader program has instructions for determining the property of the particular fragment.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A compiler configured to analyse a shader program for execution in a graphics processing system which comprises: (i) hidden surface removal logic configured to perform hidden surface removal on fragments, and (ii) processing logic configured to execute shader programs for fragments, wherein one or more of the fragments has a shader-dependent property, the compiler being configured to:
identify an instruction in the shader program which can affect the shader-dependent property of a fragment; split the shader program into stages by splitting the shader program at a point after the identified instruction in the shader program; and store the stages of the shader program in a memory, wherein the graphics processing system can read the stages of the shader program from the memory.
2 . The compiler of claim 1 , wherein the compiler is configured to split the shader program into two stages, and wherein the identified instruction is the final instruction in the shader program which can affect the shader-dependent property of a fragment.
3 . The compiler of claim 1 , wherein the point at which the shader program is split is a point immediately after the identified instruction in the shader program.
4 . The compiler of claim 1 , wherein the graphics processing system can read the stages of the shader program from the memory separately.
5 . The compiler of claim 1 , wherein the shader-dependent property is shader-dependent presence, and wherein the instruction which can affect the shader-dependent presence is a discard instruction.
6 . The compiler of claim 1 , wherein the shader-dependent property is shader-dependent depth, and wherein the instruction which can affect the shader-dependent depth is an instruction for modifying the depth of a fragment.
7 . The compiler of claim 1 , wherein the compiler is configured to identify the instruction, split the shader program and store the stages of the shader program in the memory prior to starting a render which involves executing the shader program on the graphics processing system.
8 . The compiler of claim 1 , the compiler further configured to determine whether any data from a first stage of the shader program is used in a second stage of the shader program.
9 . The compiler of claim 8 , wherein when data from the first stage of the shader program is used in the second stage of the shader program then, during execution of the shader program by the graphics processing system, either:
(i) said data from the first stage of the shader program is stored, and said stored data is retrieved for use when executing the second stage of the shader program, or (ii) the first stage of the shader program is re-executed when the second stage of the shader program is to be executed; wherein the compiler is configured to, if it is determined that data from the first stage of the shader program is used in the second stage of the shader program, decide, prior to starting a render which involves executing the shader program, which of options (i) and (ii) is to be performed by the graphics processing system.
10 . The compiler of claim 8 , wherein when data from the first stage of the shader program is used in the second stage of the shader program then, during execution of the shader program by the graphics processing system, either:
(i) said data from the first stage of the shader program is stored, and said stored data is retrieved for use when executing the second stage of the shader program, or (ii) the first stage of the shader program is re-executed when the second stage of the shader program is to be executed; wherein the compiler is configured to, if it is determined that data from the first stage of the shader program is used in the second stage of the shader program, provide a metric for use by the graphics processing system in deciding, during runtime, which of options (i) and (ii) to perform.
11 . A method of analysing a shader program for execution in a graphics processing system which comprises: (i) hidden surface removal logic configured to perform hidden surface removal on fragments, and (ii) processing logic configured to execute shader programs for fragments, wherein one or more of the fragments has a shader-dependent property, the method comprising:
identifying an instruction in the shader program which can affect the shader-dependent property of a fragment; splitting the shader program into stages by splitting the shader program at a point after the identified instruction in the shader program; and storing the stages of the shader program in a memory, wherein the graphics processing system can read the stages of the shader program from the memory.
12 . The method of claim 11 , wherein the shader program is split into two stages, and wherein the identified instruction is the final instruction in the shader program which can affect the shader-dependent property of a fragment.
13 . The method of claim 11 , wherein the point at which the shader program is split is a point immediately after the identified instruction in the shader program.
14 . The method of claim 11 , wherein the graphics processing system can read the stages of the shader program from the memory separately.
15 . The method of claim 11 , wherein the shader-dependent property is shader-dependent presence, and wherein the instruction which can affect the shader-dependent presence is a discard instruction.
16 . The method of claim 11 , wherein the shader-dependent property is shader-dependent depth, and wherein the instruction which can affect the shader-dependent depth is an instruction for modifying the depth of a fragment.
17 . The method of claim 11 , wherein the method is performed prior to starting a render which involves executing the shader program on the graphics processing system.
18 . The method of claim 11 , further comprising determining whether any data from a first stage of the shader program is used in a second stage of the shader program.
19 . The method of claim 18 , wherein when data from the first stage of the shader program is used in the second stage of the shader program then, during execution of the shader program by the graphics processing system, either:
(i) said data from the first stage of the shader program is stored, and said stored data is retrieved for use when executing the second stage of the shader program, or (ii) the first stage of the shader program is re-executed when the second stage of the shader program is to be executed; wherein if it is determined that data from the first stage of the shader program is used in the second stage of the shader program then the method further comprises deciding, prior to starting a render which involves executing the shader program, which of options (i) and (ii) is to be performed by the graphics processing system.
20 . The method of claim 18 , wherein when data from the first stage of the shader program is used in the second stage of the shader program then, during execution of the shader program by the graphics processing system, either:
(i) said data from the first stage of the shader program is stored, and said stored data is retrieved for use when executing the second stage of the shader program, or (ii) the first stage of the shader program is re-executed when the second stage of the shader program is to be executed; wherein if it is determined that data from the first stage of the shader program is used in the second stage of the shader program then the method further comprises providing a metric for use by the graphics processing system in deciding, during runtime, which of options (i) and (ii) to perform.Join the waitlist — get patent alerts
Track US2023230319A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.