10#if defined(SK_ENABLE_SPIRV_CROSS)
12#include <spirv_hlsl.hpp>
22bool SPIRVtoHLSL(
const std::string& spirv, std::string* hlsl) {
23 spirv_cross::CompilerHLSL hlslCompiler((
const uint32_t*)spirv.c_str(),
24 spirv.size() /
sizeof(uint32_t));
26 spirv_cross::CompilerGLSL::Options optionsGLSL;
29 optionsGLSL.force_zero_initialized_variables =
true;
31 spirv_cross::CompilerHLSL::Options optionsHLSL;
32 optionsHLSL.shader_model = 51;
34 optionsHLSL.point_coord_compat =
true;
35 optionsHLSL.point_size_compat =
true;
37 hlslCompiler.set_common_options(optionsGLSL);
38 hlslCompiler.set_hlsl_options(optionsHLSL);
39 hlsl->assign(hlslCompiler.compile());
47namespace SkSL {
bool SPIRVtoHLSL(
const std::string&, std::string*) {
return false; } }
bool SPIRVtoHLSL(const std::string &, std::string *)