Pass through and allow different source shader encodings when editing

* This means e.g. the D3D11 back-end can accept DXBC directly if the UI can
  provide it, or compile from HLSL as before.
* More importantly, the Vulkan back-end can take SPIR-V compiled from any
  source, or compile from GLSL as before as a fall-back.
This commit is contained in:
baldurk
2018-08-09 16:56:52 +01:00
parent 24a5375133
commit a81e4a2b45
28 changed files with 432 additions and 286 deletions
+4 -2
View File
@@ -881,14 +881,16 @@ See :meth:`BuildCustomShader`.
The language used is native to the API's renderer - HLSL for D3D based renderers, GLSL otherwise.
:param str entry: The entry point to use when compiling.
:param str source: The source file.
:param ShaderEncoding sourceEncoding: The encoding of the source data.
:param bytes source: The source data itself.
:param ShaderCompileFlags compileFlags: API-specific compilation flags.
:param ShaderStage type: The stage that this shader will be executed at.
:return: A ``tuple`` with the id of the new shader if compilation was successful,
:meth:`ResourceId.Null` otherwise, and a ``str`` with any warnings/errors from compilation.
:rtype: ``tuple`` of :class:`ResourceId` and ``str``.
)");
virtual rdcpair<ResourceId, rdcstr> BuildTargetShader(const char *entry, const char *source,
virtual rdcpair<ResourceId, rdcstr> BuildTargetShader(const char *entry,
ShaderEncoding sourceEncoding, bytebuf source,
const ShaderCompileFlags &flags,
ShaderStage type) = 0;