Method and apparatus of cross shader compilation
AssigneeAdvanced Micro Devices, Inc.
InventorsGuohua Jin, Michael John Bedy
Life of this patent
Estimating the term…
Abstract
A method and apparatus provides for compiling a plurality of shaders, each shader having a plurality of computer-readable statements, into a plurality of computer-executable instructions. In one example, the method and apparatus, using a computing device, receives the plurality of shaders used in a process pipeline for performing at least one shading function, determines a shader type of each of the plurality of shaders based on the at least one shading function, and compiles the plurality of shaders by generating the computer-executable instructions using data including a shader descriptor for each of the plurality of shaders, resulting in the shading functions of the plurality of shaders combined together.
Claims22
A method, by a computing device, of compiling a plurality of shaders, each shader having a plurality of computer-readable statements, into a plurality of computer-executable instructions, comprising:
- receiving, using the computing device, the plurality of shaders used in a process pipeline for performing at least one shading function;
- determining, using the computing device, a shader type of each of the plurality of shaders to be compiled based on the at least one shading function, the plurality of shader types including one or more of:
- a vertex shader, a fetch shader, a shader compiled for a merged shader, a geometry shader, a hull shader and a compute shader;
- determining combinable shaders of different types among the plurality of shaders that are combinable at runtime;
- generating a shader descriptor object based on the determined combinable shaders of different types, the shader descriptor object configured to provide data comprising a unique identification number of a shader descriptor, a convention type indicating a call type, return values to a calling shader and a return address of the calling shader;
- and
- compiling, using the computing device, the plurality of shaders of different types by generating as part of a compiling operation, data including the shader descriptor object in response to determining the shader type of each of the plurality of shaders and generating the computer-executable instructions using the shader descriptor object, resulting in the shading functions of the plurality of shaders combined together.
A computing device having a processor operative to compile a plurality of shaders, each shader having a plurality of computer-readable statements, into a plurality of computer-executable instructions, the processor being configured to:
- receive, using the computing device, the plurality of shaders used in a process pipeline for performing at least one shading function;
- determine, using the computing device, a shader type of each of the plurality of shaders to be compiled based on the at least one shading function, the plurality of shader types including one or more of:
- a vertex shader, a fetch shader, a shader compiled for a merged shader, a geometry shader, a hull shader and a compute shader;
- determine combinable shaders of different types among the plurality of shaders that are combinable at runtime;
- generate a shader descriptor object based on the determined combinable shaders of different types, the shader descriptor object configured to provide data comprising a unique identification number of a shader descriptor, a convention type indicating a call type, return values to a calling shader and a return address of the calling shader;
- and
- compile, using the computing device, the plurality of shaders of different types by generating as part of a compiling operation, data including the shader descriptor object in response to determining the shader type of each of the plurality of shaders and generating the computer-executable instructions using the shader descriptor object, resulting in the shading functions of the plurality of shaders combined together.
A non-transitory computer readable storage medium comprising executable instructions that when executed by one or more processors cause the one or more processors to:
- receive, using a computing device, a plurality of shaders used in a process pipeline for performing at least one shading function;
- determine, using the computing device, a shader type of each of the plurality of shaders to be compiled based on the at least one shading function, the plurality of shader types including one or more of:
- a vertex shader, a fetch shader, a shader compiled for a merged shader, a geometry shader, a hull shader and a compute shader;
- determine combinable shaders of different types among the plurality of shaders that are combinable at runtime;
- generate a shader descriptor object based on the determined combinable shaders of different types, the shader descriptor object configured to provide data comprising a unique identification number of a shader descriptor, a convention type indicating a call type, return values to a calling shader and a return address of the calling shader;
- and
- compile, using the computing device, the plurality of shaders of different types by generating as part of a compiling operation, data including the shader descriptor object in response to determining the shader type of each of the plurality of shaders and generating the computer-executable instructions using the shader descriptor object, resulting in the shading functions of the plurality of shaders combined together.
Dependencies are inferred from the claim text.