On Sun, 26 Dec 2021 at 05:43, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
{VKD3D_SHADER_SOURCE_D3D_BYTECODE, "d3dbc", "Legacy Direct3D byte-code.\n" " This is the format used for Direct3D shader model 1, 2, and 3 shaders.\n", - true}, + true, VKD3D_SHADER_TARGET_SPIRV_BINARY},
On some level this is fine, but note that SPIR-V isn't currently a supported target type for d3dbc...
+ if (options.source_type == VKD3D_SHADER_SOURCE_NONE) + { + uint32_t token; + + if (options.preprocess_only) + { + options.source_type = VKD3D_SHADER_SOURCE_HLSL; + } + else if (info.source.size >= sizeof(token)) + { + memcpy(&token, info.source.code, sizeof(token)); + if (token == TAG_DXBC) + options.source_type = VKD3D_SHADER_SOURCE_DXBC_TPF;
Note that DXBC containers can also contain e.g. DXIL or Aon9 source though.