US2014043333A1PendingUtilityA1
Application load times by caching shader binaries in a persistent storage
Est. expiryJan 11, 2032(~5.5 yrs left)· nominal 20-yr term from priority
G06F 1/324G06F 1/3218Y02D10/00G06F 1/3265G06T 15/80G06F 11/3423
49
PatentIndex Score
0
Cited by
0
References
0
Claims
Abstract
A method for compiling a shader for execution by a graphics processor. The method comprises selecting a shader for execution. A key is computed for the selected shader. A memory is searched for a copy of the computed key. A shader binary stored in the memory is passed to the graphics processor for execution if the copy of the computed key is located in the memory. Otherwise, the shader is compiled to produce the shader binary for execution by the graphics processor and storing the shader binary in the memory. The shader binary is associated with the computed key and the copy of the computed key.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method for compiling a shader for execution by a graphics processor, the method comprising:
selecting a shader for execution; computing a computed key for the selected shader; searching a memory for a copy of the computed key; and passing a shader binary stored in the memory to the graphics processor for execution if the copy of the computed key is located in the memory, otherwise compiling the shader to produce a shader binary for execution by the graphics processor and storing the shader binary in the memory, wherein the shader binary is associated with the computed key and the copy of the computed key.
2 . The method of claim 1 , wherein compiling the shader to produce a shader binary comprises computing an associated key to be stored with the shader binary in the memory.
3 . The method of claim 1 further comprising:
verifying a checksum associated with the shader binary before execution by the graphics processor; and
recompiling the shader to produce a replacement shader binary for execution by the graphics processor and storing the shader binary in the memory if the verification fails.
4 . The method of claim 1 further comprising:
generating a first global key;
comparing the first global key to a second global key previously stored in the memory; and
invalidating all binaries stored in the memory if the first global key mismatches the second global key.
5 . The method of claim 2 , wherein a key is based on at least one of:
shader arguments; shader text; graphics driver version; graphics processor type/version; and compiler version.
6 . The method of claim 1 , wherein a shader binary is based on at least one of:
shader arguments; shader text; graphics driver version; graphics processor type/version; and compiler version.
7 . The method of claim 1 , wherein the storing the shader binary in the memory comprises storing an associated key and an associated checksum with the shader binary in the memory.
8 . A computer system comprising:
a processor; a graphics processor; and a memory, wherein the memory is operable to store instructions, that when executed by the processor perform a method for compiling a shader for execution by a graphics processor, the method comprising: selecting a shader for execution; computing a computed key for the selected shader; searching a memory for a copy of the computed key; and passing a shader binary stored in the memory to the graphics processor for execution if the copy of the computed key is located in the memory, otherwise compiling the shader to produce a shader binary for execution by the graphics processor and storing the shader binary in the memory, wherein the shader binary is associated with the computed key and the copy of the computed key.
9 . The computer system of claim 8 , wherein compiling the shader to produce a shader binary comprises computing an associated key to be stored with the shader binary in the memory.
10 . The computer system of claim 8 , wherein the method further comprises:
verifying a checksum associated with the shader binary before execution by the graphics processor; and recompiling the shader to produce a replacement shader binary for execution by the graphics processor and storing the shader binary in the memory if the verification fails.
11 . The computer system of claim 8 , wherein the method further comprises:
generating a first global key; comparing the first global key to a second global key previously stored in the memory; and invalidating all binaries stored in the memory if the first global key mismatches the second global key.
12 . The computer system of claim 9 , wherein a key is based on at least one of:
shader arguments; shader text; graphics driver version; graphics processor type/version; and compiler version.
13 . The computer system of claim 8 , wherein a shader binary is based on at least one of:
shader arguments; shader text; graphics driver version; graphics processor type/version; and compiler version.
14 . The computer system of claim 8 , wherein the storing the shader binary in the memory comprises storing an associated key and an associated checksum with the shader binary in the memory.
15 . A computer system comprising:
a compiler operable to compile and link shader source code to create a shader binary; a memory operable to store a plurality of shader binaries, wherein each shader binary is paired with an associated key; and a graphics driver module operable to select one or more shaders for execution by a graphics processor and to compute a computed key for a selected shader, and is further operable to search the memory for a copy of the computed key and pass a shader binary from the memory for execution by the graphics processor if the copy of the computed key is located in the memory, otherwise the compiler is operable to compile and link the shader to create a shader binary for execution by the graphics processor and storing the shader binary in the memory, wherein the shader binary is associated with the computed key and the copy of the computed key.
16 . The computer system of claim 15 , wherein the computed key associated with the shader binary is also stored in the memory.
17 . The computer system of claim 15 , wherein the graphics driver is further operable to:
verify a checksum associated with the shader binary before execution by the graphics processor; and recompile the shader source code to produce a replacement shader binary for execution by the graphics processor and storage in the memory if the verification fails.
18 . The computer system of claim 15 , wherein the graphics driver is further operable to compute a first global key, compare the first global key to a second global key previously stored in the memory, and invalidate all shader binaries stored in the memory if the first global key mismatches the second global key.
19 . The computer system of claim 16 , wherein a key is based on at least one of:
shader arguments; shader text; graphics driver version; graphics processor type/version; and compiler version.
20 . The computer system of claim 15 , wherein a shader binary is based on at least one of:
shader arguments; shader text; graphics driver version; graphics processor type/version; and compiler version.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.