def process(context): rewriter = intrinsics.makeIntrinsicRewriter(context.compiler.extractor) gt = GLSLTranslator(context.code, context.pa, rewriter, context.trees.inputLUT, context.trees.outputLUT) result = gt.process(context.cfg) # HACK for debugging s = codegen.evaluateCode(context.compiler, result) if context.show: print s return compressGLSL(s)
def process(compiler, prgm, exgraph, poolanalysis, shaderprgm, ioinfo): rewriter = intrinsics.makeIntrinsicRewriter(compiler.extractor) trans = GLSLTranslator(compiler, poolanalysis, rewriter, ioinfo) trans.inputID = "inp" trans.outputID = "v2f" processContext(compiler, trans, shaderprgm.vscontext) trans.inputID = "v2f" trans.outputID = "out" processContext(compiler, trans, shaderprgm.fscontext) return trans
def processCode(compiler, prgm, exgraph, ioinfo, prepassInfo, poolInfo, context, shaderprgm): rewriter = intrinsics.makeIntrinsicRewriter(compiler.extractor) trans = GLSLTranslator(compiler, prepassInfo, poolInfo, rewriter, ioinfo, context) result = trans.process(context.code) uniblock = buildBlocks(prepassInfo, shaderprgm, context) s = codegen.evaluateCode(compiler, result, uniblock) #print #print s #print context.shaderCode = s