int C_DECL Hlsl2Glsl_Translate( const ShHandle handle, const char* entry, ETargetVersion targetVersion, unsigned options) { if (handle == 0) return 0; HlslCrossCompiler* compiler = handle; compiler->infoSink.info.erase(); // \todo [2013-05-14 pyry] Maintain different support library per target version. initializeHLSLSupportLibrary(targetVersion); if (!compiler->IsASTTransformed() || !compiler->IsGlslProduced()) { compiler->infoSink.info.message(EPrefixError, "Shader does not have valid object code."); return 0; } bool ret = compiler->GetLinker()->link(compiler, entry, targetVersion, options); finalizeHLSLSupportLibrary(); return ret ? 1 : 0; }
int C_DECL Hlsl2Glsl_Translate( const ShHandle handle, const char* entry, int options ) { if (handle == 0) return 0; HlslCrossCompiler* compiler = handle; compiler->infoSink.info.erase(); if (!compiler->IsASTTransformed() || !compiler->IsGlslProduced()) { compiler->infoSink.info.message(EPrefixError, "Shader does not have valid object code."); return 0; } bool ret = compiler->GetLinker()->link(compiler, entry, (options & ETranslateOpUsePrecision) ? true : false); return ret ? 1 : 0; }
int C_DECL Hlsl2Glsl_Translate( const ShHandle handle, const char* entry, ETargetVersion targetVersion, unsigned options) { if (handle == 0) return 0; HlslCrossCompiler* compiler = handle; compiler->infoSink.info.erase(); if (!compiler->IsASTTransformed() || !compiler->IsGlslProduced()) { compiler->infoSink.info.message(EPrefixError, "Shader does not have valid object code."); return 0; } bool ret = compiler->GetLinker()->link(compiler, entry, targetVersion, options); return ret ? 1 : 0; }