[glsl-in] Builtin redefinition and calls fixes

This commit is contained in:
João Capucho
2021-08-11 14:44:14 +01:00
committed by Dzmitry Malyshau
parent 79d899fe4c
commit b05ca6e403
14 changed files with 2426 additions and 1341 deletions

View File

@@ -1,4 +1,6 @@
use super::SourceMetadata;
use std::fmt;
use super::{builtins::MacroCall, SourceMetadata};
use crate::{
BinaryOperator, Binding, Constant, Expression, Function, GlobalVariable, Handle, Interpolation,
Sampling, StorageAccess, StorageClass, Type, UnaryOperator,
@@ -26,12 +28,31 @@ pub struct ParameterInfo {
pub depth: bool,
}
/// How the function is implemented
#[derive(Clone, Copy)]
pub enum FunctionKind {
/// The function is user defined
Call(Handle<Function>),
/// The function is a buitin
Macro(MacroCall),
}
impl fmt::Debug for FunctionKind {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
Self::Call(_) => write!(f, "Call"),
Self::Macro(_) => write!(f, "Macro"),
}
}
}
#[derive(Debug)]
pub struct FunctionDeclaration {
/// Normalized function parameters, modifiers are not applied
pub parameters: Vec<Handle<Type>>,
pub parameters_info: Vec<ParameterInfo>,
pub handle: Handle<Function>,
/// How the function is implemented
pub kind: FunctionKind,
/// Wheter this function was already defined or is just a prototype
pub defined: bool,
/// Wheter or not this function returns void (nothing)

1633
src/front/glsl/builtins.rs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -804,7 +804,7 @@ impl Context {
) -> Result<Option<u32>> {
Ok(self
.expr_scalar_components(parser, expr, meta)?
.and_then(|(kind, _)| type_power(kind)))
.and_then(|(kind, width)| type_power(kind, width)))
}
pub fn implicit_conversion(
@@ -815,9 +815,10 @@ impl Context {
kind: ScalarKind,
width: crate::Bytes,
) -> Result<()> {
if let (Some(tgt_power), Some(expr_power)) =
(type_power(kind), self.expr_power(parser, *expr, meta)?)
{
if let (Some(tgt_power), Some(expr_power)) = (
type_power(kind, width),
self.expr_power(parser, *expr, meta)?,
) {
if tgt_power > expr_power {
*expr = self.expressions.append(
Expression::As {
@@ -848,8 +849,9 @@ impl Context {
Some((left_power, left_width, left_kind)),
Some((right_power, right_width, right_kind)),
) = (
left_components.and_then(|(kind, width)| Some((type_power(kind)?, width, kind))),
right_components.and_then(|(kind, width)| Some((type_power(kind)?, width, kind))),
left_components.and_then(|(kind, width)| Some((type_power(kind, width)?, width, kind))),
right_components
.and_then(|(kind, width)| Some((type_power(kind, width)?, width, kind))),
) {
match left_power.cmp(&right_power) {
std::cmp::Ordering::Less => {
@@ -882,7 +884,6 @@ impl Context {
pub fn implicit_splat(
&mut self,
parser: &mut Parser,
expr: &mut Handle<Expression>,
meta: SourceMetadata,
vector_size: Option<VectorSize>,

View File

@@ -124,22 +124,3 @@ pub struct Error {
/// Holds information about the range of the source code where the error happened.
pub meta: SourceMetadata,
}
impl Error {
pub(crate) fn wrong_function_args(
name: String,
expected: usize,
got: usize,
meta: SourceMetadata,
) -> Self {
let msg = format!(
"Function \"{}\" expects {} arguments, got {}",
name, expected, got
);
Error {
kind: ErrorKind::SemanticError(msg.into()),
meta,
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@ use ast::{EntryArg, FunctionDeclaration, GlobalLookup};
use parser::ParsingContext;
mod ast;
mod builtins;
mod constants;
mod context;
mod error;

View File

@@ -1,5 +1,5 @@
use super::{
ast::{Profile, TypeQualifier},
ast::{FunctionKind, Profile, TypeQualifier},
context::Context,
error::ExpectedToken,
error::{Error, ErrorKind},
@@ -140,10 +140,12 @@ impl<'source> ParsingContext<'source> {
}
match parser.lookup_function.get("main").and_then(|declarations| {
declarations
.iter()
.find(|decl| decl.defined && decl.parameters.is_empty())
.map(|decl| decl.handle)
declarations.iter().find_map(|decl| match decl.kind {
FunctionKind::Call(handle) if decl.defined && decl.parameters.is_empty() => {
Some(handle)
}
_ => None,
})
}) {
Some(handle) => parser.add_entry_point(handle, body, ctx.expressions),
None => parser.errors.push(Error {

View File

@@ -297,7 +297,6 @@ impl<'source> ParsingContext<'source> {
stmt: &mut StmtContext,
body: &mut Block,
) -> Result<Handle<HirExpr>> {
// TODO: prefix inc/dec
Ok(match self.expect_peek(parser)?.value {
TokenValue::Plus | TokenValue::Dash | TokenValue::Bang | TokenValue::Tilde => {
let Token { value, meta } = self.bump(parser)?;

View File

@@ -2,8 +2,8 @@ use super::{
constants::ConstantSolver, context::Context, Error, ErrorKind, Parser, Result, SourceMetadata,
};
use crate::{
proc::ResolveContext, ArraySize, Constant, Expression, Handle, ImageClass, ImageDimension,
ScalarKind, Type, TypeInner, VectorSize,
proc::ResolveContext, ArraySize, Bytes, Constant, Expression, Handle, ImageClass,
ImageDimension, ScalarKind, Type, TypeInner, VectorSize,
};
pub fn parse_type(type_name: &str) -> Option<Type> {
@@ -159,7 +159,7 @@ pub fn parse_type(type_name: &str) -> Option<Type> {
}
}
pub fn scalar_components(ty: &TypeInner) -> Option<(ScalarKind, crate::Bytes)> {
pub fn scalar_components(ty: &TypeInner) -> Option<(ScalarKind, Bytes)> {
match *ty {
TypeInner::Scalar { kind, width } => Some((kind, width)),
TypeInner::Vector { kind, width, .. } => Some((kind, width)),
@@ -169,11 +169,12 @@ pub fn scalar_components(ty: &TypeInner) -> Option<(ScalarKind, crate::Bytes)> {
}
}
pub fn type_power(kind: ScalarKind) -> Option<u32> {
pub fn type_power(kind: ScalarKind, width: Bytes) -> Option<u32> {
Some(match kind {
ScalarKind::Sint => 0,
ScalarKind::Uint => 1,
ScalarKind::Float => 2,
ScalarKind::Float if width == 4 => 2,
ScalarKind::Float => 3,
ScalarKind::Bool => return None,
})
}

View File

@@ -19,25 +19,25 @@ fn collatz_iterations(n: u32) -> u32 {
break;
}
{
let _e12: u32 = n1;
if (((_e12 % u32(2)) == u32(0))) {
let _e14: u32 = n1;
if (((f32(_e14) % f32(2)) == f32(0))) {
{
let _e19: u32 = n1;
n1 = (_e19 / u32(2));
let _e22: u32 = n1;
n1 = (_e22 / u32(2));
}
} else {
{
let _e24: u32 = n1;
n1 = ((u32(3) * _e24) + u32(1));
let _e27: u32 = n1;
n1 = ((u32(3) * _e27) + u32(1));
}
}
let _e30: u32 = i;
local = _e30;
i = (_e30 + 1u);
let _e33: u32 = i;
local = _e33;
i = (_e33 + 1u);
}
}
let _e35: u32 = i;
return _e35;
let _e38: u32 = i;
return _e38;
}
fn main1() {

View File

@@ -127,13 +127,15 @@ fn getDistanceAttenuation(distanceSquare: f32, inverseRangeSquared: f32) -> f32
factor = (_e44 * _e45);
let _e49: f32 = factor;
let _e50: f32 = factor;
smoothFactor = clamp((1.0 - (_e49 * _e50)), 0.0, 1.0);
let _e57: f32 = smoothFactor;
let _e58: f32 = smoothFactor;
attenuation = (_e57 * _e58);
let _e61: f32 = attenuation;
let _e64: f32 = distanceSquare1;
return ((_e61 * 1.0) / max(_e64, 0.00009999999747378752));
let _e56: f32 = factor;
let _e57: f32 = factor;
smoothFactor = clamp((1.0 - (_e56 * _e57)), 0.0, 1.0);
let _e64: f32 = smoothFactor;
let _e65: f32 = smoothFactor;
attenuation = (_e64 * _e65);
let _e68: f32 = attenuation;
let _e73: f32 = distanceSquare1;
return ((_e68 * 1.0) / max(_e73, 0.00009999999747378752));
}
fn D_GGX(roughness: f32, NoH: f32, h: vec3<f32>) -> f32 {
@@ -185,19 +187,29 @@ fn V_SmithGGXCorrelated(roughness2: f32, NoV: f32, NoL: f32) -> f32 {
let _e53: f32 = NoV1;
let _e56: f32 = NoV1;
let _e58: f32 = a2_;
lambdaV = (_e50 * sqrt((((_e51 - (_e52 * _e53)) * _e56) + _e58)));
let _e63: f32 = NoV1;
let _e64: f32 = NoL1;
let _e65: f32 = a2_;
let _e66: f32 = NoL1;
let _e69: f32 = NoL1;
let _e71: f32 = a2_;
lambdaL = (_e63 * sqrt((((_e64 - (_e65 * _e66)) * _e69) + _e71)));
let _e77: f32 = lambdaV;
let _e78: f32 = lambdaL;
v = (0.5 / (_e77 + _e78));
let _e82: f32 = v;
return _e82;
let _e60: f32 = NoV1;
let _e61: f32 = a2_;
let _e62: f32 = NoV1;
let _e65: f32 = NoV1;
let _e67: f32 = a2_;
lambdaV = (_e50 * sqrt((((_e60 - (_e61 * _e62)) * _e65) + _e67)));
let _e72: f32 = NoV1;
let _e73: f32 = NoL1;
let _e74: f32 = a2_;
let _e75: f32 = NoL1;
let _e78: f32 = NoL1;
let _e80: f32 = a2_;
let _e82: f32 = NoL1;
let _e83: f32 = a2_;
let _e84: f32 = NoL1;
let _e87: f32 = NoL1;
let _e89: f32 = a2_;
lambdaL = (_e72 * sqrt((((_e82 - (_e83 * _e84)) * _e87) + _e89)));
let _e95: f32 = lambdaV;
let _e96: f32 = lambdaL;
v = (0.5 / (_e95 + _e96));
let _e100: f32 = v;
return _e100;
}
fn F_Schlick(f0_: vec3<f32>, f90_: f32, VoH: f32) -> vec3<f32> {
@@ -237,13 +249,14 @@ fn fresnel(f0_3: vec3<f32>, LoH: f32) -> vec3<f32> {
f0_4 = f0_3;
LoH1 = LoH;
let _e44: vec3<f32> = f0_4;
f90_4 = clamp(dot(_e44, vec3<f32>((50.0 * 0.33000001311302185))), 0.0, 1.0);
let _e57: vec3<f32> = f0_4;
let _e58: f32 = f90_4;
let _e59: f32 = LoH1;
let _e60: vec3<f32> = F_Schlick(_e57, _e58, _e59);
return _e60;
let _e49: vec3<f32> = f0_4;
let _e62: vec3<f32> = f0_4;
f90_4 = clamp(dot(_e62, vec3<f32>((50.0 * 0.33000001311302185))), 0.0, 1.0);
let _e75: vec3<f32> = f0_4;
let _e76: f32 = f90_4;
let _e77: f32 = LoH1;
let _e78: vec3<f32> = F_Schlick(_e75, _e76, _e77);
return _e78;
}
fn specular(f0_5: vec3<f32>, roughness4: f32, h1: vec3<f32>, NoV2: f32, NoL2: f32, NoH2: f32, LoH2: f32, specularIntensity: f32) -> vec3<f32> {
@@ -335,16 +348,21 @@ fn EnvBRDFApprox(f0_7: vec3<f32>, perceptual_roughness: f32, NoV6: f32) -> vec3<
let _e69: vec4<f32> = r;
let _e71: vec4<f32> = r;
let _e76: f32 = NoV7;
let _e80: vec4<f32> = r;
let _e80: f32 = NoV7;
let _e83: vec4<f32> = r;
a004_ = ((min((_e69.x * _e71.x), exp2((-(9.279999732971191) * _e76))) * _e80.x) + _e83.y);
let _e91: f32 = a004_;
let _e94: vec4<f32> = r;
AB = ((vec2<f32>(-(1.0399999618530273), 1.0399999618530273) * vec2<f32>(_e91)) + _e94.zw);
let _e98: vec3<f32> = f0_8;
let _e99: vec2<f32> = AB;
let _e103: vec2<f32> = AB;
return ((_e98 * vec3<f32>(_e99.x)) + vec3<f32>(_e103.y));
let _e85: vec4<f32> = r;
let _e90: f32 = NoV7;
let _e94: f32 = NoV7;
let _e98: vec4<f32> = r;
let _e101: vec4<f32> = r;
a004_ = ((min((_e83.x * _e85.x), exp2((-(9.279999732971191) * _e94))) * _e98.x) + _e101.y);
let _e109: f32 = a004_;
let _e112: vec4<f32> = r;
AB = ((vec2<f32>(-(1.0399999618530273), 1.0399999618530273) * vec2<f32>(_e109)) + _e112.zw);
let _e116: vec3<f32> = f0_8;
let _e117: vec2<f32> = AB;
let _e121: vec2<f32> = AB;
return ((_e116 * vec3<f32>(_e117.x)) + vec3<f32>(_e121.y));
}
fn perceptualRoughnessToRoughness(perceptualRoughness: f32) -> f32 {
@@ -352,11 +370,11 @@ fn perceptualRoughnessToRoughness(perceptualRoughness: f32) -> f32 {
var clampedPerceptualRoughness: f32;
perceptualRoughness1 = perceptualRoughness;
let _e42: f32 = perceptualRoughness1;
clampedPerceptualRoughness = clamp(_e42, 0.08900000154972076, 1.0);
let _e47: f32 = clampedPerceptualRoughness;
let _e48: f32 = clampedPerceptualRoughness;
return (_e47 * _e48);
let _e45: f32 = perceptualRoughness1;
clampedPerceptualRoughness = clamp(_e45, 0.08900000154972076, 1.0);
let _e50: f32 = clampedPerceptualRoughness;
let _e51: f32 = clampedPerceptualRoughness;
return (_e50 * _e51);
}
fn reinhard(color: vec3<f32>) -> vec3<f32> {
@@ -389,8 +407,8 @@ fn luminance(v1: vec3<f32>) -> f32 {
var v2: vec3<f32>;
v2 = v1;
let _e42: vec3<f32> = v2;
return dot(_e42, vec3<f32>(0.2125999927520752, 0.7152000069618225, 0.0722000002861023));
let _e47: vec3<f32> = v2;
return dot(_e47, vec3<f32>(0.2125999927520752, 0.7152000069618225, 0.0722000002861023));
}
fn change_luminance(c_in: vec3<f32>, l_out: f32) -> vec3<f32> {
@@ -491,92 +509,120 @@ fn point_light(light: PointLight, roughness8: f32, NdotV: f32, N: vec3<f32>, V1:
let _e56: PointLight = light1;
let _e59: vec3<f32> = v_WorldPosition1;
light_to_frag = (_e56.pos.xyz - _e59.xyz);
let _e63: vec3<f32> = light_to_frag;
let _e64: vec3<f32> = light_to_frag;
distance_square = dot(_e63, _e64);
let _e68: PointLight = light1;
let _e71: f32 = distance_square;
let _e72: PointLight = light1;
let _e75: f32 = getDistanceAttenuation(_e71, _e72.lightParams.x);
rangeAttenuation = _e75;
let _e77: f32 = roughness9;
a1 = _e77;
let _e79: PointLight = light1;
radius = _e79.lightParams.y;
let _e83: vec3<f32> = light_to_frag;
let _e84: vec3<f32> = R1;
let _e86: vec3<f32> = R1;
let _e88: vec3<f32> = light_to_frag;
centerToRay = ((dot(_e83, _e84) * _e86) - _e88);
let _e91: vec3<f32> = light_to_frag;
let _e92: vec3<f32> = centerToRay;
let _e93: f32 = radius;
let _e94: vec3<f32> = centerToRay;
let _e95: vec3<f32> = centerToRay;
closestPoint = (_e91 + (_e92 * clamp((_e93 * inverseSqrt(dot(_e94, _e95))), 0.0, 1.0)));
let _e105: vec3<f32> = closestPoint;
let _e106: vec3<f32> = closestPoint;
LspecLengthInverse = inverseSqrt(dot(_e105, _e106));
let _e110: f32 = a1;
let _e111: f32 = a1;
let _e65: vec3<f32> = light_to_frag;
let _e66: vec3<f32> = light_to_frag;
distance_square = dot(_e65, _e66);
let _e70: PointLight = light1;
let _e73: f32 = distance_square;
let _e74: PointLight = light1;
let _e77: f32 = getDistanceAttenuation(_e73, _e74.lightParams.x);
rangeAttenuation = _e77;
let _e79: f32 = roughness9;
a1 = _e79;
let _e81: PointLight = light1;
radius = _e81.lightParams.y;
let _e87: vec3<f32> = light_to_frag;
let _e88: vec3<f32> = R1;
let _e90: vec3<f32> = R1;
let _e92: vec3<f32> = light_to_frag;
centerToRay = ((dot(_e87, _e88) * _e90) - _e92);
let _e95: vec3<f32> = light_to_frag;
let _e96: vec3<f32> = centerToRay;
let _e97: f32 = radius;
let _e100: vec3<f32> = centerToRay;
let _e101: vec3<f32> = centerToRay;
let _e105: vec3<f32> = centerToRay;
let _e106: vec3<f32> = centerToRay;
let _e112: f32 = radius;
let _e115: f32 = LspecLengthInverse;
normalizationFactor = (_e110 / clamp((_e111 + ((_e112 * 0.5) * _e115)), 0.0, 1.0));
let _e123: f32 = normalizationFactor;
let _e124: f32 = normalizationFactor;
specularIntensity2 = (_e123 * _e124);
let _e127: vec3<f32> = closestPoint;
let _e128: f32 = LspecLengthInverse;
L = (_e127 * _e128);
let _e131: vec3<f32> = L;
let _e132: vec3<f32> = V2;
H = normalize((_e131 + _e132));
let _e136: vec3<f32> = N1;
let _e137: vec3<f32> = L;
NoL6 = clamp(dot(_e136, _e137), 0.0, 1.0);
let _e143: vec3<f32> = N1;
let _e144: vec3<f32> = H;
NoH4 = clamp(dot(_e143, _e144), 0.0, 1.0);
let _e150: vec3<f32> = L;
let _e151: vec3<f32> = H;
LoH6 = clamp(dot(_e150, _e151), 0.0, 1.0);
let _e165: vec3<f32> = F0_1;
let _e166: f32 = roughness9;
let _e167: vec3<f32> = H;
let _e168: f32 = NdotV1;
let _e169: f32 = NoL6;
let _e170: f32 = NoH4;
let _e171: f32 = LoH6;
let _e172: f32 = specularIntensity2;
let _e173: vec3<f32> = specular(_e165, _e166, _e167, _e168, _e169, _e170, _e171, _e172);
specular1 = _e173;
let _e175: vec3<f32> = light_to_frag;
L = normalize(_e175);
let _e177: vec3<f32> = L;
let _e178: vec3<f32> = V2;
H = normalize((_e177 + _e178));
let _e181: vec3<f32> = N1;
let _e182: vec3<f32> = L;
NoL6 = clamp(dot(_e181, _e182), 0.0, 1.0);
let _e187: vec3<f32> = N1;
let _e188: vec3<f32> = H;
NoH4 = clamp(dot(_e187, _e188), 0.0, 1.0);
let _e193: vec3<f32> = L;
let _e194: vec3<f32> = H;
LoH6 = clamp(dot(_e193, _e194), 0.0, 1.0);
let _e199: vec3<f32> = diffuseColor1;
let _e204: f32 = roughness9;
let _e205: f32 = NdotV1;
let _e206: f32 = NoL6;
let _e207: f32 = LoH6;
let _e208: f32 = Fd_Burley(_e204, _e205, _e206, _e207);
diffuse = (_e199 * _e208);
let _e211: vec3<f32> = diffuse;
let _e212: vec3<f32> = specular1;
let _e214: PointLight = light1;
let _e218: f32 = rangeAttenuation;
let _e219: f32 = NoL6;
return (((_e211 + _e212) * _e214.color.xyz) * (_e218 * _e219));
let _e115: vec3<f32> = centerToRay;
let _e116: vec3<f32> = centerToRay;
let _e120: vec3<f32> = centerToRay;
let _e121: vec3<f32> = centerToRay;
closestPoint = (_e95 + (_e96 * clamp((_e112 * inverseSqrt(dot(_e120, _e121))), 0.0, 1.0)));
let _e133: vec3<f32> = closestPoint;
let _e134: vec3<f32> = closestPoint;
let _e138: vec3<f32> = closestPoint;
let _e139: vec3<f32> = closestPoint;
LspecLengthInverse = inverseSqrt(dot(_e138, _e139));
let _e143: f32 = a1;
let _e144: f32 = a1;
let _e145: f32 = radius;
let _e148: f32 = LspecLengthInverse;
let _e153: f32 = a1;
let _e154: f32 = radius;
let _e157: f32 = LspecLengthInverse;
normalizationFactor = (_e143 / clamp((_e153 + ((_e154 * 0.5) * _e157)), 0.0, 1.0));
let _e165: f32 = normalizationFactor;
let _e166: f32 = normalizationFactor;
specularIntensity2 = (_e165 * _e166);
let _e169: vec3<f32> = closestPoint;
let _e170: f32 = LspecLengthInverse;
L = (_e169 * _e170);
let _e173: vec3<f32> = L;
let _e174: vec3<f32> = V2;
let _e176: vec3<f32> = L;
let _e177: vec3<f32> = V2;
H = normalize((_e176 + _e177));
let _e183: vec3<f32> = N1;
let _e184: vec3<f32> = L;
let _e190: vec3<f32> = N1;
let _e191: vec3<f32> = L;
NoL6 = clamp(dot(_e190, _e191), 0.0, 1.0);
let _e199: vec3<f32> = N1;
let _e200: vec3<f32> = H;
let _e206: vec3<f32> = N1;
let _e207: vec3<f32> = H;
NoH4 = clamp(dot(_e206, _e207), 0.0, 1.0);
let _e215: vec3<f32> = L;
let _e216: vec3<f32> = H;
let _e222: vec3<f32> = L;
let _e223: vec3<f32> = H;
LoH6 = clamp(dot(_e222, _e223), 0.0, 1.0);
let _e237: vec3<f32> = F0_1;
let _e238: f32 = roughness9;
let _e239: vec3<f32> = H;
let _e240: f32 = NdotV1;
let _e241: f32 = NoL6;
let _e242: f32 = NoH4;
let _e243: f32 = LoH6;
let _e244: f32 = specularIntensity2;
let _e245: vec3<f32> = specular(_e237, _e238, _e239, _e240, _e241, _e242, _e243, _e244);
specular1 = _e245;
let _e248: vec3<f32> = light_to_frag;
L = normalize(_e248);
let _e250: vec3<f32> = L;
let _e251: vec3<f32> = V2;
let _e253: vec3<f32> = L;
let _e254: vec3<f32> = V2;
H = normalize((_e253 + _e254));
let _e259: vec3<f32> = N1;
let _e260: vec3<f32> = L;
let _e266: vec3<f32> = N1;
let _e267: vec3<f32> = L;
NoL6 = clamp(dot(_e266, _e267), 0.0, 1.0);
let _e274: vec3<f32> = N1;
let _e275: vec3<f32> = H;
let _e281: vec3<f32> = N1;
let _e282: vec3<f32> = H;
NoH4 = clamp(dot(_e281, _e282), 0.0, 1.0);
let _e289: vec3<f32> = L;
let _e290: vec3<f32> = H;
let _e296: vec3<f32> = L;
let _e297: vec3<f32> = H;
LoH6 = clamp(dot(_e296, _e297), 0.0, 1.0);
let _e302: vec3<f32> = diffuseColor1;
let _e307: f32 = roughness9;
let _e308: f32 = NdotV1;
let _e309: f32 = NoL6;
let _e310: f32 = LoH6;
let _e311: f32 = Fd_Burley(_e307, _e308, _e309, _e310);
diffuse = (_e302 * _e311);
let _e314: vec3<f32> = diffuse;
let _e315: vec3<f32> = specular1;
let _e317: PointLight = light1;
let _e321: f32 = rangeAttenuation;
let _e322: f32 = NoL6;
return (((_e314 + _e315) * _e317.color.xyz) * (_e321 * _e322));
}
fn dir_light(light2: DirectionalLight, roughness10: f32, NdotV2: f32, normal: vec3<f32>, view: vec3<f32>, R2: vec3<f32>, F0_2: vec3<f32>, diffuseColor2: vec3<f32>) -> vec3<f32> {
@@ -609,38 +655,46 @@ fn dir_light(light2: DirectionalLight, roughness10: f32, NdotV2: f32, normal: ve
incident_light = _e56.direction.xyz;
let _e60: vec3<f32> = incident_light;
let _e61: vec3<f32> = view1;
half_vector = normalize((_e60 + _e61));
let _e65: vec3<f32> = normal1;
let _e66: vec3<f32> = incident_light;
NoL7 = clamp(dot(_e65, _e66), 0.0, 1.0);
let _e72: vec3<f32> = normal1;
let _e73: vec3<f32> = half_vector;
NoH5 = clamp(dot(_e72, _e73), 0.0, 1.0);
let _e79: vec3<f32> = incident_light;
let _e80: vec3<f32> = half_vector;
LoH7 = clamp(dot(_e79, _e80), 0.0, 1.0);
let _e86: vec3<f32> = diffuseColor3;
let _e91: f32 = roughness11;
let _e92: f32 = NdotV3;
let _e93: f32 = NoL7;
let _e94: f32 = LoH7;
let _e95: f32 = Fd_Burley(_e91, _e92, _e93, _e94);
diffuse1 = (_e86 * _e95);
let _e108: vec3<f32> = F0_3;
let _e109: f32 = roughness11;
let _e63: vec3<f32> = incident_light;
let _e64: vec3<f32> = view1;
half_vector = normalize((_e63 + _e64));
let _e70: vec3<f32> = normal1;
let _e71: vec3<f32> = incident_light;
let _e77: vec3<f32> = normal1;
let _e78: vec3<f32> = incident_light;
NoL7 = clamp(dot(_e77, _e78), 0.0, 1.0);
let _e86: vec3<f32> = normal1;
let _e87: vec3<f32> = half_vector;
let _e93: vec3<f32> = normal1;
let _e94: vec3<f32> = half_vector;
NoH5 = clamp(dot(_e93, _e94), 0.0, 1.0);
let _e102: vec3<f32> = incident_light;
let _e103: vec3<f32> = half_vector;
let _e109: vec3<f32> = incident_light;
let _e110: vec3<f32> = half_vector;
let _e111: f32 = NdotV3;
let _e112: f32 = NoL7;
let _e113: f32 = NoH5;
let _e114: f32 = LoH7;
let _e115: f32 = specularIntensity3;
let _e116: vec3<f32> = specular(_e108, _e109, _e110, _e111, _e112, _e113, _e114, _e115);
specular2 = _e116;
let _e118: vec3<f32> = specular2;
let _e119: vec3<f32> = diffuse1;
let _e121: DirectionalLight = light3;
let _e125: f32 = NoL7;
return (((_e118 + _e119) * _e121.color.xyz) * _e125);
LoH7 = clamp(dot(_e109, _e110), 0.0, 1.0);
let _e116: vec3<f32> = diffuseColor3;
let _e121: f32 = roughness11;
let _e122: f32 = NdotV3;
let _e123: f32 = NoL7;
let _e124: f32 = LoH7;
let _e125: f32 = Fd_Burley(_e121, _e122, _e123, _e124);
diffuse1 = (_e116 * _e125);
let _e138: vec3<f32> = F0_3;
let _e139: f32 = roughness11;
let _e140: vec3<f32> = half_vector;
let _e141: f32 = NdotV3;
let _e142: f32 = NoL7;
let _e143: f32 = NoH5;
let _e144: f32 = LoH7;
let _e145: f32 = specularIntensity3;
let _e146: vec3<f32> = specular(_e138, _e139, _e140, _e141, _e142, _e143, _e144, _e145);
specular2 = _e146;
let _e148: vec3<f32> = specular2;
let _e149: vec3<f32> = diffuse1;
let _e151: DirectionalLight = light3;
let _e155: f32 = NoL7;
return (((_e148 + _e149) * _e151.color.xyz) * _e155);
}
fn main1() {
@@ -669,175 +723,183 @@ fn main1() {
let _e40: vec4<f32> = global3.base_color;
output_color = _e40;
let _e42: vec4<f32> = output_color;
let _e43: vec2<f32> = v_Uv1;
let _e44: vec4<f32> = textureSample(StandardMaterial_base_color_texture, StandardMaterial_base_color_texture_sampler, _e43);
output_color = (_e42 * _e44);
let _e46: vec2<f32> = v_Uv1;
let _e47: vec4<f32> = textureSample(StandardMaterial_metallic_roughness_texture, StandardMaterial_metallic_roughness_texture_sampler, _e46);
metallic_roughness = _e47;
let _e49: f32 = global5.metallic;
let _e50: vec4<f32> = metallic_roughness;
metallic = (_e49 * _e50.z);
let _e54: f32 = global4.perceptual_roughness;
let _e55: vec4<f32> = metallic_roughness;
perceptual_roughness2 = (_e54 * _e55.y);
let _e60: f32 = perceptual_roughness2;
let _e61: f32 = perceptualRoughnessToRoughness(_e60);
roughness12 = _e61;
let _e63: vec3<f32> = v_WorldNormal1;
N2 = normalize(_e63);
let _e66: vec4<f32> = v_WorldTangent1;
T = normalize(_e66.xyz);
let _e70: vec3<f32> = N2;
let _e71: vec3<f32> = T;
let _e73: vec4<f32> = v_WorldTangent1;
B = (cross(_e70, _e71) * _e73.w);
let _e78: bool = gl_FrontFacing;
let _e79: vec3<f32> = N2;
let _e80: vec3<f32> = N2;
N2 = select(-(_e80), _e79, _e78);
let _e83: bool = gl_FrontFacing;
let _e84: vec3<f32> = T;
let _e85: vec3<f32> = T;
T = select(-(_e85), _e84, _e83);
let _e88: bool = gl_FrontFacing;
let _e89: vec3<f32> = B;
let _e90: vec3<f32> = B;
B = select(-(_e90), _e89, _e88);
let _e93: vec3<f32> = T;
let _e94: vec3<f32> = B;
let _e95: vec3<f32> = N2;
TBN = mat3x3<f32>(vec3<f32>(_e93.x, _e93.y, _e93.z), vec3<f32>(_e94.x, _e94.y, _e94.z), vec3<f32>(_e95.x, _e95.y, _e95.z));
let _e110: mat3x3<f32> = TBN;
let _e111: vec2<f32> = v_Uv1;
let _e112: vec4<f32> = textureSample(StandardMaterial_normal_map, StandardMaterial_normal_map_sampler, _e111);
N2 = (_e110 * normalize(((_e112.xyz * 2.0) - vec3<f32>(1.0))));
let _e121: vec2<f32> = v_Uv1;
let _e122: vec4<f32> = textureSample(StandardMaterial_occlusion_texture, StandardMaterial_occlusion_texture_sampler, _e121);
occlusion = _e122.x;
let _e125: vec4<f32> = global7.emissive;
emissive = _e125;
let _e127: vec4<f32> = emissive;
let _e129: vec4<f32> = emissive;
let _e131: vec2<f32> = v_Uv1;
let _e132: vec4<f32> = textureSample(StandardMaterial_emissive_texture, StandardMaterial_emissive_texture_sampler, _e131);
let _e134: vec3<f32> = (_e129.xyz * _e132.xyz);
emissive.x = _e134.x;
emissive.y = _e134.y;
emissive.z = _e134.z;
let _e141: vec4<f32> = global1.CameraPos;
let _e143: vec3<f32> = v_WorldPosition1;
V3 = normalize((_e141.xyz - _e143.xyz));
let _e148: vec3<f32> = N2;
let _e149: vec3<f32> = V3;
NdotV4 = max(dot(_e148, _e149), 0.00009999999747378752);
let _e155: f32 = global6.reflectance;
let _e157: f32 = global6.reflectance;
let _e160: f32 = metallic;
let _e164: vec4<f32> = output_color;
let _e166: f32 = metallic;
F0_4 = (vec3<f32>((((0.1599999964237213 * _e155) * _e157) * (1.0 - _e160))) + (_e164.xyz * vec3<f32>(_e166)));
let _e171: vec4<f32> = output_color;
let _e174: f32 = metallic;
diffuseColor4 = (_e171.xyz * vec3<f32>((1.0 - _e174)));
let _e179: vec3<f32> = V3;
let _e181: vec3<f32> = N2;
R4 = reflect(-(_e179), _e181);
let _e44: vec2<f32> = v_Uv1;
let _e45: vec4<f32> = textureSample(StandardMaterial_base_color_texture, StandardMaterial_base_color_texture_sampler, _e44);
output_color = (_e42 * _e45);
let _e48: vec2<f32> = v_Uv1;
let _e49: vec4<f32> = textureSample(StandardMaterial_metallic_roughness_texture, StandardMaterial_metallic_roughness_texture_sampler, _e48);
metallic_roughness = _e49;
let _e51: f32 = global5.metallic;
let _e52: vec4<f32> = metallic_roughness;
metallic = (_e51 * _e52.z);
let _e56: f32 = global4.perceptual_roughness;
let _e57: vec4<f32> = metallic_roughness;
perceptual_roughness2 = (_e56 * _e57.y);
let _e62: f32 = perceptual_roughness2;
let _e63: f32 = perceptualRoughnessToRoughness(_e62);
roughness12 = _e63;
let _e66: vec3<f32> = v_WorldNormal1;
N2 = normalize(_e66);
let _e69: vec4<f32> = v_WorldTangent1;
let _e71: vec4<f32> = v_WorldTangent1;
T = normalize(_e71.xyz);
let _e77: vec3<f32> = N2;
let _e78: vec3<f32> = T;
let _e80: vec4<f32> = v_WorldTangent1;
B = (cross(_e77, _e78) * _e80.w);
let _e85: bool = gl_FrontFacing;
let _e86: vec3<f32> = N2;
let _e87: vec3<f32> = N2;
N2 = select(-(_e87), _e86, _e85);
let _e90: bool = gl_FrontFacing;
let _e91: vec3<f32> = T;
let _e92: vec3<f32> = T;
T = select(-(_e92), _e91, _e90);
let _e95: bool = gl_FrontFacing;
let _e96: vec3<f32> = B;
let _e97: vec3<f32> = B;
B = select(-(_e97), _e96, _e95);
let _e100: vec3<f32> = T;
let _e101: vec3<f32> = B;
let _e102: vec3<f32> = N2;
TBN = mat3x3<f32>(vec3<f32>(_e100.x, _e100.y, _e100.z), vec3<f32>(_e101.x, _e101.y, _e101.z), vec3<f32>(_e102.x, _e102.y, _e102.z));
let _e117: mat3x3<f32> = TBN;
let _e119: vec2<f32> = v_Uv1;
let _e120: vec4<f32> = textureSample(StandardMaterial_normal_map, StandardMaterial_normal_map_sampler, _e119);
let _e128: vec2<f32> = v_Uv1;
let _e129: vec4<f32> = textureSample(StandardMaterial_normal_map, StandardMaterial_normal_map_sampler, _e128);
N2 = (_e117 * normalize(((_e129.xyz * 2.0) - vec3<f32>(1.0))));
let _e139: vec2<f32> = v_Uv1;
let _e140: vec4<f32> = textureSample(StandardMaterial_occlusion_texture, StandardMaterial_occlusion_texture_sampler, _e139);
occlusion = _e140.x;
let _e143: vec4<f32> = global7.emissive;
emissive = _e143;
let _e145: vec4<f32> = emissive;
let _e147: vec4<f32> = emissive;
let _e150: vec2<f32> = v_Uv1;
let _e151: vec4<f32> = textureSample(StandardMaterial_emissive_texture, StandardMaterial_emissive_texture_sampler, _e150);
let _e153: vec3<f32> = (_e147.xyz * _e151.xyz);
emissive.x = _e153.x;
emissive.y = _e153.y;
emissive.z = _e153.z;
let _e160: vec4<f32> = global1.CameraPos;
let _e162: vec3<f32> = v_WorldPosition1;
let _e165: vec4<f32> = global1.CameraPos;
let _e167: vec3<f32> = v_WorldPosition1;
V3 = normalize((_e165.xyz - _e167.xyz));
let _e174: vec3<f32> = N2;
let _e175: vec3<f32> = V3;
let _e180: vec3<f32> = N2;
let _e181: vec3<f32> = V3;
NdotV4 = max(dot(_e180, _e181), 0.00009999999747378752);
let _e187: f32 = global6.reflectance;
let _e189: f32 = global6.reflectance;
let _e192: f32 = metallic;
let _e196: vec4<f32> = output_color;
let _e198: f32 = metallic;
F0_4 = (vec3<f32>((((0.1599999964237213 * _e187) * _e189) * (1.0 - _e192))) + (_e196.xyz * vec3<f32>(_e198)));
let _e203: vec4<f32> = output_color;
let _e206: f32 = metallic;
diffuseColor4 = (_e203.xyz * vec3<f32>((1.0 - _e206)));
let _e211: vec3<f32> = V3;
let _e214: vec3<f32> = V3;
let _e216: vec3<f32> = N2;
R4 = reflect(-(_e214), _e216);
loop {
let _e189: i32 = i;
let _e190: vec4<u32> = global2.NumLights;
let _e194: i32 = i;
if (!(((_e189 < i32(_e190.x)) && (_e194 < 10)))) {
let _e224: i32 = i;
let _e225: vec4<u32> = global2.NumLights;
let _e229: i32 = i;
if (!(((_e224 < i32(_e225.x)) && (_e229 < 10)))) {
break;
}
{
let _e201: vec3<f32> = light_accum;
let _e202: i32 = i;
let _e212: i32 = i;
let _e214: PointLight = global2.PointLights[_e212];
let _e215: f32 = roughness12;
let _e216: f32 = NdotV4;
let _e217: vec3<f32> = N2;
let _e218: vec3<f32> = V3;
let _e219: vec3<f32> = R4;
let _e220: vec3<f32> = F0_4;
let _e221: vec3<f32> = diffuseColor4;
let _e222: vec3<f32> = point_light(_e214, _e215, _e216, _e217, _e218, _e219, _e220, _e221);
light_accum = (_e201 + _e222);
let _e236: vec3<f32> = light_accum;
let _e237: i32 = i;
let _e247: i32 = i;
let _e249: PointLight = global2.PointLights[_e247];
let _e250: f32 = roughness12;
let _e251: f32 = NdotV4;
let _e252: vec3<f32> = N2;
let _e253: vec3<f32> = V3;
let _e254: vec3<f32> = R4;
let _e255: vec3<f32> = F0_4;
let _e256: vec3<f32> = diffuseColor4;
let _e257: vec3<f32> = point_light(_e249, _e250, _e251, _e252, _e253, _e254, _e255, _e256);
light_accum = (_e236 + _e257);
}
continuing {
let _e198: i32 = i;
i = (_e198 + 1);
let _e233: i32 = i;
i = (_e233 + 1);
}
}
loop {
let _e226: i32 = i1;
let _e227: vec4<u32> = global2.NumLights;
let _e231: i32 = i1;
if (!(((_e226 < i32(_e227.y)) && (_e231 < 1)))) {
let _e261: i32 = i1;
let _e262: vec4<u32> = global2.NumLights;
let _e266: i32 = i1;
if (!(((_e261 < i32(_e262.y)) && (_e266 < 1)))) {
break;
}
{
let _e238: vec3<f32> = light_accum;
let _e239: i32 = i1;
let _e249: i32 = i1;
let _e251: DirectionalLight = global2.DirectionalLights[_e249];
let _e252: f32 = roughness12;
let _e253: f32 = NdotV4;
let _e254: vec3<f32> = N2;
let _e255: vec3<f32> = V3;
let _e256: vec3<f32> = R4;
let _e257: vec3<f32> = F0_4;
let _e258: vec3<f32> = diffuseColor4;
let _e259: vec3<f32> = dir_light(_e251, _e252, _e253, _e254, _e255, _e256, _e257, _e258);
light_accum = (_e238 + _e259);
let _e273: vec3<f32> = light_accum;
let _e274: i32 = i1;
let _e284: i32 = i1;
let _e286: DirectionalLight = global2.DirectionalLights[_e284];
let _e287: f32 = roughness12;
let _e288: f32 = NdotV4;
let _e289: vec3<f32> = N2;
let _e290: vec3<f32> = V3;
let _e291: vec3<f32> = R4;
let _e292: vec3<f32> = F0_4;
let _e293: vec3<f32> = diffuseColor4;
let _e294: vec3<f32> = dir_light(_e286, _e287, _e288, _e289, _e290, _e291, _e292, _e293);
light_accum = (_e273 + _e294);
}
continuing {
let _e235: i32 = i1;
i1 = (_e235 + 1);
let _e270: i32 = i1;
i1 = (_e270 + 1);
}
}
let _e264: vec3<f32> = diffuseColor4;
let _e266: f32 = NdotV4;
let _e267: vec3<f32> = EnvBRDFApprox(_e264, 1.0, _e266);
diffuse_ambient = _e267;
let _e272: vec3<f32> = F0_4;
let _e273: f32 = perceptual_roughness2;
let _e274: f32 = NdotV4;
let _e275: vec3<f32> = EnvBRDFApprox(_e272, _e273, _e274);
specular_ambient = _e275;
let _e277: vec4<f32> = output_color;
let _e279: vec3<f32> = light_accum;
output_color.x = _e279.x;
output_color.y = _e279.y;
output_color.z = _e279.z;
let _e286: vec4<f32> = output_color;
let _e288: vec4<f32> = output_color;
let _e290: vec3<f32> = diffuse_ambient;
let _e291: vec3<f32> = specular_ambient;
let _e293: vec4<f32> = global2.AmbientColor;
let _e296: f32 = occlusion;
let _e298: vec3<f32> = (_e288.xyz + (((_e290 + _e291) * _e293.xyz) * _e296));
output_color.x = _e298.x;
output_color.y = _e298.y;
output_color.z = _e298.z;
let _e305: vec4<f32> = output_color;
let _e307: vec4<f32> = output_color;
let _e309: vec4<f32> = emissive;
let _e311: vec4<f32> = output_color;
let _e314: vec3<f32> = (_e307.xyz + (_e309.xyz * _e311.w));
let _e299: vec3<f32> = diffuseColor4;
let _e301: f32 = NdotV4;
let _e302: vec3<f32> = EnvBRDFApprox(_e299, 1.0, _e301);
diffuse_ambient = _e302;
let _e307: vec3<f32> = F0_4;
let _e308: f32 = perceptual_roughness2;
let _e309: f32 = NdotV4;
let _e310: vec3<f32> = EnvBRDFApprox(_e307, _e308, _e309);
specular_ambient = _e310;
let _e312: vec4<f32> = output_color;
let _e314: vec3<f32> = light_accum;
output_color.x = _e314.x;
output_color.y = _e314.y;
output_color.z = _e314.z;
let _e321: vec4<f32> = output_color;
let _e323: vec4<f32> = output_color;
let _e325: vec4<f32> = output_color;
let _e327: vec3<f32> = reinhard_luminance(_e325.xyz);
output_color.x = _e327.x;
output_color.y = _e327.y;
output_color.z = _e327.z;
let _e334: vec4<f32> = output_color;
o_Target = _e334;
let _e325: vec3<f32> = diffuse_ambient;
let _e326: vec3<f32> = specular_ambient;
let _e328: vec4<f32> = global2.AmbientColor;
let _e331: f32 = occlusion;
let _e333: vec3<f32> = (_e323.xyz + (((_e325 + _e326) * _e328.xyz) * _e331));
output_color.x = _e333.x;
output_color.y = _e333.y;
output_color.z = _e333.z;
let _e340: vec4<f32> = output_color;
let _e342: vec4<f32> = output_color;
let _e344: vec4<f32> = emissive;
let _e346: vec4<f32> = output_color;
let _e349: vec3<f32> = (_e342.xyz + (_e344.xyz * _e346.w));
output_color.x = _e349.x;
output_color.y = _e349.y;
output_color.z = _e349.z;
let _e356: vec4<f32> = output_color;
let _e358: vec4<f32> = output_color;
let _e360: vec4<f32> = output_color;
let _e362: vec3<f32> = reinhard_luminance(_e360.xyz);
output_color.x = _e362.x;
output_color.y = _e362.y;
output_color.z = _e362.z;
let _e369: vec4<f32> = output_color;
o_Target = _e369;
return;
}

View File

@@ -21,9 +21,9 @@ fn TevPerCompGT1(a2: vec3<f32>, b2: vec3<f32>) -> vec3<f32> {
a3 = a2;
b3 = b2;
let _e5: vec3<f32> = a3;
let _e6: vec3<f32> = b3;
return select(vec3<f32>(0.0), vec3<f32>(1.0), (_e5 > _e6));
let _e7: vec3<f32> = a3;
let _e8: vec3<f32> = b3;
return select(vec3<f32>(0.0), vec3<f32>(1.0), (_e7 > _e8));
}
fn main1() {

View File

@@ -6,8 +6,8 @@ var<private> a_pos1: vec2<f32>;
var<private> gl_Position: vec4<f32>;
fn main1() {
let _e2: vec2<f32> = a_pos1;
gl_Position = vec4<f32>(clamp(_e2, vec2<f32>(0.0), vec2<f32>(1.0)), 0.0, 1.0);
let _e5: vec2<f32> = a_pos1;
gl_Position = vec4<f32>(clamp(_e5, vec2<f32>(0.0), vec2<f32>(1.0)), 0.0, 1.0);
return;
}

View File

@@ -48,95 +48,102 @@ fn main1() {
let _e8: vec4<f32> = a;
let _e9: vec4<f32> = b;
m = mat4x4<f32>(vec4<f32>(_e6.x, _e6.y, _e6.z, _e6.w), vec4<f32>(_e7.x, _e7.y, _e7.z, _e7.w), vec4<f32>(_e8.x, _e8.y, _e8.z, _e8.w), vec4<f32>(_e9.x, _e9.y, _e9.z, _e9.w));
let _e34: vec4<f32> = a;
ceilOut = ceil(_e34);
let _e37: vec4<f32> = a;
roundOut = round(_e37);
let _e40: vec4<f32> = a;
floorOut = floor(_e40);
let _e35: vec4<f32> = a;
ceilOut = ceil(_e35);
let _e39: vec4<f32> = a;
roundOut = round(_e39);
let _e43: vec4<f32> = a;
fractOut = fract(_e43);
let _e46: vec4<f32> = a;
truncOut = trunc(_e46);
let _e49: vec4<f32> = a;
sinOut = sin(_e49);
let _e52: vec4<f32> = a;
absOut = abs(_e52);
floorOut = floor(_e43);
let _e47: vec4<f32> = a;
fractOut = fract(_e47);
let _e51: vec4<f32> = a;
truncOut = trunc(_e51);
let _e55: vec4<f32> = a;
sqrtOut = sqrt(_e55);
let _e58: vec4<f32> = a;
inversesqrtOut = inverseSqrt(_e58);
let _e61: vec4<f32> = a;
expOut = exp(_e61);
let _e64: vec4<f32> = a;
exp2Out = exp2(_e64);
sinOut = sin(_e55);
let _e59: vec4<f32> = a;
absOut = abs(_e59);
let _e63: vec4<f32> = a;
sqrtOut = sqrt(_e63);
let _e67: vec4<f32> = a;
signOut = sign(_e67);
let _e70: mat4x4<f32> = m;
transposeOut = transpose(_e70);
let _e73: vec4<f32> = a;
normalizeOut = normalize(_e73);
let _e76: vec4<f32> = a;
sinhOut = sinh(_e76);
inversesqrtOut = inverseSqrt(_e67);
let _e71: vec4<f32> = a;
expOut = exp(_e71);
let _e75: vec4<f32> = a;
exp2Out = exp2(_e75);
let _e79: vec4<f32> = a;
cosOut = cos(_e79);
let _e82: vec4<f32> = a;
coshOut = cosh(_e82);
let _e85: vec4<f32> = a;
tanOut = tan(_e85);
let _e88: vec4<f32> = a;
tanhOut = tanh(_e88);
signOut = sign(_e79);
let _e83: mat4x4<f32> = m;
transposeOut = transpose(_e83);
let _e87: vec4<f32> = a;
normalizeOut = normalize(_e87);
let _e91: vec4<f32> = a;
acosOut = acos(_e91);
let _e94: vec4<f32> = a;
asinOut = asin(_e94);
let _e97: vec4<f32> = a;
logOut = log(_e97);
let _e100: vec4<f32> = a;
log2Out = log2(_e100);
sinhOut = sinh(_e91);
let _e95: vec4<f32> = a;
cosOut = cos(_e95);
let _e99: vec4<f32> = a;
coshOut = cosh(_e99);
let _e103: vec4<f32> = a;
lengthOut = length(_e103);
let _e106: mat4x4<f32> = m;
determinantOut = determinant(_e106);
let _e109: i32 = i;
bitCountOut = countOneBits(_e109);
let _e112: i32 = i;
bitfieldReverseOut = reverseBits(_e112);
tanOut = tan(_e103);
let _e107: vec4<f32> = a;
tanhOut = tanh(_e107);
let _e111: vec4<f32> = a;
acosOut = acos(_e111);
let _e115: vec4<f32> = a;
atanOut = atan(_e115.x);
asinOut = asin(_e115);
let _e119: vec4<f32> = a;
let _e121: vec4<f32> = a;
atan2Out = atan2(_e119.x, _e121.y);
let _e125: vec4<f32> = a;
let _e127: vec4<f32> = b;
modOut = (_e125.x % _e127.x);
let _e131: vec4<f32> = a;
let _e132: vec4<f32> = b;
powOut = pow(_e131, _e132);
let _e135: vec4<f32> = a;
let _e136: vec4<f32> = b;
dotOut = dot(_e135, _e136);
let _e139: vec4<f32> = a;
let _e140: vec4<f32> = b;
maxOut = max(_e139, _e140);
let _e143: vec4<f32> = a;
let _e144: vec4<f32> = b;
minOut = min(_e143, _e144);
let _e147: vec4<f32> = a;
let _e148: vec4<f32> = b;
reflectOut = reflect(_e147, _e148);
let _e151: vec4<f32> = a;
let _e153: vec4<f32> = b;
crossOut = cross(_e151.xyz, _e153.xyz);
let _e157: vec4<f32> = a;
let _e158: vec4<f32> = b;
outerProductOut = outerProduct(_e157, _e158);
let _e161: vec4<f32> = a;
let _e162: vec4<f32> = b;
distanceOut = distance(_e161, _e162);
let _e165: vec4<f32> = a;
let _e166: vec4<f32> = b;
stepOut = step(_e165, _e166);
logOut = log(_e119);
let _e123: vec4<f32> = a;
log2Out = log2(_e123);
let _e127: vec4<f32> = a;
lengthOut = length(_e127);
let _e131: mat4x4<f32> = m;
determinantOut = determinant(_e131);
let _e135: i32 = i;
bitCountOut = countOneBits(_e135);
let _e139: i32 = i;
bitfieldReverseOut = reverseBits(_e139);
let _e142: vec4<f32> = a;
let _e144: vec4<f32> = a;
atanOut = atan(_e144.x);
let _e148: vec4<f32> = a;
let _e150: vec4<f32> = a;
let _e152: vec4<f32> = a;
let _e154: vec4<f32> = a;
atan2Out = atan2(_e152.x, _e154.y);
let _e158: vec4<f32> = a;
let _e160: vec4<f32> = b;
let _e162: vec4<f32> = a;
let _e164: vec4<f32> = b;
modOut = (_e162.x % _e164.x);
let _e170: vec4<f32> = a;
let _e171: vec4<f32> = b;
powOut = pow(_e170, _e171);
let _e176: vec4<f32> = a;
let _e177: vec4<f32> = b;
dotOut = dot(_e176, _e177);
let _e182: vec4<f32> = a;
let _e183: vec4<f32> = b;
maxOut = max(_e182, _e183);
let _e188: vec4<f32> = a;
let _e189: vec4<f32> = b;
minOut = min(_e188, _e189);
let _e194: vec4<f32> = a;
let _e195: vec4<f32> = b;
reflectOut = reflect(_e194, _e195);
let _e198: vec4<f32> = a;
let _e200: vec4<f32> = b;
let _e202: vec4<f32> = a;
let _e204: vec4<f32> = b;
crossOut = cross(_e202.xyz, _e204.xyz);
let _e210: vec4<f32> = a;
let _e211: vec4<f32> = b;
outerProductOut = outerProduct(_e210, _e211);
let _e216: vec4<f32> = a;
let _e217: vec4<f32> = b;
distanceOut = distance(_e216, _e217);
let _e222: vec4<f32> = a;
let _e223: vec4<f32> = b;
stepOut = step(_e222, _e223);
return;
}