Skip to content

Commit

Permalink
[shgraph] renamed compile3 to compile as other functions were removed
Browse files Browse the repository at this point in the history
  • Loading branch information
EspeuteClement committed Apr 8, 2024
1 parent c91e177 commit 240d506
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions hide/view/shadereditor/ShaderEditor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class ShaderEditor extends hide.view.Graph {

element.find("#display2").on("click", () -> {
@:privateAccess info(
hxsl.Printer.shaderToString(shaderGraph.compile3(domain).shader.data, true)
hxsl.Printer.shaderToString(shaderGraph.compile(domain).shader.data, true)
);});

editorMatrix.on("click", "input, select", function(ev) {
Expand Down Expand Up @@ -1131,7 +1131,7 @@ class ShaderEditor extends hide.view.Graph {
function displayCompiled(type : String) {
var text = "\n";

var def = shaderGraph.compile3(null);
var def = shaderGraph.compile(null);

if( def != null) {
text += switch( type ) {
Expand All @@ -1155,7 +1155,7 @@ class ShaderEditor extends hide.view.Graph {
for (m in obj.getMaterials())
m.mainPass.removeShader(currentShader);

var shaderGraphDef = shaderGraph.compile3(null);
var shaderGraphDef = shaderGraph.compile(null);
newShader = new hxsl.DynamicShader(shaderGraphDef.shader);
for (init in shaderGraphDef.inits) {
setParamValue(newShader, init.variable, init.value);
Expand Down Expand Up @@ -1193,7 +1193,7 @@ class ShaderEditor extends hide.view.Graph {
}
}

currentShaderPreviewsDef = shaderGraph.compile3(domain);
currentShaderPreviewsDef = shaderGraph.compile(domain);
}

function updateParam(id : Int) {
Expand Down
2 changes: 1 addition & 1 deletion hrt/prefab/DynamicShader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class DynamicShader extends Shader {
var shgraph = Std.downcast(hxd.res.Loader.currentInstance.load(source).toPrefab().load(), hrt.shgraph.ShaderGraph);
if (shgraph == null)
throw source + " is not a valid shadergraph";
shaderDef = shgraph.compile3(null);
shaderDef = shgraph.compile(null);
}
else if( isInstance && !isShadergraph ) {
shaderClass = loadShaderClass();
Expand Down
2 changes: 1 addition & 1 deletion hrt/prefab/rfx/ScreenShaderGraph.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ScreenShaderGraph extends RendererFX {
public function loadShaderDef() {
if (shaderGraph == null)
resolveRef();
shaderDef = shaderGraph.compile3(null);
shaderDef = shaderGraph.compile(null);
if(shaderDef == null)
return;

Expand Down
10 changes: 5 additions & 5 deletions hrt/shgraph/ShaderGraph.hx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ ExternVarDef {
}

@:access(hrt.shgraph.Graph)
class ShaderGraphGenContext2 {
class ShaderGraphGenContext {
var graph : Graph;
var includePreviews : Bool;

Expand Down Expand Up @@ -423,7 +423,7 @@ class ShaderGraph extends hrt.prefab.Prefab {
return dynamicType;
}

public function compile3(?previewDomain: Domain) : hrt.prefab.Cache.ShaderDef {
public function compile(?previewDomain: Domain) : hrt.prefab.Cache.ShaderDef {
var inits : Array<{variable: TVar, value: Dynamic}>= [];

var shaderData : ShaderData = {
Expand All @@ -440,7 +440,7 @@ class ShaderGraph extends hrt.prefab.Prefab {
if (previewDomain != null && previewDomain != graph.domain)
continue;
nodeGen.domain = graph.domain;
var ctx = new ShaderGraphGenContext2(graph);
var ctx = new ShaderGraphGenContext(graph);
var gen = ctx.generate(nodeGen);

var fnKind : FunctionKind = switch(previewDomain != null ? Fragment : graph.domain) {
Expand Down Expand Up @@ -513,7 +513,7 @@ class ShaderGraph extends hrt.prefab.Prefab {
}

public function makeShaderInstance() : hxsl.DynamicShader {
var def = compile3(null);
var def = compile(null);
var s = new hxsl.DynamicShader(def.shader);
for (init in def.inits)
setParamValue(s, init.variable, init.value);
Expand Down Expand Up @@ -816,7 +816,7 @@ class Graph {
}

public function hasCycle() : Bool {
var ctx = new ShaderGraphGenContext2(this, false);
var ctx = new ShaderGraphGenContext(this, false);
@:privateAccess ctx.initNodes();
var res = @:privateAccess ctx.sortGraph();
return res == null;
Expand Down
6 changes: 3 additions & 3 deletions hrt/shgraph/nodes/SubGraph.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SubGraph extends ShaderNode {
#end
var graph = shader.getGraph(ctx.domain);

var genCtx = new ShaderGraphGenContext2(graph, false);
var genCtx = new ShaderGraphGenContext(graph, false);
genCtx.generate(new NodeGenContext.NodeGenContextSubGraph(ctx));
}

Expand All @@ -36,7 +36,7 @@ class SubGraph extends ShaderNode {
#end
var graph = shader.getGraph(hrt.shgraph.Domain.Fragment);

var genCtx = new ShaderGraphGenContext2(graph, false);
var genCtx = new ShaderGraphGenContext(graph, false);
var nodeGenCtx = new NodeGenContext.NodeGenContextSubGraph(null);
genCtx.generate(nodeGenCtx);
var inputs: Array<ShaderNode.InputInfo> = [];
Expand All @@ -58,7 +58,7 @@ class SubGraph extends ShaderNode {
#end
var graph = shader.getGraph(hrt.shgraph.Domain.Fragment);

var genCtx = new ShaderGraphGenContext2(graph, false);
var genCtx = new ShaderGraphGenContext(graph, false);
var nodeGenCtx = new NodeGenContext.NodeGenContextSubGraph(null);
genCtx.generate(nodeGenCtx);
var outputs: Array<ShaderNode.InputInfo> = [];
Expand Down

0 comments on commit 240d506

Please sign in to comment.