John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame^] | 1 | // SwiftShader Software Renderer
|
| 2 | //
|
| 3 | // Copyright(c) 2005-2012 TransGaming Inc.
|
| 4 | //
|
| 5 | // All rights reserved. No part of this software may be copied, distributed, transmitted,
|
| 6 | // transcribed, stored in a retrieval system, translated into any human or computer
|
| 7 | // language by any means, or disclosed to third parties without the explicit written
|
| 8 | // agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
|
| 9 | // or implied, including but not limited to any patent rights, are granted to you.
|
| 10 | //
|
| 11 |
|
| 12 | #include "TranslatorASM.h"
|
| 13 |
|
| 14 | #include "InitializeParseContext.h"
|
| 15 |
|
| 16 | TranslatorASM::TranslatorASM(gl::Shader *shaderObject, ShShaderType type, ShShaderSpec spec) : TCompiler(type, spec), shaderObject(shaderObject)
|
| 17 | {
|
| 18 | }
|
| 19 |
|
| 20 | void TranslatorASM::translate(TIntermNode* root)
|
| 21 | {
|
| 22 | TParseContext& parseContext = *GetGlobalParseContext();
|
| 23 | sh::OutputASM outputASM(parseContext, shaderObject);
|
| 24 |
|
| 25 | outputASM.output();
|
| 26 | }
|
| 27 |
|
| 28 | //
|
| 29 | // This function must be provided to create the actual
|
| 30 | // compile object used by higher level code. It returns
|
| 31 | // a subclass of TCompiler.
|
| 32 | //
|
| 33 | TCompiler* ConstructCompiler(ShShaderType type, ShShaderSpec spec)
|
| 34 | {
|
| 35 | return new TranslatorASM(0, type, spec);
|
| 36 | }
|
| 37 |
|
| 38 | //
|
| 39 | // Delete the compiler made by ConstructCompiler
|
| 40 | //
|
| 41 | void DeleteCompiler(TCompiler* compiler)
|
| 42 | {
|
| 43 | delete compiler;
|
| 44 | } |