Skip to content

Commit

Permalink
Merge pull request armory3d#197 from QuantumCoderQC/HL-compile-fix
Browse files Browse the repository at this point in the history
Change bind and shader constant names
  • Loading branch information
luboslenco authored Sep 18, 2023
2 parents b24bfd8 + e5c187d commit 13155c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions Sources/iron/data/SceneFormat.hx
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ typedef TBindConstant = {
@:structInit class TBindConstant {
#end
public var name: String;
@:optional public var vec4: Float32Array;
@:optional public var vec3: Float32Array;
@:optional public var vec2: Float32Array;
@:optional public var float: Null<FastFloat>;
@:optional public var bool: Null<Bool>;
@:optional public var int: Null<Int>;
@:optional public var vec4Value: Float32Array;
@:optional public var vec3Value: Float32Array;
@:optional public var vec2Value: Float32Array;
@:optional public var floatValue: Null<FastFloat>;
@:optional public var boolValue: Null<Bool>;
@:optional public var intValue: Null<Int>;
}

#if js
Expand Down Expand Up @@ -275,12 +275,12 @@ typedef TShaderConstant = {
public var name: String;
public var type: String;
@:optional public var link: String;
@:optional public var vec4: Float32Array;
@:optional public var vec3: Float32Array;
@:optional public var vec2: Float32Array;
@:optional public var float: Null<FastFloat>;
@:optional public var bool: Null<Bool>;
@:optional public var int: Null<Int>;
@:optional public var vec4Value: Float32Array;
@:optional public var vec3Value: Float32Array;
@:optional public var vec2Value: Float32Array;
@:optional public var floatValue: Null<FastFloat>;
@:optional public var boolValue: Null<Bool>;
@:optional public var intValue: Null<Int>;
@:optional public var is_arm_parameter: Null<Bool>;
}

Expand Down
12 changes: 6 additions & 6 deletions Sources/iron/object/Uniforms.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1199,12 +1199,12 @@ class Uniforms {

static function setMaterialConstant(g: Graphics, location: ConstantLocation, c: TShaderConstant, matc: TBindConstant) {
switch (c.type) {
case "vec4": g.setFloat4(location, matc.vec4[0], matc.vec4[1], matc.vec4[2], matc.vec4[3]);
case "vec3": g.setFloat3(location, matc.vec3[0], matc.vec3[1], matc.vec3[2]);
case "vec2": g.setFloat2(location, matc.vec2[0], matc.vec2[1]);
case "float": g.setFloat(location, matc.float);
case "bool": g.setBool(location, matc.bool);
case "int": g.setInt(location, matc.int);
case "vec4": g.setFloat4(location, matc.vec4Value[0], matc.vec4Value[1], matc.vec4Value[2], matc.vec4Value[3]);
case "vec3": g.setFloat3(location, matc.vec3Value[0], matc.vec3Value[1], matc.vec3Value[2]);
case "vec2": g.setFloat2(location, matc.vec2Value[0], matc.vec2Value[1]);
case "float": g.setFloat(location, matc.floatValue);
case "bool": g.setBool(location, matc.boolValue);
case "int": g.setInt(location, matc.intValue);
}
}

Expand Down

0 comments on commit 13155c8

Please sign in to comment.