2020-04-20 10:19:21 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<class name="RDShaderFile" inherits="Resource" version="4.0">
|
|
|
|
<brief_description>
|
|
|
|
</brief_description>
|
|
|
|
<description>
|
|
|
|
</description>
|
|
|
|
<tutorials>
|
|
|
|
</tutorials>
|
|
|
|
<methods>
|
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.
2021-07-25 22:22:55 +08:00
|
|
|
<method name="get_spirv" qualifiers="const">
|
|
|
|
<return type="RDShaderSPIRV">
|
2020-04-20 10:19:21 +08:00
|
|
|
</return>
|
2021-06-06 03:24:24 +08:00
|
|
|
<argument index="0" name="version" type="StringName" default="&""">
|
2020-04-20 10:19:21 +08:00
|
|
|
</argument>
|
|
|
|
<description>
|
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
<method name="get_version_list" qualifiers="const">
|
|
|
|
<return type="PackedStringArray">
|
|
|
|
</return>
|
|
|
|
<description>
|
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
<method name="set_bytecode">
|
|
|
|
<return type="void">
|
|
|
|
</return>
|
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.
2021-07-25 22:22:55 +08:00
|
|
|
<argument index="0" name="bytecode" type="RDShaderSPIRV">
|
2020-04-20 10:19:21 +08:00
|
|
|
</argument>
|
2021-06-06 03:24:24 +08:00
|
|
|
<argument index="1" name="version" type="StringName" default="&""">
|
2020-04-20 10:19:21 +08:00
|
|
|
</argument>
|
|
|
|
<description>
|
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
</methods>
|
|
|
|
<members>
|
|
|
|
<member name="base_error" type="String" setter="set_base_error" getter="get_base_error" default="""">
|
|
|
|
</member>
|
|
|
|
</members>
|
|
|
|
<constants>
|
|
|
|
</constants>
|
|
|
|
</class>
|