diff options
author | reduz <reduzio@gmail.com> | 2021-07-25 11:22:55 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2021-07-26 08:40:39 -0300 |
commit | cf3f404d312146cf46ae27fd8d220852eac27eb9 (patch) | |
tree | 4663011618e5523c29d3cf50e6a0ae18dec69ec1 /doc/classes/RDShaderFile.xml | |
parent | e2ebc7db58c0bd61504c592f9760aaf1389af0b9 (diff) |
Implement Binary Shader Compilation
* Added an extra stage before compiling shader, which is generating a binary blob.
* On Vulkan, this allows caching the SPIRV reflection information, which is expensive to parse.
* On other (future) RenderingDevices, it allows caching converted binary data, such as DXIL or MSL.
This PR makes the shader cache include the reflection information, hence editor startup times are significantly improved.
I tested this well and it appears to work, and I added a lot of consistency checks, but because it includes writing and reading binary information, rare bugs may pop up, so be aware.
There was not much of a choice for storing the reflection information, given shaders can be a lot, take a lot of space and take time to parse.
Diffstat (limited to 'doc/classes/RDShaderFile.xml')
-rw-r--r-- | doc/classes/RDShaderFile.xml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/classes/RDShaderFile.xml b/doc/classes/RDShaderFile.xml index 346a97a1c0..dab2b9822f 100644 --- a/doc/classes/RDShaderFile.xml +++ b/doc/classes/RDShaderFile.xml @@ -7,8 +7,8 @@ <tutorials> </tutorials> <methods> - <method name="get_bytecode" qualifiers="const"> - <return type="RDShaderBytecode"> + <method name="get_spirv" qualifiers="const"> + <return type="RDShaderSPIRV"> </return> <argument index="0" name="version" type="StringName" default="&"""> </argument> @@ -24,7 +24,7 @@ <method name="set_bytecode"> <return type="void"> </return> - <argument index="0" name="bytecode" type="RDShaderBytecode"> + <argument index="0" name="bytecode" type="RDShaderSPIRV"> </argument> <argument index="1" name="version" type="StringName" default="&"""> </argument> |