def evaluateCode(compiler, prgm, name, vscode, fscode): vscontext = DataflowTransformContext(compiler, prgm, vscode) fscontext = DataflowTransformContext(compiler, prgm, fscode) shaderprgm = evaluateShaderProgram(compiler, name, vscontext, fscontext) return ########################################################### with compiler.console.scope('debug dump'): dumpreport.evaluate(compiler, shaderprgm.prgm, "shaderProgram") raise compilerexceptions.CompilerAbort, "testing" with compiler.console.scope('flatten trees'): vscontext.findAndFlattenTrees() fscontext.findAndFlattenTrees() with compiler.console.scope('link'): # Ensure that identical uniforms are named the same vsuniforms = vscontext.uniformTree() fsuniforms = fscontext.uniformTree() vsuniforms.harmonize(fsuniforms, 'common') # Name the rest of the tree nodes # HACK avoid name conflicts by explicitly naming the trees vsuniforms.nameTree('uniform_vs') fsuniforms.nameTree('uniform_fs') # Link the shaders together and see what is unused. vscontext.link(fscontext) iotransform.killUnusedOutputs(fscontext) fscontext.simplify() # TODO load eliminate uniform -> varying # Find the live I/O live = fscontext.findLiveLinkedInputs() vscontext.findLive(vscontext.trees.contextOut, live) # Remove the dead outputs from the vertex shader def filterLive(name, slot): return name in live vscontext.dataflow.exit.filterUses(filterLive) vscontext.simplify() with compiler.console.scope('synthesize'): vscontext.synthesize() fscontext.synthesize() bind.generateBindingClass(vscontext, fscontext) with compiler.console.scope('dump'): vscontext.dump() fscontext.dump()
def evaluateCode(compiler, prgm, name, vscode, fscode): vscontext = DataflowTransformContext(compiler, prgm, vscode) fscontext = DataflowTransformContext(compiler, prgm, fscode) shaderprgm = evaluateShaderProgram(compiler, name, vscontext, fscontext) return ########################################################### with compiler.console.scope('debug dump'): dumpreport.evaluate(compiler, shaderprgm.prgm, "shaderProgram") raise compilerexceptions.CompilerAbort, "testing" with compiler.console.scope('flatten trees'): vscontext.findAndFlattenTrees() fscontext.findAndFlattenTrees() with compiler.console.scope('link'): # Ensure that identical uniforms are named the same vsuniforms = vscontext.uniformTree() fsuniforms = fscontext.uniformTree() vsuniforms.harmonize(fsuniforms, 'common') # Name the rest of the tree nodes # HACK avoid name conflicts by explicitly naming the trees vsuniforms.nameTree('uniform_vs') fsuniforms.nameTree('uniform_fs') # Link the shaders together and see what is unused. vscontext.link(fscontext) iotransform.killUnusedOutputs(fscontext) fscontext.simplify() # TODO load eliminate uniform -> varying # Find the live I/O live = fscontext.findLiveLinkedInputs() vscontext.findLive(vscontext.trees.contextOut, live) # Remove the dead outputs from the vertex shader def filterLive(name, slot): return name in live vscontext.dataflow.exit.filterUses(filterLive) vscontext.simplify() with compiler.console.scope('synthesize'): vscontext.synthesize() fscontext.synthesize() bind.generateBindingClass(vscontext, fscontext) with compiler.console.scope('dump'): vscontext.dump() fscontext.dump()
def prgmDump(self): dumpreport.evaluate(self.compiler, self.prgm, self.code.codeName())
def prgmDump(self): dumpreport.evaluate(self.compiler, self.prgm, self.code.codeName())