1 // SwiftShader Software Renderer
\r
3 // Copyright(c) 2005-2012 TransGaming Inc.
\r
5 // All rights reserved. No part of this software may be copied, distributed, transmitted,
\r
6 // transcribed, stored in a retrieval system, translated into any human or computer
\r
7 // language by any means, or disclosed to third parties without the explicit written
\r
8 // agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
\r
9 // or implied, including but not limited to any patent rights, are granted to you.
\r
12 #include "TranslatorASM.h"
\r
14 #include "InitializeParseContext.h"
\r
16 TranslatorASM::TranslatorASM(rad::Shader *shaderObject, ShShaderType type, ShShaderSpec spec) : TCompiler(type, spec), shaderObject(shaderObject)
\r
20 bool TranslatorASM::translate(TIntermNode* root)
\r
22 TParseContext& parseContext = *GetGlobalParseContext();
\r
23 sh::OutputASM outputASM(parseContext, shaderObject);
\r
27 return parseContext.numErrors() == 0;
\r
31 // This function must be provided to create the actual
\r
32 // compile object used by higher level code. It returns
\r
33 // a subclass of TCompiler.
\r
35 TCompiler* ConstructCompiler(ShShaderType type, ShShaderSpec spec)
\r
37 return new TranslatorASM(0, type, spec);
\r
41 // Delete the compiler made by ConstructCompiler
\r
43 void DeleteCompiler(TCompiler* compiler)
\r