From cf3f404d312146cf46ae27fd8d220852eac27eb9 Mon Sep 17 00:00:00 2001 From: reduz Date: Sun, 25 Jul 2021 11:22:55 -0300 Subject: 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. --- doc/classes/RDShaderBytecode.xml | 71 ---------------------------------------- doc/classes/RDShaderFile.xml | 6 ++-- doc/classes/RDShaderSPIRV.xml | 71 ++++++++++++++++++++++++++++++++++++++++ doc/classes/RenderingDevice.xml | 24 +++++++++++--- 4 files changed, 94 insertions(+), 78 deletions(-) delete mode 100644 doc/classes/RDShaderBytecode.xml create mode 100644 doc/classes/RDShaderSPIRV.xml (limited to 'doc/classes') diff --git a/doc/classes/RDShaderBytecode.xml b/doc/classes/RDShaderBytecode.xml deleted file mode 100644 index 20bf9bdd72..0000000000 --- a/doc/classes/RDShaderBytecode.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 @@ - - + + @@ -24,7 +24,7 @@ - + diff --git a/doc/classes/RDShaderSPIRV.xml b/doc/classes/RDShaderSPIRV.xml new file mode 100644 index 0000000000..c9aefe31dc --- /dev/null +++ b/doc/classes/RDShaderSPIRV.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index 901a985961..c73c2ddfd7 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -635,8 +635,16 @@ - - + + + + + + + + + + @@ -645,10 +653,18 @@ - + - + + + + + + + + + -- cgit v1.2.3