Methods and systems for generating shaders to emulate a fixed-function graphics pipeline
AssigneeChannel One Holdings Inc.
InventorAidan Fabius
Life of this patent
Estimating the term…
Abstract
Methods, systems, and computer-readable media for rendering graphics using a graphics pipeline for emulating a fixed-function graphics pipeline, including selecting a first pre-compiled shader chunk from a set of pre-compiled shader chunks, selecting at least one second pre-compiled shader chunk from the set of pre-compiled shader chunks, and, concatenating the first shader chunk with the at least one second shader chunk, wherein each shader chunk corresponds to a fixed-function graphics function.
Claims14
A method for emulating a fixed-function graphics pipeline using a graphics processing unit with a programmable graphics pipeline, comprising:
- a processor selecting, based on a conditional logic script that determines which of a set of pre-compiled shader chunks to concatenate to emulate a function of a fixed-function graphics application programming interface, a first pre-compiled shader chunk from the set of pre-compiled shader chunks, wherein the first pre-compiled shader chunk comprises a first plurality of machine code instructions for execution by the graphics processing unit, wherein the first plurality of machine code instructions in the first pre-compiled shader chunk excludes branches and loops;
- the processor selecting, based on the conditional logic script, at least one second pre-compiled shader chunk from the set of pre-compiled shader chunks, wherein each at least one second pre-compiled shader chunk comprises a respective plurality of machine code instructions for execution by the graphics processing unit, wherein each respective plurality of machine code instructions in the at least one second pre-compiled shader chunk excludes branches and loops;
- based on the conditional logic script, the processor concatenating the first pre-compiled shader chunk with the at least one second pre-compiled shader chunk to form a shader program that excludes branches and loops, wherein the shader program comprises machine code instructions for execution by the graphics processing unit;
- and
- following concatenation of the first pre-compiled shader chunk with the at least one second pre-compiled shader chunk to form the shader program, the graphics processing unit executing the shader program to emulate the fixed-function graphics pipeline.
A system for rendering graphics, comprising:
- at least one graphics processing unit;
- at least one non-transient computer-readable medium storing a set of pre-compiled shader chunks;
- a processor, the processor configured to:
- select, based on a conditional logic script that determines which of a set of pre-compiled shader chunks to concatenate to emulate a function of a fixed-function graphics application programming interface, a first pre-compiled shader chunk from the set of pre-complied shader chunks, wherein the first pre-compiled shader chunk comprises a first plurality of machine code instructions for execution by the graphics processing unit, wherein the first plurality of machine code instructions in the first pre-compiled shader chunk excludes branches and loops;
- select, based on the conditional logic script, at least one second pre-compiled shader chunk from the set of pre-compiled shader chunks, wherein each at least one second pre-compiled shader chunk comprises a respective plurality of machine code instructions for execution by the graphics processing unit, wherein each respective plurality of machine code instructions in the at least one second pre-compiled shader chunk excludes branches and loops;
- based on the conditional logic script, concatenate the first pre-compiled shader chunk with the at least one second pre-compiled shader chunk;
- and,
- generate a shader program that excludes branches and loops from the concatenated shader chunks, wherein the shader program comprises machine code instructions for execution by the graphics processing unit;
- and
- the at least one graphics processing unit configured to execute the shader program to emulate the fixed-function graphics pipeline following concatenation of the first pre-compiled shader chunk with the at least one second pre-compiled shader chunk to form the shader program.
A non-transitory computer-readable medium storing first and second computer-executable instructions, the first computer-executable instructions comprising a set of pre-compiled shader chunks, wherein each of the pre-compiled shader chunks comprises a respective plurality of machine code instructions for execution by a graphics processing unit with a programmable graphics pipeline, the second computer-executable instructions comprising a conditional logic script that determines which of a set of pre-compiled shader chunks to concatenate to emulate a function of a fixed-function graphics application programming interface, which when executed by a processor and the graphics processing unit causes the processor to carry out a method for emulating a fixed-function graphics pipeline using the graphics processing unit, the method comprising:
- the processor selecting, based on the conditional logic script, a first pre-compiled shader chunk from the set of pre-compiled shader chunks, wherein the first pre-compiled shader chunk comprises a first plurality of machine code instructions for execution by the graphics processing unit, wherein the first plurality of machine code instructions in the first pre-compiled shader chunk excludes branches and loops;
- the processor selecting, based on the conditional logic script, at least one second pre-compiled shader chunk from the set of pre-compiled shader chunks, wherein each at least one second pre-compiled shader chunk comprises a respective plurality of machine code instructions for execution by the graphics processing unit, wherein each respective plurality of machine code instructions in the at least one second pre-compiled shader chunk excludes branches and loops;
- based on the conditional logic script, the processor concatenating the first pre-compiled shader chunk with the at least one second pre-compiled shader chunk to form a shader program that excludes branches and loops, wherein the shader program comprises machine code instructions for execution by the graphics processing unit;
- and
- following concatenation of the first pre-compiled shader chunk with the at least one second pre-compiled shader chunk to form the shader program, the graphics processing unit executing the shader program to emulate the fixed-function graphics pipeline.
Dependencies are inferred from the claim text.