mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-25 17:01:15 +01:00
[wgsl-in] Update reserved keywords (#1847)
This commit is contained in:
1 parent
7ce98dcc7d
commit
dc075e66e3
58 files changed
+637
-345
No files matched your search
+347
-55
@@ -1,18 +1,18 @@
|
||||
/*!
|
||||
Reserved keywords for [WGSL][wgsl] (WebGPU Shading Language).
|
||||
Keywords for [WGSL][wgsl] (WebGPU Shading Language).
|
||||
|
||||
[wgsl]: https://gpuweb.github.io/gpuweb/wgsl.html
|
||||
*/
|
||||
|
||||
// https://gpuweb.github.io/gpuweb/wgsl/#keyword-summary
|
||||
/// Reserved keywords.
|
||||
pub const RESERVED: &[&str] = &[
|
||||
// type-defining keywords
|
||||
// type-defining
|
||||
"array",
|
||||
"atomic",
|
||||
"bool",
|
||||
"float32",
|
||||
"int32",
|
||||
"f32",
|
||||
"f16",
|
||||
"i32",
|
||||
"mat2x2",
|
||||
"mat2x3",
|
||||
"mat2x4",
|
||||
@@ -22,7 +22,8 @@ pub const RESERVED: &[&str] = &[
|
||||
"mat4x2",
|
||||
"mat4x3",
|
||||
"mat4x4",
|
||||
"pointer",
|
||||
"override",
|
||||
"ptr",
|
||||
"sampler",
|
||||
"sampler_comparison",
|
||||
"struct",
|
||||
@@ -42,21 +43,20 @@ pub const RESERVED: &[&str] = &[
|
||||
"texture_depth_cube",
|
||||
"texture_depth_cube_array",
|
||||
"texture_depth_multisampled_2d",
|
||||
"uint32",
|
||||
"u32",
|
||||
"vec2",
|
||||
"vec3",
|
||||
"vec4",
|
||||
// other keywords
|
||||
// other
|
||||
"bitcast",
|
||||
"block",
|
||||
"break",
|
||||
"case",
|
||||
"const",
|
||||
"continue",
|
||||
"continuing",
|
||||
"default",
|
||||
"discard",
|
||||
"else",
|
||||
"else_if",
|
||||
"enable",
|
||||
"fallthrough",
|
||||
"false",
|
||||
@@ -67,8 +67,6 @@ pub const RESERVED: &[&str] = &[
|
||||
"let",
|
||||
"loop",
|
||||
"private",
|
||||
"read",
|
||||
"read_write",
|
||||
"return",
|
||||
"storage",
|
||||
"switch",
|
||||
@@ -76,66 +74,360 @@ pub const RESERVED: &[&str] = &[
|
||||
"type",
|
||||
"uniform",
|
||||
"var",
|
||||
"while",
|
||||
"workgroup",
|
||||
"write",
|
||||
// image format keywords
|
||||
"r8unorm",
|
||||
"r8snorm",
|
||||
"r8uint",
|
||||
"r8sint",
|
||||
"r16uint",
|
||||
"r16sint",
|
||||
"r16float",
|
||||
"rg8unorm",
|
||||
"rg8snorm",
|
||||
"rg8uint",
|
||||
"rg8sint",
|
||||
"r32uint",
|
||||
"r32sint",
|
||||
"r32float",
|
||||
"rg16uint",
|
||||
"rg16sint",
|
||||
"rg16float",
|
||||
"rgba8unorm",
|
||||
"rgba8unorm_srgb",
|
||||
"rgba8snorm",
|
||||
"rgba8uint",
|
||||
"rgba8sint",
|
||||
"bgra8unorm",
|
||||
"bgra8unorm_srgb",
|
||||
"rgb10a2unorm",
|
||||
"rg11b10float",
|
||||
"rg32uint",
|
||||
"rg32sint",
|
||||
"rg32float",
|
||||
"rgba16uint",
|
||||
"rgba16sint",
|
||||
"rgba16float",
|
||||
"rgba32uint",
|
||||
"rgba32sint",
|
||||
"rgba32float",
|
||||
// reserved keywords
|
||||
// reserved
|
||||
"AppendStructuredBuffer",
|
||||
"BlendState",
|
||||
"Buffer",
|
||||
"ByteAddressBuffer",
|
||||
"CompileShader",
|
||||
"ComputeShader",
|
||||
"ConsumeStructuredBuffer",
|
||||
"DepthStencilState",
|
||||
"DepthStencilView",
|
||||
"DomainShader",
|
||||
"GeometryShader",
|
||||
"Hullshader",
|
||||
"InputPatch",
|
||||
"LineStream",
|
||||
"NULL",
|
||||
"OutputPatch",
|
||||
"PixelShader",
|
||||
"PointStream",
|
||||
"RWBuffer",
|
||||
"RWByteAddressBuffer",
|
||||
"RWStructuredBuffer",
|
||||
"RWTexture1D",
|
||||
"RWTexture1DArray",
|
||||
"RWTexture2D",
|
||||
"RWTexture2DArray",
|
||||
"RWTexture3D",
|
||||
"RasterizerState",
|
||||
"RenderTargetView",
|
||||
"SamplerComparisonState",
|
||||
"SamplerState",
|
||||
"Self",
|
||||
"StructuredBuffer",
|
||||
"Texture1D",
|
||||
"Texture1DArray",
|
||||
"Texture2D",
|
||||
"Texture2DArray",
|
||||
"Texture2DMS",
|
||||
"Texture2DMSArray",
|
||||
"Texture3D",
|
||||
"TextureCube",
|
||||
"TextureCubeArray",
|
||||
"TriangleStream",
|
||||
"VertexShader",
|
||||
"abstract",
|
||||
"active",
|
||||
"alignas",
|
||||
"alignof",
|
||||
"as",
|
||||
"asm",
|
||||
"asm_fragment",
|
||||
"async",
|
||||
"atomic_uint",
|
||||
"attribute",
|
||||
"auto",
|
||||
"await",
|
||||
"become",
|
||||
"bf16",
|
||||
"const",
|
||||
"buffer",
|
||||
"cast",
|
||||
"catch",
|
||||
"cbuffer",
|
||||
"centroid",
|
||||
"char",
|
||||
"class",
|
||||
"co_await",
|
||||
"co_return",
|
||||
"co_yield",
|
||||
"coherent",
|
||||
"column_major",
|
||||
"common",
|
||||
"compile",
|
||||
"compile_fragment",
|
||||
"concept",
|
||||
"const_cast",
|
||||
"consteval",
|
||||
"constexpr",
|
||||
"constinit",
|
||||
"crate",
|
||||
"debugger",
|
||||
"decltype",
|
||||
"delete",
|
||||
"demote",
|
||||
"demote_to_helper",
|
||||
"do",
|
||||
"dword",
|
||||
"dynamic_cast",
|
||||
"enum",
|
||||
"f16",
|
||||
"explicit",
|
||||
"export",
|
||||
"extends",
|
||||
"extern",
|
||||
"external",
|
||||
"f64",
|
||||
"filter",
|
||||
"final",
|
||||
"finally",
|
||||
"fixed",
|
||||
"flat",
|
||||
"friend",
|
||||
"from",
|
||||
"fvec2",
|
||||
"fvec3",
|
||||
"fvec4",
|
||||
"fxgroup",
|
||||
"get",
|
||||
"goto",
|
||||
"groupshared",
|
||||
"handle",
|
||||
"i8",
|
||||
"highp",
|
||||
"hvec2",
|
||||
"hvec3",
|
||||
"hvec4",
|
||||
"i16",
|
||||
"i64",
|
||||
"i8",
|
||||
"iimage1D",
|
||||
"iimage1DArray",
|
||||
"iimage2D",
|
||||
"iimage2DArray",
|
||||
"iimage2DMS",
|
||||
"iimage2DMSArray",
|
||||
"iimage2DRect",
|
||||
"iimage3D",
|
||||
"iimageBuffer",
|
||||
"iimageCube",
|
||||
"iimageCubeArray",
|
||||
"image1D",
|
||||
"image1DArray",
|
||||
"image2D",
|
||||
"image2DArray",
|
||||
"image2DMS",
|
||||
"image2DMSArray",
|
||||
"image2DRect",
|
||||
"image3D",
|
||||
"imageBuffer",
|
||||
"imageCube",
|
||||
"imageCubeArray",
|
||||
"impl",
|
||||
"implements",
|
||||
"import",
|
||||
"in",
|
||||
"inline",
|
||||
"inout",
|
||||
"input",
|
||||
"instanceof",
|
||||
"interface",
|
||||
"invariant",
|
||||
"isampler1D",
|
||||
"isampler1DArray",
|
||||
"isampler2D",
|
||||
"isampler2DArray",
|
||||
"isampler2DMS",
|
||||
"isampler2DMSArray",
|
||||
"isampler2DRect",
|
||||
"isampler3D",
|
||||
"isamplerBuffer",
|
||||
"isamplerCube",
|
||||
"isamplerCubeArray",
|
||||
"isubpassInput",
|
||||
"isubpassInputMS",
|
||||
"itexture1D",
|
||||
"itexture1DArray",
|
||||
"itexture2D",
|
||||
"itexture2DArray",
|
||||
"itexture2DMS",
|
||||
"itexture2DMSArray",
|
||||
"itexture2DRect",
|
||||
"itexture3D",
|
||||
"itextureBuffer",
|
||||
"itextureCube",
|
||||
"itextureCubeArray",
|
||||
"layout",
|
||||
"line",
|
||||
"lineadj",
|
||||
"linear",
|
||||
"lowp",
|
||||
"macro",
|
||||
"macro_rules",
|
||||
"mat",
|
||||
"match",
|
||||
"matrix",
|
||||
"mediump",
|
||||
"meta",
|
||||
"mod",
|
||||
"module",
|
||||
"move",
|
||||
"mut",
|
||||
"mutable",
|
||||
"namespace",
|
||||
"new",
|
||||
"nil",
|
||||
"noexcept",
|
||||
"noinline",
|
||||
"nointerpolation",
|
||||
"noperspective",
|
||||
"null",
|
||||
"nullptr",
|
||||
"of",
|
||||
"operator",
|
||||
"out",
|
||||
"output",
|
||||
"package",
|
||||
"packoffset",
|
||||
"partition",
|
||||
"pass",
|
||||
"patch",
|
||||
"pixelfragment",
|
||||
"point",
|
||||
"precise",
|
||||
"precision",
|
||||
"premerge",
|
||||
"priv",
|
||||
"protected",
|
||||
"pub",
|
||||
"public",
|
||||
"readonly",
|
||||
"ref",
|
||||
"regardless",
|
||||
"register",
|
||||
"reinterpret_cast",
|
||||
"requires",
|
||||
"resource",
|
||||
"restrict",
|
||||
"row_major",
|
||||
"samper",
|
||||
"sample",
|
||||
"sampler1D",
|
||||
"sampler1DArray",
|
||||
"sampler1DArrayShadow",
|
||||
"sampler1DShadow",
|
||||
"sampler2D",
|
||||
"sampler2DArray",
|
||||
"sampler2DArrayShadow",
|
||||
"sampler2DMS",
|
||||
"sampler2DMSArray",
|
||||
"sampler2DRect",
|
||||
"sampler2DRectShadow",
|
||||
"sampler2DShadow",
|
||||
"sampler3D",
|
||||
"sampler3DRect",
|
||||
"samplerBuffer",
|
||||
"samplerCube",
|
||||
"samplerCubeArray",
|
||||
"samplerCubeArrayShadow",
|
||||
"samplerCubeShadow",
|
||||
"samplerShadow",
|
||||
"self",
|
||||
"set",
|
||||
"shared",
|
||||
"signed",
|
||||
"sizeof",
|
||||
"smooth",
|
||||
"snorm",
|
||||
"stateblock",
|
||||
"stateblock_state",
|
||||
"static",
|
||||
"static_assert",
|
||||
"static_cast",
|
||||
"std",
|
||||
"string",
|
||||
"subpassInput",
|
||||
"subpassInputMS",
|
||||
"subroutine",
|
||||
"super",
|
||||
"superp",
|
||||
"target",
|
||||
"tbuffer",
|
||||
"technique",
|
||||
"technique10",
|
||||
"technique11",
|
||||
"template",
|
||||
"texture",
|
||||
"texture1D",
|
||||
"texture1DArray",
|
||||
"texture2D",
|
||||
"texture2DArray",
|
||||
"texture2DMS",
|
||||
"texture2DMSArray",
|
||||
"texture2DRect",
|
||||
"texture3D",
|
||||
"textureBuffer",
|
||||
"textureCube",
|
||||
"textureCubeArray",
|
||||
"this",
|
||||
"thread_local",
|
||||
"throw",
|
||||
"trait",
|
||||
"triangle",
|
||||
"triangleadj",
|
||||
"try",
|
||||
"typedef",
|
||||
"u8",
|
||||
"typeid",
|
||||
"typename",
|
||||
"typeof",
|
||||
"u16",
|
||||
"u64",
|
||||
"u8",
|
||||
"uimage1D",
|
||||
"uimage1DArray",
|
||||
"uimage2D",
|
||||
"uimage2DArray",
|
||||
"uimage2DMS",
|
||||
"uimage2DMSArray",
|
||||
"uimage2DRect",
|
||||
"uimage3D",
|
||||
"uimageBuffer",
|
||||
"uimageCube",
|
||||
"uimageCubeArray",
|
||||
"union",
|
||||
"unless",
|
||||
"unorm",
|
||||
"unsafe",
|
||||
"unsigned",
|
||||
"unsized",
|
||||
"usampler1D",
|
||||
"usampler1DArray",
|
||||
"usampler2D",
|
||||
"usampler2DArray",
|
||||
"usampler2DMS",
|
||||
"usampler2DMSArray",
|
||||
"usampler2DRect",
|
||||
"usampler3D",
|
||||
"usamplerBuffer",
|
||||
"usamplerCube",
|
||||
"usamplerCubeArray",
|
||||
"use",
|
||||
"using",
|
||||
"usubpassInput",
|
||||
"usubpassInputMS",
|
||||
"utexture1D",
|
||||
"utexture1DArray",
|
||||
"utexture2D",
|
||||
"utexture2DArray",
|
||||
"utexture2DMS",
|
||||
"utexture2DMSArray",
|
||||
"utexture2DRect",
|
||||
"utexture3D",
|
||||
"utextureBuffer",
|
||||
"utextureCube",
|
||||
"utextureCubeArray",
|
||||
"varying",
|
||||
"vec",
|
||||
"vector",
|
||||
"vertexfragment",
|
||||
"virtual",
|
||||
"void",
|
||||
"while",
|
||||
"volatile",
|
||||
"wchar_t",
|
||||
"wgsl",
|
||||
"where",
|
||||
"with",
|
||||
"writeonly",
|
||||
"yield",
|
||||
];
|
||||
@@ -5,7 +5,7 @@ struct AlignedWrapper {
|
||||
}
|
||||
|
||||
struct Bar {
|
||||
matrix: mat4x3<f32>,
|
||||
_matrix: mat4x3<f32>,
|
||||
matrix_array: array<mat2x2<f32>, 2>,
|
||||
atom: atomic<i32>,
|
||||
arr: array<vec2<u32>, 2>,
|
||||
@@ -68,10 +68,10 @@ fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4<f32> {
|
||||
test_matrix_within_struct_accesses();
|
||||
|
||||
// test storage loads
|
||||
let matrix = bar.matrix;
|
||||
let _matrix = bar._matrix;
|
||||
let arr = bar.arr;
|
||||
let index = 3u;
|
||||
let b = bar.matrix[index].x;
|
||||
let b = bar._matrix[index].x;
|
||||
let a = bar.data[arrayLength(&bar.data) - 2u].value;
|
||||
|
||||
// test pointer types
|
||||
@@ -85,14 +85,14 @@ fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4<f32> {
|
||||
|
||||
var _ = test_arr_as_arg(array<array<f32, 10>, 5>());
|
||||
|
||||
return vec4<f32>(matrix * vec4<f32>(vec4<i32>(value)), 2.0);
|
||||
return vec4<f32>(_matrix * vec4<f32>(vec4<i32>(value)), 2.0);
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn foo_frag() -> @location(0) vec4<f32> {
|
||||
// test storage stores
|
||||
bar.matrix[1].z = 1.0;
|
||||
bar.matrix = mat4x3<f32>(vec3<f32>(0.0), vec3<f32>(1.0), vec3<f32>(2.0), vec3<f32>(3.0));
|
||||
bar._matrix[1].z = 1.0;
|
||||
bar._matrix = mat4x3<f32>(vec3<f32>(0.0), vec3<f32>(1.0), vec3<f32>(2.0), vec3<f32>(3.0));
|
||||
bar.arr = array<vec2<u32>, 2>(vec2<u32>(0u), vec2<u32>(1u));
|
||||
bar.data[1].value = 1;
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ fn test_textureLoad_3d(coords: vec3<i32>, level: i32) -> vec4<f32> {
|
||||
@group(0) @binding(0)
|
||||
var image_multisampled_2d: texture_multisampled_2d<f32>;
|
||||
|
||||
fn test_textureLoad_multisampled_2d(coords: vec2<i32>, sample: i32) -> vec4<f32> {
|
||||
return textureLoad(image_multisampled_2d, coords, sample);
|
||||
fn test_textureLoad_multisampled_2d(coords: vec2<i32>, _sample: i32) -> vec4<f32> {
|
||||
return textureLoad(image_multisampled_2d, coords, _sample);
|
||||
}
|
||||
|
||||
@group(0) @binding(0)
|
||||
@@ -50,8 +50,8 @@ fn test_textureLoad_depth_2d_array(coords: vec2<i32>, index: i32, level: i32) ->
|
||||
@group(0) @binding(0)
|
||||
var image_depth_multisampled_2d: texture_depth_multisampled_2d;
|
||||
|
||||
fn test_textureLoad_depth_multisampled_2d(coords: vec2<i32>, sample: i32) -> f32 {
|
||||
return textureLoad(image_depth_multisampled_2d, coords, sample);
|
||||
fn test_textureLoad_depth_multisampled_2d(coords: vec2<i32>, _sample: i32) -> f32 {
|
||||
return textureLoad(image_depth_multisampled_2d, coords, _sample);
|
||||
}
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
@@ -29,8 +29,8 @@ fn test_textureLoad_3d(coords: vec3<i32>, level: i32) -> vec4<f32> {
|
||||
@group(0) @binding(0)
|
||||
var image_multisampled_2d: texture_multisampled_2d<f32>;
|
||||
|
||||
fn test_textureLoad_multisampled_2d(coords: vec2<i32>, sample: i32) -> vec4<f32> {
|
||||
return textureLoad(image_multisampled_2d, coords, sample);
|
||||
fn test_textureLoad_multisampled_2d(coords: vec2<i32>, _sample: i32) -> vec4<f32> {
|
||||
return textureLoad(image_multisampled_2d, coords, _sample);
|
||||
}
|
||||
|
||||
@group(0) @binding(0)
|
||||
@@ -50,8 +50,8 @@ fn test_textureLoad_depth_2d_array(coords: vec2<i32>, index: i32, level: i32) ->
|
||||
@group(0) @binding(0)
|
||||
var image_depth_multisampled_2d: texture_depth_multisampled_2d;
|
||||
|
||||
fn test_textureLoad_depth_multisampled_2d(coords: vec2<i32>, sample: i32) -> f32 {
|
||||
return textureLoad(image_depth_multisampled_2d, coords, sample);
|
||||
fn test_textureLoad_depth_multisampled_2d(coords: vec2<i32>, _sample: i32) -> f32 {
|
||||
return textureLoad(image_depth_multisampled_2d, coords, _sample);
|
||||
}
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
+4
-4
@@ -10,10 +10,10 @@ struct FragmentIn {
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn main(in: FragmentIn) -> @location(0) vec4<f32> {
|
||||
if in.primitive_index == pc.index {
|
||||
return in.color;
|
||||
fn main(_in: FragmentIn) -> @location(0) vec4<f32> {
|
||||
if _in.primitive_index == pc.index {
|
||||
return _in.color;
|
||||
} else {
|
||||
return vec4<f32>(vec3<f32>(1.0) - in.color.rgb, in.color.a);
|
||||
return vec4<f32>(vec3<f32>(1.0) - _in.color.rgb, _in.color.a);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -97,7 +97,7 @@ fn levels_queries() -> @builtin(position) vec4<f32> {
|
||||
var sampler_reg: sampler;
|
||||
|
||||
@fragment
|
||||
fn sample() -> @location(0) vec4<f32> {
|
||||
fn texture_sample() -> @location(0) vec4<f32> {
|
||||
let tc = vec2<f32>(0.5);
|
||||
let level = 2.3;
|
||||
let s1d = textureSample(image_1d, sampler_reg, tc.x);
|
||||
@@ -117,7 +117,7 @@ var image_2d_depth: texture_depth_2d;
|
||||
var image_cube_depth: texture_depth_cube;
|
||||
|
||||
@fragment
|
||||
fn sample_comparison() -> @location(0) f32 {
|
||||
fn texture_sample_comparison() -> @location(0) f32 {
|
||||
let tc = vec2<f32>(0.5);
|
||||
let dref = 0.5;
|
||||
let s2d_depth = textureSampleCompare(image_2d_depth, sampler_cmp, tc, dref);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
struct VertexOutput {
|
||||
@builtin(position) @invariant position: vec4<f32>,
|
||||
@location(1) varying: f32,
|
||||
@location(1) _varying: f32,
|
||||
}
|
||||
|
||||
@vertex
|
||||
@@ -23,17 +23,17 @@ struct FragmentOutput {
|
||||
|
||||
@fragment
|
||||
fn fragment(
|
||||
in: VertexOutput,
|
||||
_in: VertexOutput,
|
||||
@builtin(front_facing) front_facing: bool,
|
||||
@builtin(sample_index) sample_index: u32,
|
||||
@builtin(sample_mask) sample_mask: u32,
|
||||
) -> FragmentOutput {
|
||||
let mask = sample_mask & (1u << sample_index);
|
||||
let color = select(0.0, 1.0, front_facing);
|
||||
return FragmentOutput(in.varying, mask, color);
|
||||
return FragmentOutput(_in._varying, mask, color);
|
||||
}
|
||||
|
||||
var<workgroup> output: array<u32, 1>;
|
||||
var<workgroup> _output: array<u32, 1>;
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute(
|
||||
@@ -43,7 +43,7 @@ fn compute(
|
||||
@builtin(workgroup_id) wg_id: vec3<u32>,
|
||||
@builtin(num_workgroups) num_wgs: vec3<u32>,
|
||||
) {
|
||||
output[0] = global_id.x + local_id.x + local_index + wg_id.x + num_wgs.x;
|
||||
_output[0] = global_id.x + local_id.x + local_index + wg_id.x + num_wgs.x;
|
||||
}
|
||||
|
||||
struct Input1 {
|
||||
|
||||
+12
-12
@@ -2,8 +2,8 @@
|
||||
|
||||
struct FragmentInput {
|
||||
@builtin(position) position: vec4<f32>,
|
||||
@location(0) @interpolate(flat) flat : u32,
|
||||
@location(1) @interpolate(linear) linear : f32,
|
||||
@location(0) @interpolate(flat) _flat : u32,
|
||||
@location(1) @interpolate(linear) _linear : f32,
|
||||
@location(2) @interpolate(linear, centroid) linear_centroid : vec2<f32>,
|
||||
@location(3) @interpolate(linear, sample) linear_sample : vec3<f32>,
|
||||
@location(4) @interpolate(perspective) perspective : vec4<f32>,
|
||||
@@ -13,18 +13,18 @@ struct FragmentInput {
|
||||
|
||||
@vertex
|
||||
fn vert_main() -> FragmentInput {
|
||||
var out: FragmentInput;
|
||||
var _out: FragmentInput;
|
||||
|
||||
out.position = vec4<f32>(2.0, 4.0, 5.0, 6.0);
|
||||
out.flat = 8u;
|
||||
out.linear = 27.0;
|
||||
out.linear_centroid = vec2<f32>(64.0, 125.0);
|
||||
out.linear_sample = vec3<f32>(216.0, 343.0, 512.0);
|
||||
out.perspective = vec4<f32>(729.0, 1000.0, 1331.0, 1728.0);
|
||||
out.perspective_centroid = 2197.0;
|
||||
out.perspective_sample = 2744.0;
|
||||
_out.position = vec4<f32>(2.0, 4.0, 5.0, 6.0);
|
||||
_out._flat = 8u;
|
||||
_out._linear = 27.0;
|
||||
_out.linear_centroid = vec2<f32>(64.0, 125.0);
|
||||
_out.linear_sample = vec3<f32>(216.0, 343.0, 512.0);
|
||||
_out.perspective = vec4<f32>(729.0, 1000.0, 1331.0, 1728.0);
|
||||
_out.perspective_centroid = 2197.0;
|
||||
_out.perspective_sample = 2744.0;
|
||||
|
||||
return out;
|
||||
return _out;
|
||||
}
|
||||
|
||||
@fragment
|
||||
|
||||
@@ -18,7 +18,7 @@ struct Test3 {
|
||||
}
|
||||
|
||||
@group(0) @binding(0)
|
||||
var<uniform> input: Test;
|
||||
var<uniform> input1: Test;
|
||||
|
||||
@group(0) @binding(1)
|
||||
var<uniform> input2: Test2;
|
||||
@@ -29,5 +29,5 @@ var<uniform> input3: Test3;
|
||||
|
||||
@vertex
|
||||
fn vertex() -> @builtin(position) vec4<f32> {
|
||||
return vec4<f32>(1.0) * input.b * input2.b * input3.b;
|
||||
return vec4<f32>(1.0) * input1.b * input2.b * input3.b;
|
||||
}
|
||||
@@ -8,6 +8,6 @@ struct FragmentIn {
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn main(in: FragmentIn) -> @location(0) vec4<f32> {
|
||||
return in.color * pc.multiplier;
|
||||
fn main(_in: FragmentIn) -> @location(0) vec4<f32> {
|
||||
return _in.color * pc.multiplier;
|
||||
}
|
||||
+13
-13
@@ -36,11 +36,11 @@ fn vs_main(
|
||||
) -> VertexOutput {
|
||||
let w = u_entity.world;
|
||||
let world_pos = u_entity.world * vec4<f32>(position);
|
||||
var out: VertexOutput;
|
||||
out.world_normal = mat3x3<f32>(w.x.xyz, w.y.xyz, w.z.xyz) * vec3<f32>(normal.xyz);
|
||||
out.world_position = world_pos;
|
||||
out.proj_position = u_globals.view_proj * world_pos;
|
||||
return out;
|
||||
var _out: VertexOutput;
|
||||
_out.world_normal = mat3x3<f32>(w.x.xyz, w.y.xyz, w.z.xyz) * vec3<f32>(normal.xyz);
|
||||
_out.world_position = world_pos;
|
||||
_out.proj_position = u_globals.view_proj * world_pos;
|
||||
return _out;
|
||||
}
|
||||
|
||||
// fragment shader
|
||||
@@ -81,16 +81,16 @@ let c_ambient: vec3<f32> = vec3<f32>(0.05, 0.05, 0.05);
|
||||
let c_max_lights: u32 = 10u;
|
||||
|
||||
@fragment
|
||||
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let normal = normalize(in.world_normal);
|
||||
fn fs_main(_in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let normal = normalize(_in.world_normal);
|
||||
// accumulate color
|
||||
var color: vec3<f32> = c_ambient;
|
||||
for(var i = 0u; i < min(u_globals.num_lights.x, c_max_lights); i++) {
|
||||
let light = s_lights[i];
|
||||
// project into the light space
|
||||
let shadow = fetch_shadow(i, light.proj * in.world_position);
|
||||
let shadow = fetch_shadow(i, light.proj * _in.world_position);
|
||||
// compute Lambertian diffuse term
|
||||
let light_dir = normalize(light.pos.xyz - in.world_position.xyz);
|
||||
let light_dir = normalize(light.pos.xyz - _in.world_position.xyz);
|
||||
let diffuse = max(0.0, dot(normal, light_dir));
|
||||
// add light contribution
|
||||
color += shadow * diffuse * light.color.xyz;
|
||||
@@ -101,15 +101,15 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
|
||||
// The fragment entrypoint used when storage buffers are not available for the lights
|
||||
@fragment
|
||||
fn fs_main_without_storage(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let normal = normalize(in.world_normal);
|
||||
fn fs_main_without_storage(_in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let normal = normalize(_in.world_normal);
|
||||
var color: vec3<f32> = c_ambient;
|
||||
for(var i = 0u; i < min(u_globals.num_lights.x, c_max_lights); i++) {
|
||||
// This line is the only difference from the entrypoint above. It uses the lights
|
||||
// uniform instead of the lights storage buffer
|
||||
let light = u_lights[i];
|
||||
let shadow = fetch_shadow(i, light.proj * in.world_position);
|
||||
let light_dir = normalize(light.pos.xyz - in.world_position.xyz);
|
||||
let shadow = fetch_shadow(i, light.proj * _in.world_position);
|
||||
let light_dir = normalize(light.pos.xyz - _in.world_position.xyz);
|
||||
let diffuse = max(0.0, dot(normal, light_dir));
|
||||
color += shadow * diffuse * light.color.xyz;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ var r_texture: texture_cube<f32>;
|
||||
var r_sampler: sampler;
|
||||
|
||||
@fragment
|
||||
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
return textureSample(r_texture, r_sampler, in.uv);
|
||||
fn fs_main(_in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
return textureSample(r_texture, r_sampler, _in.uv);
|
||||
}
|
||||
@@ -12,7 +12,7 @@ struct Baz {
|
||||
mat3x2 m;
|
||||
};
|
||||
layout(std430) buffer Bar_block_0Compute {
|
||||
mat4x3 matrix;
|
||||
mat4x3 _matrix;
|
||||
mat2x2 matrix_array[2];
|
||||
int atom;
|
||||
uvec2 arr[2];
|
||||
|
||||
@@ -10,7 +10,7 @@ struct Baz {
|
||||
mat3x2 m;
|
||||
};
|
||||
layout(std430) buffer Bar_block_0Fragment {
|
||||
mat4x3 matrix;
|
||||
mat4x3 _matrix;
|
||||
mat2x2 matrix_array[2];
|
||||
int atom;
|
||||
uvec2 arr[2];
|
||||
@@ -29,8 +29,8 @@ float test_arr_as_arg(float a[5][10]) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
_group_0_binding_0_fs.matrix[1][2] = 1.0;
|
||||
_group_0_binding_0_fs.matrix = mat4x3(vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0));
|
||||
_group_0_binding_0_fs._matrix[1][2] = 1.0;
|
||||
_group_0_binding_0_fs._matrix = mat4x3(vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0));
|
||||
_group_0_binding_0_fs.arr = uvec2[2](uvec2(0u), uvec2(1u));
|
||||
_group_0_binding_0_fs.data[1].value = 1;
|
||||
_fs2p_location0 = vec4(0.0);
|
||||
|
||||
@@ -10,7 +10,7 @@ struct Baz {
|
||||
mat3x2 m;
|
||||
};
|
||||
layout(std430) buffer Bar_block_0Vertex {
|
||||
mat4x3 matrix;
|
||||
mat4x3 _matrix;
|
||||
mat2x2 matrix_array[2];
|
||||
int atom;
|
||||
uvec2 arr[2];
|
||||
@@ -86,9 +86,9 @@ void main() {
|
||||
float baz_1 = foo;
|
||||
foo = 1.0;
|
||||
test_matrix_within_struct_accesses();
|
||||
mat4x3 matrix = _group_0_binding_0_vs.matrix;
|
||||
mat4x3 _matrix = _group_0_binding_0_vs._matrix;
|
||||
uvec2 arr[2] = _group_0_binding_0_vs.arr;
|
||||
float b = _group_0_binding_0_vs.matrix[3][0];
|
||||
float b = _group_0_binding_0_vs._matrix[3][0];
|
||||
int a_1 = _group_0_binding_0_vs.data[(uint(_group_0_binding_0_vs.data.length()) - 2u)].value;
|
||||
float _e28 = read_from_private(foo);
|
||||
c = int[5](a_1, int(b), 3, 4, 5);
|
||||
@@ -96,7 +96,7 @@ void main() {
|
||||
int value = c[vi];
|
||||
float _e42 = test_arr_as_arg(float[5][10](float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)));
|
||||
unnamed = _e42;
|
||||
gl_Position = vec4((matrix * vec4(ivec4(value))), 2.0);
|
||||
gl_Position = vec4((_matrix * vec4(ivec4(value))), 2.0);
|
||||
gl_Position.yz = vec2(-gl_Position.y, gl_Position.z * 2.0 - gl_Position.w);
|
||||
return;
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,8 +1,8 @@
|
||||
#version 400 core
|
||||
struct FragmentInput {
|
||||
vec4 position;
|
||||
uint flat_;
|
||||
float linear;
|
||||
uint _flat;
|
||||
float _linear;
|
||||
vec2 linear_centroid;
|
||||
vec3 linear_sample;
|
||||
vec4 perspective;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#version 400 core
|
||||
struct FragmentInput {
|
||||
vec4 position;
|
||||
uint flat_;
|
||||
float linear;
|
||||
uint _flat;
|
||||
float _linear;
|
||||
vec2 linear_centroid;
|
||||
vec3 linear_sample;
|
||||
vec4 perspective;
|
||||
@@ -18,19 +18,19 @@ smooth centroid out float _vs2fs_location5;
|
||||
smooth sample out float _vs2fs_location6;
|
||||
|
||||
void main() {
|
||||
FragmentInput out_ = FragmentInput(vec4(0.0), 0u, 0.0, vec2(0.0), vec3(0.0), vec4(0.0), 0.0, 0.0);
|
||||
out_.position = vec4(2.0, 4.0, 5.0, 6.0);
|
||||
out_.flat_ = 8u;
|
||||
out_.linear = 27.0;
|
||||
out_.linear_centroid = vec2(64.0, 125.0);
|
||||
out_.linear_sample = vec3(216.0, 343.0, 512.0);
|
||||
out_.perspective = vec4(729.0, 1000.0, 1331.0, 1728.0);
|
||||
out_.perspective_centroid = 2197.0;
|
||||
out_.perspective_sample = 2744.0;
|
||||
FragmentInput _e30 = out_;
|
||||
FragmentInput _out = FragmentInput(vec4(0.0), 0u, 0.0, vec2(0.0), vec3(0.0), vec4(0.0), 0.0, 0.0);
|
||||
_out.position = vec4(2.0, 4.0, 5.0, 6.0);
|
||||
_out._flat = 8u;
|
||||
_out._linear = 27.0;
|
||||
_out.linear_centroid = vec2(64.0, 125.0);
|
||||
_out.linear_sample = vec3(216.0, 343.0, 512.0);
|
||||
_out.perspective = vec4(729.0, 1000.0, 1331.0, 1728.0);
|
||||
_out.perspective_centroid = 2197.0;
|
||||
_out.perspective_sample = 2744.0;
|
||||
FragmentInput _e30 = _out;
|
||||
gl_Position = _e30.position;
|
||||
_vs2fs_location0 = _e30.flat_;
|
||||
_vs2fs_location1 = _e30.linear;
|
||||
_vs2fs_location0 = _e30._flat;
|
||||
_vs2fs_location1 = _e30._linear;
|
||||
_vs2fs_location2 = _e30.linear_centroid;
|
||||
_vs2fs_location3 = _e30.linear_sample;
|
||||
_vs2fs_location4 = _e30.perspective;
|
||||
|
||||
@@ -15,9 +15,9 @@ layout(location = 0) smooth in vec4 _vs2fs_location0;
|
||||
layout(location = 0) out vec4 _fs2p_location0;
|
||||
|
||||
void main() {
|
||||
FragmentIn in_ = FragmentIn(_vs2fs_location0);
|
||||
FragmentIn _in = FragmentIn(_vs2fs_location0);
|
||||
float _e4 = pc.multiplier;
|
||||
_fs2p_location0 = (in_.color * _e4);
|
||||
_fs2p_location0 = (_in.color * _e4);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ float fetch_shadow(uint light_id, vec4 homogeneous_coords) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
VertexOutput in_ = VertexOutput(gl_FragCoord, _vs2fs_location0, _vs2fs_location1);
|
||||
VertexOutput _in = VertexOutput(gl_FragCoord, _vs2fs_location0, _vs2fs_location1);
|
||||
vec3 color = vec3(0.05000000074505806, 0.05000000074505806, 0.05000000074505806);
|
||||
uint i = 0u;
|
||||
vec3 normal_1 = normalize(in_.world_normal);
|
||||
vec3 normal_1 = normalize(_in.world_normal);
|
||||
bool loop_init = true;
|
||||
while(true) {
|
||||
if (!loop_init) {
|
||||
@@ -65,8 +65,8 @@ void main() {
|
||||
uint _e23 = i;
|
||||
Light light = _group_0_binding_1_fs[_e23];
|
||||
uint _e26 = i;
|
||||
float _e30 = fetch_shadow(_e26, (light.proj * in_.world_position));
|
||||
vec3 light_dir = normalize((light.pos.xyz - in_.world_position.xyz));
|
||||
float _e30 = fetch_shadow(_e26, (light.proj * _in.world_position));
|
||||
vec3 light_dir = normalize((light.pos.xyz - _in.world_position.xyz));
|
||||
float diffuse = max(0.0, dot(normal_1, light_dir));
|
||||
vec3 _e40 = color;
|
||||
color = (_e40 + ((_e30 * diffuse) * light.color.xyz));
|
||||
|
||||
@@ -45,10 +45,10 @@ float fetch_shadow(uint light_id, vec4 homogeneous_coords) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
VertexOutput in_1 = VertexOutput(gl_FragCoord, _vs2fs_location0, _vs2fs_location1);
|
||||
VertexOutput _in_1 = VertexOutput(gl_FragCoord, _vs2fs_location0, _vs2fs_location1);
|
||||
vec3 color_1 = vec3(0.05000000074505806, 0.05000000074505806, 0.05000000074505806);
|
||||
uint i_1 = 0u;
|
||||
vec3 normal_1 = normalize(in_1.world_normal);
|
||||
vec3 normal_1 = normalize(_in_1.world_normal);
|
||||
bool loop_init = true;
|
||||
while(true) {
|
||||
if (!loop_init) {
|
||||
@@ -65,8 +65,8 @@ void main() {
|
||||
uint _e23 = i_1;
|
||||
Light light = _group_0_binding_1_fs[_e23];
|
||||
uint _e26 = i_1;
|
||||
float _e30 = fetch_shadow(_e26, (light.proj * in_1.world_position));
|
||||
vec3 light_dir = normalize((light.pos.xyz - in_1.world_position.xyz));
|
||||
float _e30 = fetch_shadow(_e26, (light.proj * _in_1.world_position));
|
||||
vec3 light_dir = normalize((light.pos.xyz - _in_1.world_position.xyz));
|
||||
float diffuse = max(0.0, dot(normal_1, light_dir));
|
||||
vec3 _e40 = color_1;
|
||||
color_1 = (_e40 + ((_e30 * diffuse) * light.color.xyz));
|
||||
|
||||
@@ -33,15 +33,15 @@ layout(location = 1) smooth out vec4 _vs2fs_location1;
|
||||
void main() {
|
||||
ivec4 position = _p2vs_location0;
|
||||
ivec4 normal = _p2vs_location1;
|
||||
VertexOutput out_ = VertexOutput(vec4(0.0), vec3(0.0), vec4(0.0));
|
||||
VertexOutput _out = VertexOutput(vec4(0.0), vec3(0.0), vec4(0.0));
|
||||
mat4x4 w = _group_1_binding_0_vs.world;
|
||||
mat4x4 _e7 = _group_1_binding_0_vs.world;
|
||||
vec4 world_pos = (_e7 * vec4(position));
|
||||
out_.world_normal = (mat3x3(w[0].xyz, w[1].xyz, w[2].xyz) * vec3(normal.xyz));
|
||||
out_.world_position = world_pos;
|
||||
_out.world_normal = (mat3x3(w[0].xyz, w[1].xyz, w[2].xyz) * vec3(normal.xyz));
|
||||
_out.world_position = world_pos;
|
||||
mat4x4 _e25 = _group_0_binding_0_vs.view_proj;
|
||||
out_.proj_position = (_e25 * world_pos);
|
||||
VertexOutput _e27 = out_;
|
||||
_out.proj_position = (_e25 * world_pos);
|
||||
VertexOutput _e27 = _out;
|
||||
gl_Position = _e27.proj_position;
|
||||
_vs2fs_location0 = _e27.world_normal;
|
||||
_vs2fs_location1 = _e27.world_position;
|
||||
|
||||
@@ -17,8 +17,8 @@ layout(location = 0) smooth in vec3 _vs2fs_location0;
|
||||
layout(location = 0) out vec4 _fs2p_location0;
|
||||
|
||||
void main() {
|
||||
VertexOutput in_ = VertexOutput(gl_FragCoord, _vs2fs_location0);
|
||||
vec4 _e5 = texture(_group_0_binding_1_fs, vec3(in_.uv));
|
||||
VertexOutput _in = VertexOutput(gl_FragCoord, _vs2fs_location0);
|
||||
vec4 _e5 = texture(_group_0_binding_1_fs, vec3(_in.uv));
|
||||
_fs2p_location0 = _e5;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ float4 foo_vert(uint vi : SV_VertexID) : SV_Position
|
||||
float baz_1 = foo;
|
||||
foo = 1.0;
|
||||
test_matrix_within_struct_accesses();
|
||||
float4x3 matrix_ = float4x3(asfloat(bar.Load3(0+0)), asfloat(bar.Load3(0+16)), asfloat(bar.Load3(0+32)), asfloat(bar.Load3(0+48)));
|
||||
float4x3 _matrix = float4x3(asfloat(bar.Load3(0+0)), asfloat(bar.Load3(0+16)), asfloat(bar.Load3(0+32)), asfloat(bar.Load3(0+48)));
|
||||
uint2 arr[2] = {asuint(bar.Load2(104+0)), asuint(bar.Load2(104+8))};
|
||||
float b = asfloat(bar.Load(0+48+0));
|
||||
int a_1 = asint(bar.Load(0+(((NagaBufferLengthRW(bar) - 120) / 8) - 2u)*8+120));
|
||||
@@ -151,7 +151,7 @@ float4 foo_vert(uint vi : SV_VertexID) : SV_Position
|
||||
int value = c[vi];
|
||||
const float _e42 = test_arr_as_arg(Constructarray5_array10_float__(Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)));
|
||||
unnamed = _e42;
|
||||
return float4(mul(float4((value).xxxx), matrix_), 2.0);
|
||||
return float4(mul(float4((value).xxxx), _matrix), 2.0);
|
||||
}
|
||||
|
||||
uint2 Constructarray2_uint2_(uint2 arg0, uint2 arg1)[2] {
|
||||
|
||||
@@ -230,7 +230,7 @@ float4 levels_queries() : SV_Position
|
||||
return (float(sum_1)).xxxx;
|
||||
}
|
||||
|
||||
float4 sample_() : SV_Target0
|
||||
float4 texture_sample() : SV_Target0
|
||||
{
|
||||
float2 tc = (0.5).xx;
|
||||
float4 s1d = image_1d.Sample(sampler_reg, tc.x);
|
||||
@@ -242,7 +242,7 @@ float4 sample_() : SV_Target0
|
||||
return ((((s1d + s2d) + s2d_offset) + s2d_level) + s2d_level_offset);
|
||||
}
|
||||
|
||||
float sample_comparison() : SV_Target0
|
||||
float texture_sample_comparison() : SV_Target0
|
||||
{
|
||||
float2 tc_1 = (0.5).xx;
|
||||
float s2d_depth = image_2d_depth.SampleCmp(sampler_cmp, tc_1, 0.5);
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
vertex=(queries:vs_5_1 levels_queries:vs_5_1 )
|
||||
fragment=(sample_:ps_5_1 sample_comparison:ps_5_1 gather:ps_5_1 depth_no_comparison:ps_5_1 )
|
||||
fragment=(texture_sample:ps_5_1 texture_sample_comparison:ps_5_1 gather:ps_5_1 depth_no_comparison:ps_5_1 )
|
||||
compute=(main:cs_5_1 depth_load:cs_5_1 )
|
||||
@@ -7,7 +7,7 @@ ConstantBuffer<NagaConstants> _NagaConstants: register(b0, space1);
|
||||
|
||||
struct VertexOutput {
|
||||
precise float4 position : SV_Position;
|
||||
float varying : LOC1;
|
||||
float _varying : LOC1;
|
||||
};
|
||||
|
||||
struct FragmentOutput {
|
||||
@@ -24,15 +24,15 @@ struct Input2_ {
|
||||
uint index : SV_InstanceID;
|
||||
};
|
||||
|
||||
groupshared uint output[1];
|
||||
groupshared uint _output[1];
|
||||
|
||||
struct VertexOutput_vertex {
|
||||
float varying : LOC1;
|
||||
float _varying : LOC1;
|
||||
precise float4 position : SV_Position;
|
||||
};
|
||||
|
||||
struct FragmentInput_fragment {
|
||||
float varying_1 : LOC1;
|
||||
float _varying_1 : LOC1;
|
||||
precise float4 position_1 : SV_Position;
|
||||
bool front_facing_1 : SV_IsFrontFace;
|
||||
uint sample_index_1 : SV_SampleIndex;
|
||||
@@ -42,7 +42,7 @@ struct FragmentInput_fragment {
|
||||
VertexOutput ConstructVertexOutput(float4 arg0, float arg1) {
|
||||
VertexOutput ret;
|
||||
ret.position = arg0;
|
||||
ret.varying = arg1;
|
||||
ret._varying = arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ VertexOutput_vertex vertex(uint vertex_index : SV_VertexID, uint instance_index
|
||||
{
|
||||
uint tmp = (((_NagaConstants.base_vertex + vertex_index) + (_NagaConstants.base_instance + instance_index)) + color);
|
||||
const VertexOutput vertexoutput = ConstructVertexOutput((1.0).xxxx, float(tmp));
|
||||
const VertexOutput_vertex vertexoutput_1 = { vertexoutput.varying, vertexoutput.position };
|
||||
const VertexOutput_vertex vertexoutput_1 = { vertexoutput._varying, vertexoutput.position };
|
||||
return vertexoutput_1;
|
||||
}
|
||||
|
||||
@@ -64,20 +64,20 @@ FragmentOutput ConstructFragmentOutput(float arg0, uint arg1, float arg2) {
|
||||
|
||||
FragmentOutput fragment(FragmentInput_fragment fragmentinput_fragment)
|
||||
{
|
||||
VertexOutput in_ = { fragmentinput_fragment.position_1, fragmentinput_fragment.varying_1 };
|
||||
VertexOutput _in = { fragmentinput_fragment.position_1, fragmentinput_fragment._varying_1 };
|
||||
bool front_facing = fragmentinput_fragment.front_facing_1;
|
||||
uint sample_index = fragmentinput_fragment.sample_index_1;
|
||||
uint sample_mask = fragmentinput_fragment.sample_mask_1;
|
||||
uint mask = (sample_mask & (1u << sample_index));
|
||||
float color_1 = (front_facing ? 1.0 : 0.0);
|
||||
const FragmentOutput fragmentoutput = ConstructFragmentOutput(in_.varying, mask, color_1);
|
||||
const FragmentOutput fragmentoutput = ConstructFragmentOutput(_in._varying, mask, color_1);
|
||||
return fragmentoutput;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute(uint3 global_id : SV_DispatchThreadID, uint3 local_id : SV_GroupThreadID, uint local_index : SV_GroupIndex, uint3 wg_id : SV_GroupID, uint3 num_wgs : SV_GroupID)
|
||||
{
|
||||
output[0] = ((((global_id.x + local_id.x) + local_index) + wg_id.x) + uint3(_NagaConstants.base_vertex, _NagaConstants.base_instance, _NagaConstants.other).x);
|
||||
_output[0] = ((((global_id.x + local_id.x) + local_index) + wg_id.x) + uint3(_NagaConstants.base_vertex, _NagaConstants.base_instance, _NagaConstants.other).x);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
struct FragmentInput {
|
||||
float4 position : SV_Position;
|
||||
nointerpolation uint flat : LOC0;
|
||||
noperspective float linear_ : LOC1;
|
||||
nointerpolation uint _flat : LOC0;
|
||||
noperspective float _linear : LOC1;
|
||||
noperspective centroid float2 linear_centroid : LOC2;
|
||||
noperspective sample float3 linear_sample : LOC3;
|
||||
float4 perspective : LOC4;
|
||||
@@ -11,8 +11,8 @@ struct FragmentInput {
|
||||
};
|
||||
|
||||
struct VertexOutput_vert_main {
|
||||
nointerpolation uint flat : LOC0;
|
||||
noperspective float linear_ : LOC1;
|
||||
nointerpolation uint _flat : LOC0;
|
||||
noperspective float _linear : LOC1;
|
||||
noperspective centroid float2 linear_centroid : LOC2;
|
||||
noperspective sample float3 linear_sample : LOC3;
|
||||
float4 perspective : LOC4;
|
||||
@@ -22,8 +22,8 @@ struct VertexOutput_vert_main {
|
||||
};
|
||||
|
||||
struct FragmentInput_frag_main {
|
||||
nointerpolation uint flat_1 : LOC0;
|
||||
noperspective float linear_1 : LOC1;
|
||||
nointerpolation uint _flat_1 : LOC0;
|
||||
noperspective float _linear_1 : LOC1;
|
||||
noperspective centroid float2 linear_centroid_1 : LOC2;
|
||||
noperspective sample float3 linear_sample_1 : LOC3;
|
||||
float4 perspective_1 : LOC4;
|
||||
@@ -34,24 +34,24 @@ struct FragmentInput_frag_main {
|
||||
|
||||
VertexOutput_vert_main vert_main()
|
||||
{
|
||||
FragmentInput out_ = (FragmentInput)0;
|
||||
FragmentInput _out = (FragmentInput)0;
|
||||
|
||||
out_.position = float4(2.0, 4.0, 5.0, 6.0);
|
||||
out_.flat = 8u;
|
||||
out_.linear_ = 27.0;
|
||||
out_.linear_centroid = float2(64.0, 125.0);
|
||||
out_.linear_sample = float3(216.0, 343.0, 512.0);
|
||||
out_.perspective = float4(729.0, 1000.0, 1331.0, 1728.0);
|
||||
out_.perspective_centroid = 2197.0;
|
||||
out_.perspective_sample = 2744.0;
|
||||
FragmentInput _expr30 = out_;
|
||||
_out.position = float4(2.0, 4.0, 5.0, 6.0);
|
||||
_out._flat = 8u;
|
||||
_out._linear = 27.0;
|
||||
_out.linear_centroid = float2(64.0, 125.0);
|
||||
_out.linear_sample = float3(216.0, 343.0, 512.0);
|
||||
_out.perspective = float4(729.0, 1000.0, 1331.0, 1728.0);
|
||||
_out.perspective_centroid = 2197.0;
|
||||
_out.perspective_sample = 2744.0;
|
||||
FragmentInput _expr30 = _out;
|
||||
const FragmentInput fragmentinput = _expr30;
|
||||
const VertexOutput_vert_main fragmentinput_1 = { fragmentinput.flat, fragmentinput.linear_, fragmentinput.linear_centroid, fragmentinput.linear_sample, fragmentinput.perspective, fragmentinput.perspective_centroid, fragmentinput.perspective_sample, fragmentinput.position };
|
||||
const VertexOutput_vert_main fragmentinput_1 = { fragmentinput._flat, fragmentinput._linear, fragmentinput.linear_centroid, fragmentinput.linear_sample, fragmentinput.perspective, fragmentinput.perspective_centroid, fragmentinput.perspective_sample, fragmentinput.position };
|
||||
return fragmentinput_1;
|
||||
}
|
||||
|
||||
void frag_main(FragmentInput_frag_main fragmentinput_frag_main)
|
||||
{
|
||||
FragmentInput val = { fragmentinput_frag_main.position_1, fragmentinput_frag_main.flat_1, fragmentinput_frag_main.linear_1, fragmentinput_frag_main.linear_centroid_1, fragmentinput_frag_main.linear_sample_1, fragmentinput_frag_main.perspective_1, fragmentinput_frag_main.perspective_centroid_1, fragmentinput_frag_main.perspective_sample_1 };
|
||||
FragmentInput val = { fragmentinput_frag_main.position_1, fragmentinput_frag_main._flat_1, fragmentinput_frag_main._linear_1, fragmentinput_frag_main.linear_centroid_1, fragmentinput_frag_main.linear_sample_1, fragmentinput_frag_main.perspective_1, fragmentinput_frag_main.perspective_centroid_1, fragmentinput_frag_main.perspective_sample_1 };
|
||||
return;
|
||||
}
|
||||
@@ -30,13 +30,13 @@ struct Test3_ {
|
||||
int _end_pad_2;
|
||||
};
|
||||
|
||||
cbuffer input : register(b0) { Test input; }
|
||||
cbuffer input1_ : register(b0) { Test input1_; }
|
||||
cbuffer input2_ : register(b1) { Test2_ input2_; }
|
||||
cbuffer input3_ : register(b2) { Test3_ input3_; }
|
||||
|
||||
float4 vertex() : SV_Position
|
||||
{
|
||||
float _expr6 = input.b;
|
||||
float _expr6 = input1_.b;
|
||||
float _expr9 = input2_.b;
|
||||
float _expr12 = input3_.b;
|
||||
return ((((1.0).xxxx * _expr6) * _expr9) * _expr12);
|
||||
|
||||
+13
-13
@@ -62,16 +62,16 @@ float fetch_shadow(uint light_id, float4 homogeneous_coords)
|
||||
|
||||
VertexOutput_vs_main vs_main(int4 position : LOC0, int4 normal : LOC1)
|
||||
{
|
||||
VertexOutput out_ = (VertexOutput)0;
|
||||
VertexOutput _out = (VertexOutput)0;
|
||||
|
||||
float4x4 w = u_entity.world;
|
||||
float4x4 _expr7 = u_entity.world;
|
||||
float4 world_pos = mul(float4(position), _expr7);
|
||||
out_.world_normal = mul(float3(normal.xyz), float3x3(w[0].xyz, w[1].xyz, w[2].xyz));
|
||||
out_.world_position = world_pos;
|
||||
_out.world_normal = mul(float3(normal.xyz), float3x3(w[0].xyz, w[1].xyz, w[2].xyz));
|
||||
_out.world_position = world_pos;
|
||||
float4x4 _expr25 = u_globals.view_proj;
|
||||
out_.proj_position = mul(world_pos, _expr25);
|
||||
VertexOutput _expr27 = out_;
|
||||
_out.proj_position = mul(world_pos, _expr25);
|
||||
VertexOutput _expr27 = _out;
|
||||
const VertexOutput vertexoutput = _expr27;
|
||||
const VertexOutput_vs_main vertexoutput_1 = { vertexoutput.world_normal, vertexoutput.world_position, vertexoutput.proj_position };
|
||||
return vertexoutput_1;
|
||||
@@ -79,11 +79,11 @@ VertexOutput_vs_main vs_main(int4 position : LOC0, int4 normal : LOC1)
|
||||
|
||||
float4 fs_main(FragmentInput_fs_main fragmentinput_fs_main) : SV_Target0
|
||||
{
|
||||
VertexOutput in_ = { fragmentinput_fs_main.proj_position_1, fragmentinput_fs_main.world_normal_1, fragmentinput_fs_main.world_position_1 };
|
||||
VertexOutput _in = { fragmentinput_fs_main.proj_position_1, fragmentinput_fs_main.world_normal_1, fragmentinput_fs_main.world_position_1 };
|
||||
float3 color = float3(0.05000000074505806, 0.05000000074505806, 0.05000000074505806);
|
||||
uint i = 0u;
|
||||
|
||||
float3 normal_1 = normalize(in_.world_normal);
|
||||
float3 normal_1 = normalize(_in.world_normal);
|
||||
bool loop_init = true;
|
||||
while(true) {
|
||||
if (!loop_init) {
|
||||
@@ -100,8 +100,8 @@ float4 fs_main(FragmentInput_fs_main fragmentinput_fs_main) : SV_Target0
|
||||
uint _expr23 = i;
|
||||
Light light = {float4x4(asfloat(s_lights.Load4(_expr23*96+0+0)), asfloat(s_lights.Load4(_expr23*96+0+16)), asfloat(s_lights.Load4(_expr23*96+0+32)), asfloat(s_lights.Load4(_expr23*96+0+48))), asfloat(s_lights.Load4(_expr23*96+64)), asfloat(s_lights.Load4(_expr23*96+80))};
|
||||
uint _expr26 = i;
|
||||
const float _e30 = fetch_shadow(_expr26, mul(in_.world_position, light.proj));
|
||||
float3 light_dir = normalize((light.pos.xyz - in_.world_position.xyz));
|
||||
const float _e30 = fetch_shadow(_expr26, mul(_in.world_position, light.proj));
|
||||
float3 light_dir = normalize((light.pos.xyz - _in.world_position.xyz));
|
||||
float diffuse = max(0.0, dot(normal_1, light_dir));
|
||||
float3 _expr40 = color;
|
||||
color = (_expr40 + ((_e30 * diffuse) * light.color.xyz));
|
||||
@@ -113,11 +113,11 @@ float4 fs_main(FragmentInput_fs_main fragmentinput_fs_main) : SV_Target0
|
||||
|
||||
float4 fs_main_without_storage(FragmentInput_fs_main_without_storage fragmentinput_fs_main_without_storage) : SV_Target0
|
||||
{
|
||||
VertexOutput in_1 = { fragmentinput_fs_main_without_storage.proj_position_2, fragmentinput_fs_main_without_storage.world_normal_2, fragmentinput_fs_main_without_storage.world_position_2 };
|
||||
VertexOutput _in_1 = { fragmentinput_fs_main_without_storage.proj_position_2, fragmentinput_fs_main_without_storage.world_normal_2, fragmentinput_fs_main_without_storage.world_position_2 };
|
||||
float3 color_1 = float3(0.05000000074505806, 0.05000000074505806, 0.05000000074505806);
|
||||
uint i_1 = 0u;
|
||||
|
||||
float3 normal_2 = normalize(in_1.world_normal);
|
||||
float3 normal_2 = normalize(_in_1.world_normal);
|
||||
bool loop_init_1 = true;
|
||||
while(true) {
|
||||
if (!loop_init_1) {
|
||||
@@ -134,8 +134,8 @@ float4 fs_main_without_storage(FragmentInput_fs_main_without_storage fragmentinp
|
||||
uint _expr23 = i_1;
|
||||
Light light_1 = u_lights[_expr23];
|
||||
uint _expr26 = i_1;
|
||||
const float _e30 = fetch_shadow(_expr26, mul(in_1.world_position, light_1.proj));
|
||||
float3 light_dir_1 = normalize((light_1.pos.xyz - in_1.world_position.xyz));
|
||||
const float _e30 = fetch_shadow(_expr26, mul(_in_1.world_position, light_1.proj));
|
||||
float3 light_dir_1 = normalize((light_1.pos.xyz - _in_1.world_position.xyz));
|
||||
float diffuse_1 = max(0.0, dot(normal_2, light_dir_1));
|
||||
float3 _expr40 = color_1;
|
||||
color_1 = (_expr40 + ((_e30 * diffuse_1) * light_1.color.xyz));
|
||||
|
||||
@@ -59,7 +59,7 @@ VertexOutput_vs_main vs_main(uint vertex_index : SV_VertexID)
|
||||
|
||||
float4 fs_main(FragmentInput_fs_main fragmentinput_fs_main) : SV_Target0
|
||||
{
|
||||
VertexOutput in_ = { fragmentinput_fs_main.position_1, fragmentinput_fs_main.uv_1 };
|
||||
float4 _expr5 = r_texture.Sample(r_sampler, in_.uv);
|
||||
VertexOutput _in = { fragmentinput_fs_main.position_1, fragmentinput_fs_main.uv_1 };
|
||||
float4 _expr5 = r_texture.Sample(r_sampler, _in.uv);
|
||||
return _expr5;
|
||||
}
|
||||
@@ -19,7 +19,7 @@ struct type_6 {
|
||||
};
|
||||
typedef AlignedWrapper type_7[1];
|
||||
struct Bar {
|
||||
metal::float4x3 matrix;
|
||||
metal::float4x3 _matrix;
|
||||
type_3 matrix_array;
|
||||
metal::atomic_int atom;
|
||||
char _pad3[4];
|
||||
@@ -122,9 +122,9 @@ vertex foo_vertOutput foo_vert(
|
||||
float baz_1 = foo;
|
||||
foo = 1.0;
|
||||
test_matrix_within_struct_accesses(baz);
|
||||
metal::float4x3 matrix = bar.matrix;
|
||||
metal::float4x3 _matrix = bar._matrix;
|
||||
type_6 arr = bar.arr;
|
||||
float b = bar.matrix[3].x;
|
||||
float b = bar._matrix[3].x;
|
||||
int a_1 = bar.data[(1 + (_buffer_sizes.size0 - 120 - 8) / 8) - 2u].value;
|
||||
float _e28 = read_from_private(foo);
|
||||
for(int _i=0; _i<5; ++_i) c.inner[_i] = type_17 {a_1, static_cast<int>(b), 3, 4, 5}.inner[_i];
|
||||
@@ -132,7 +132,7 @@ vertex foo_vertOutput foo_vert(
|
||||
int value = c.inner[vi];
|
||||
float _e42 = test_arr_as_arg(const_type_13_);
|
||||
unnamed = _e42;
|
||||
return foo_vertOutput { metal::float4(matrix * static_cast<metal::float4>(metal::int4(value)), 2.0) };
|
||||
return foo_vertOutput { metal::float4(_matrix * static_cast<metal::float4>(metal::int4(value)), 2.0) };
|
||||
}
|
||||
|
||||
|
||||
@@ -143,8 +143,8 @@ fragment foo_fragOutput foo_frag(
|
||||
device Bar& bar [[buffer(0)]]
|
||||
, constant _mslBufferSizes& _buffer_sizes [[buffer(24)]]
|
||||
) {
|
||||
bar.matrix[1].z = 1.0;
|
||||
bar.matrix = metal::float4x3(metal::float3(0.0), metal::float3(1.0), metal::float3(2.0), metal::float3(3.0));
|
||||
bar._matrix[1].z = 1.0;
|
||||
bar._matrix = metal::float4x3(metal::float3(0.0), metal::float3(1.0), metal::float3(2.0), metal::float3(3.0));
|
||||
for(int _i=0; _i<2; ++_i) bar.arr.inner[_i] = type_6 {metal::uint2(0u), metal::uint2(1u)}.inner[_i];
|
||||
bar.data[1].value = 1;
|
||||
return foo_fragOutput { metal::float4(0.0) };
|
||||
|
||||
@@ -47,10 +47,10 @@ metal::float4 test_textureLoad_3d(
|
||||
|
||||
metal::float4 test_textureLoad_multisampled_2d(
|
||||
metal::int2 coords_4,
|
||||
int sample,
|
||||
int _sample,
|
||||
metal::texture2d_ms<float, metal::access::read> image_multisampled_2d
|
||||
) {
|
||||
metal::float4 _e7 = image_multisampled_2d.read(metal::min(metal::uint2(coords_4), metal::uint2(image_multisampled_2d.get_width(), image_multisampled_2d.get_height()) - 1), metal::min(uint(sample), image_multisampled_2d.get_num_samples() - 1));
|
||||
metal::float4 _e7 = image_multisampled_2d.read(metal::min(metal::uint2(coords_4), metal::uint2(image_multisampled_2d.get_width(), image_multisampled_2d.get_height()) - 1), metal::min(uint(_sample), image_multisampled_2d.get_num_samples() - 1));
|
||||
return _e7;
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ float test_textureLoad_depth_2d_array(
|
||||
|
||||
float test_textureLoad_depth_multisampled_2d(
|
||||
metal::int2 coords_7,
|
||||
int sample_1,
|
||||
int _sample_1,
|
||||
metal::depth2d_ms<float, metal::access::read> image_depth_multisampled_2d
|
||||
) {
|
||||
float _e10 = image_depth_multisampled_2d.read(metal::min(metal::uint2(coords_7), metal::uint2(image_depth_multisampled_2d.get_width(), image_depth_multisampled_2d.get_height()) - 1), metal::min(uint(sample_1), image_depth_multisampled_2d.get_num_samples() - 1));
|
||||
float _e10 = image_depth_multisampled_2d.read(metal::min(metal::uint2(coords_7), metal::uint2(image_depth_multisampled_2d.get_width(), image_depth_multisampled_2d.get_height()) - 1), metal::min(uint(_sample_1), image_depth_multisampled_2d.get_num_samples() - 1));
|
||||
return _e10;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,10 +50,10 @@ metal::float4 test_textureLoad_3d(
|
||||
|
||||
metal::float4 test_textureLoad_multisampled_2d(
|
||||
metal::int2 coords_4,
|
||||
int sample,
|
||||
int _sample,
|
||||
metal::texture2d_ms<float, metal::access::read> image_multisampled_2d
|
||||
) {
|
||||
metal::float4 _e7 = (uint(sample) < image_multisampled_2d.get_num_samples() && metal::all(metal::uint2(coords_4) < metal::uint2(image_multisampled_2d.get_width(), image_multisampled_2d.get_height())) ? image_multisampled_2d.read(metal::uint2(coords_4), sample): DefaultConstructible());
|
||||
metal::float4 _e7 = (uint(_sample) < image_multisampled_2d.get_num_samples() && metal::all(metal::uint2(coords_4) < metal::uint2(image_multisampled_2d.get_width(), image_multisampled_2d.get_height())) ? image_multisampled_2d.read(metal::uint2(coords_4), _sample): DefaultConstructible());
|
||||
return _e7;
|
||||
}
|
||||
|
||||
@@ -78,10 +78,10 @@ float test_textureLoad_depth_2d_array(
|
||||
|
||||
float test_textureLoad_depth_multisampled_2d(
|
||||
metal::int2 coords_7,
|
||||
int sample_1,
|
||||
int _sample_1,
|
||||
metal::depth2d_ms<float, metal::access::read> image_depth_multisampled_2d
|
||||
) {
|
||||
float _e10 = (uint(sample_1) < image_depth_multisampled_2d.get_num_samples() && metal::all(metal::uint2(coords_7) < metal::uint2(image_depth_multisampled_2d.get_width(), image_depth_multisampled_2d.get_height())) ? image_depth_multisampled_2d.read(metal::uint2(coords_7), sample_1): DefaultConstructible());
|
||||
float _e10 = (uint(_sample_1) < image_depth_multisampled_2d.get_num_samples() && metal::all(metal::uint2(coords_7) < metal::uint2(image_depth_multisampled_2d.get_width(), image_depth_multisampled_2d.get_height())) ? image_depth_multisampled_2d.read(metal::uint2(coords_7), _sample_1): DefaultConstructible());
|
||||
return _e10;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@ fragment main_Output main_(
|
||||
, uint primitive_index [[primitive_id]]
|
||||
, constant PushConstants& pc [[buffer(1)]]
|
||||
) {
|
||||
const FragmentIn in = { varyings.color, primitive_index };
|
||||
const FragmentIn _in = { varyings.color, primitive_index };
|
||||
uint _e4 = pc.index;
|
||||
if (in.primitive_index == _e4) {
|
||||
return main_Output { in.color };
|
||||
if (_in.primitive_index == _e4) {
|
||||
return main_Output { _in.color };
|
||||
} else {
|
||||
return main_Output { metal::float4(metal::float3(1.0) - in.color.xyz, in.color.w) };
|
||||
return main_Output { metal::float4(metal::float3(1.0) - _in.color.xyz, _in.color.w) };
|
||||
}
|
||||
}
|
||||
@@ -99,10 +99,10 @@ vertex levels_queriesOutput levels_queries(
|
||||
}
|
||||
|
||||
|
||||
struct sampleOutput {
|
||||
struct texture_sampleOutput {
|
||||
metal::float4 member_4 [[color(0)]];
|
||||
};
|
||||
fragment sampleOutput sample(
|
||||
fragment texture_sampleOutput texture_sample(
|
||||
metal::texture1d<float, metal::access::sample> image_1d [[user(fake0)]]
|
||||
, metal::texture2d<float, metal::access::sample> image_2d [[user(fake0)]]
|
||||
, metal::sampler sampler_reg [[user(fake0)]]
|
||||
@@ -114,14 +114,14 @@ fragment sampleOutput sample(
|
||||
metal::float4 s2d_level = image_2d.sample(sampler_reg, tc, metal::level(2.299999952316284));
|
||||
metal::float4 s2d_level_offset = image_2d.sample(sampler_reg, tc, metal::level(2.299999952316284), const_type_9_);
|
||||
metal::float4 s2d_bias_offset = image_2d.sample(sampler_reg, tc, metal::bias(2.0), const_type_9_);
|
||||
return sampleOutput { (((s1d + s2d) + s2d_offset) + s2d_level) + s2d_level_offset };
|
||||
return texture_sampleOutput { (((s1d + s2d) + s2d_offset) + s2d_level) + s2d_level_offset };
|
||||
}
|
||||
|
||||
|
||||
struct sample_comparisonOutput {
|
||||
struct texture_sample_comparisonOutput {
|
||||
float member_5 [[color(0)]];
|
||||
};
|
||||
fragment sample_comparisonOutput sample_comparison(
|
||||
fragment texture_sample_comparisonOutput texture_sample_comparison(
|
||||
metal::sampler sampler_cmp [[user(fake0)]]
|
||||
, metal::depth2d<float, metal::access::sample> image_2d_depth [[user(fake0)]]
|
||||
, metal::depthcube<float, metal::access::sample> image_cube_depth [[user(fake0)]]
|
||||
@@ -130,7 +130,7 @@ fragment sample_comparisonOutput sample_comparison(
|
||||
float s2d_depth = image_2d_depth.sample_compare(sampler_cmp, tc_1, 0.5);
|
||||
float s2d_depth_level = image_2d_depth.sample_compare(sampler_cmp, tc_1, 0.5);
|
||||
float scube_depth_level = image_cube_depth.sample_compare(sampler_cmp, metal::float3(0.5), 0.5);
|
||||
return sample_comparisonOutput { s2d_depth + s2d_depth_level };
|
||||
return texture_sample_comparisonOutput { s2d_depth + s2d_depth_level };
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using metal::uint;
|
||||
|
||||
struct VertexOutput {
|
||||
metal::float4 position;
|
||||
float varying;
|
||||
float _varying;
|
||||
};
|
||||
struct FragmentOutput {
|
||||
float depth;
|
||||
@@ -28,7 +28,7 @@ struct vertex_Input {
|
||||
};
|
||||
struct vertex_Output {
|
||||
metal::float4 position [[position, invariant]];
|
||||
float varying [[user(loc1), center_perspective]];
|
||||
float _varying [[user(loc1), center_perspective]];
|
||||
float _point_size [[point_size]];
|
||||
};
|
||||
vertex vertex_Output vertex_(
|
||||
@@ -39,12 +39,12 @@ vertex vertex_Output vertex_(
|
||||
const auto color = varyings.color;
|
||||
uint tmp = (vertex_index + instance_index) + color;
|
||||
const auto _tmp = VertexOutput {metal::float4(1.0), static_cast<float>(tmp)};
|
||||
return vertex_Output { _tmp.position, _tmp.varying, 1.0 };
|
||||
return vertex_Output { _tmp.position, _tmp._varying, 1.0 };
|
||||
}
|
||||
|
||||
|
||||
struct fragment_Input {
|
||||
float varying [[user(loc1), center_perspective]];
|
||||
float _varying [[user(loc1), center_perspective]];
|
||||
};
|
||||
struct fragment_Output {
|
||||
float depth [[depth(any)]];
|
||||
@@ -58,10 +58,10 @@ fragment fragment_Output fragment_(
|
||||
, uint sample_index [[sample_id]]
|
||||
, uint sample_mask [[sample_mask]]
|
||||
) {
|
||||
const VertexOutput in = { position, varyings_1.varying };
|
||||
const VertexOutput _in = { position, varyings_1._varying };
|
||||
uint mask = sample_mask & (1u << sample_index);
|
||||
float color_1 = front_facing ? 1.0 : 0.0;
|
||||
const auto _tmp = FragmentOutput {in.varying, mask, color_1};
|
||||
const auto _tmp = FragmentOutput {_in._varying, mask, color_1};
|
||||
return fragment_Output { _tmp.depth, _tmp.sample_mask, _tmp.color };
|
||||
}
|
||||
|
||||
@@ -74,9 +74,9 @@ kernel void compute_(
|
||||
, uint local_index [[thread_index_in_threadgroup]]
|
||||
, metal::uint3 wg_id [[threadgroup_position_in_grid]]
|
||||
, metal::uint3 num_wgs [[threadgroups_per_grid]]
|
||||
, threadgroup type_4& output
|
||||
, threadgroup type_4& _output
|
||||
) {
|
||||
output.inner[0] = (((global_id.x + local_id.x) + local_index) + wg_id.x) + num_wgs.x;
|
||||
_output.inner[0] = (((global_id.x + local_id.x) + local_index) + wg_id.x) + num_wgs.x;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ using metal::uint;
|
||||
|
||||
struct FragmentInput {
|
||||
metal::float4 position;
|
||||
uint flat;
|
||||
float linear;
|
||||
uint _flat;
|
||||
float _linear;
|
||||
metal::float2 linear_centroid;
|
||||
metal::float3 linear_sample;
|
||||
metal::float4 perspective;
|
||||
@@ -17,8 +17,8 @@ struct FragmentInput {
|
||||
|
||||
struct vert_mainOutput {
|
||||
metal::float4 position [[position]];
|
||||
uint flat [[user(loc0), flat]];
|
||||
float linear [[user(loc1), center_no_perspective]];
|
||||
uint _flat [[user(loc0), flat]];
|
||||
float _linear [[user(loc1), center_no_perspective]];
|
||||
metal::float2 linear_centroid [[user(loc2), centroid_no_perspective]];
|
||||
metal::float3 linear_sample [[user(loc3), sample_no_perspective]];
|
||||
metal::float4 perspective [[user(loc4), center_perspective]];
|
||||
@@ -27,24 +27,24 @@ struct vert_mainOutput {
|
||||
};
|
||||
vertex vert_mainOutput vert_main(
|
||||
) {
|
||||
FragmentInput out;
|
||||
out.position = metal::float4(2.0, 4.0, 5.0, 6.0);
|
||||
out.flat = 8u;
|
||||
out.linear = 27.0;
|
||||
out.linear_centroid = metal::float2(64.0, 125.0);
|
||||
out.linear_sample = metal::float3(216.0, 343.0, 512.0);
|
||||
out.perspective = metal::float4(729.0, 1000.0, 1331.0, 1728.0);
|
||||
out.perspective_centroid = 2197.0;
|
||||
out.perspective_sample = 2744.0;
|
||||
FragmentInput _e30 = out;
|
||||
FragmentInput _out;
|
||||
_out.position = metal::float4(2.0, 4.0, 5.0, 6.0);
|
||||
_out._flat = 8u;
|
||||
_out._linear = 27.0;
|
||||
_out.linear_centroid = metal::float2(64.0, 125.0);
|
||||
_out.linear_sample = metal::float3(216.0, 343.0, 512.0);
|
||||
_out.perspective = metal::float4(729.0, 1000.0, 1331.0, 1728.0);
|
||||
_out.perspective_centroid = 2197.0;
|
||||
_out.perspective_sample = 2744.0;
|
||||
FragmentInput _e30 = _out;
|
||||
const auto _tmp = _e30;
|
||||
return vert_mainOutput { _tmp.position, _tmp.flat, _tmp.linear, _tmp.linear_centroid, _tmp.linear_sample, _tmp.perspective, _tmp.perspective_centroid, _tmp.perspective_sample };
|
||||
return vert_mainOutput { _tmp.position, _tmp._flat, _tmp._linear, _tmp.linear_centroid, _tmp.linear_sample, _tmp.perspective, _tmp.perspective_centroid, _tmp.perspective_sample };
|
||||
}
|
||||
|
||||
|
||||
struct frag_mainInput {
|
||||
uint flat [[user(loc0), flat]];
|
||||
float linear [[user(loc1), center_no_perspective]];
|
||||
uint _flat [[user(loc0), flat]];
|
||||
float _linear [[user(loc1), center_no_perspective]];
|
||||
metal::float2 linear_centroid [[user(loc2), centroid_no_perspective]];
|
||||
metal::float3 linear_sample [[user(loc3), sample_no_perspective]];
|
||||
metal::float4 perspective [[user(loc4), center_perspective]];
|
||||
@@ -55,6 +55,6 @@ fragment void frag_main(
|
||||
frag_mainInput varyings_1 [[stage_in]]
|
||||
, metal::float4 position [[position]]
|
||||
) {
|
||||
const FragmentInput val = { position, varyings_1.flat, varyings_1.linear, varyings_1.linear_centroid, varyings_1.linear_sample, varyings_1.perspective, varyings_1.perspective_centroid, varyings_1.perspective_sample };
|
||||
const FragmentInput val = { position, varyings_1._flat, varyings_1._linear, varyings_1.linear_centroid, varyings_1.linear_sample, varyings_1.perspective, varyings_1.perspective_centroid, varyings_1.perspective_sample };
|
||||
return;
|
||||
}
|
||||
@@ -27,11 +27,11 @@ struct vertex_Output {
|
||||
metal::float4 member [[position]];
|
||||
};
|
||||
vertex vertex_Output vertex_(
|
||||
constant Test& input [[buffer(0)]]
|
||||
constant Test& input1_ [[buffer(0)]]
|
||||
, constant Test2_& input2_ [[buffer(1)]]
|
||||
, constant Test3_& input3_ [[buffer(2)]]
|
||||
) {
|
||||
float _e6 = input.b;
|
||||
float _e6 = input1_.b;
|
||||
float _e9 = input2_.b;
|
||||
float _e12 = input3_.b;
|
||||
return vertex_Output { ((metal::float4(1.0) * _e6) * _e9) * _e12 };
|
||||
|
||||
+13
-13
@@ -65,15 +65,15 @@ vertex vs_mainOutput vs_main(
|
||||
) {
|
||||
const auto position = varyings.position;
|
||||
const auto normal = varyings.normal;
|
||||
VertexOutput out;
|
||||
VertexOutput _out;
|
||||
metal::float4x4 w = u_entity.world;
|
||||
metal::float4x4 _e7 = u_entity.world;
|
||||
metal::float4 world_pos = _e7 * static_cast<metal::float4>(position);
|
||||
out.world_normal = metal::float3x3(w[0].xyz, w[1].xyz, w[2].xyz) * static_cast<metal::float3>(normal.xyz);
|
||||
out.world_position = world_pos;
|
||||
_out.world_normal = metal::float3x3(w[0].xyz, w[1].xyz, w[2].xyz) * static_cast<metal::float3>(normal.xyz);
|
||||
_out.world_position = world_pos;
|
||||
metal::float4x4 _e25 = u_globals.view_proj;
|
||||
out.proj_position = _e25 * world_pos;
|
||||
VertexOutput _e27 = out;
|
||||
_out.proj_position = _e25 * world_pos;
|
||||
VertexOutput _e27 = _out;
|
||||
const auto _tmp = _e27;
|
||||
return vs_mainOutput { _tmp.proj_position, _tmp.world_normal, _tmp.world_position };
|
||||
}
|
||||
@@ -96,10 +96,10 @@ fragment fs_mainOutput fs_main(
|
||||
, metal::sampler sampler_shadow [[user(fake0)]]
|
||||
, constant _mslBufferSizes& _buffer_sizes [[user(fake0)]]
|
||||
) {
|
||||
const VertexOutput in = { proj_position, varyings_1.world_normal, varyings_1.world_position };
|
||||
const VertexOutput _in = { proj_position, varyings_1.world_normal, varyings_1.world_position };
|
||||
metal::float3 color = c_ambient;
|
||||
uint i = 0u;
|
||||
metal::float3 normal_1 = metal::normalize(in.world_normal);
|
||||
metal::float3 normal_1 = metal::normalize(_in.world_normal);
|
||||
bool loop_init = true;
|
||||
while(true) {
|
||||
if (!loop_init) {
|
||||
@@ -116,8 +116,8 @@ fragment fs_mainOutput fs_main(
|
||||
uint _e23 = i;
|
||||
Light light = s_lights[_e23];
|
||||
uint _e26 = i;
|
||||
float _e30 = fetch_shadow(_e26, light.proj * in.world_position, t_shadow, sampler_shadow);
|
||||
metal::float3 light_dir = metal::normalize(light.pos.xyz - in.world_position.xyz);
|
||||
float _e30 = fetch_shadow(_e26, light.proj * _in.world_position, t_shadow, sampler_shadow);
|
||||
metal::float3 light_dir = metal::normalize(light.pos.xyz - _in.world_position.xyz);
|
||||
float diffuse = metal::max(0.0, metal::dot(normal_1, light_dir));
|
||||
metal::float3 _e40 = color;
|
||||
color = _e40 + ((_e30 * diffuse) * light.color.xyz);
|
||||
@@ -144,10 +144,10 @@ fragment fs_main_without_storageOutput fs_main_without_storage(
|
||||
, metal::depth2d_array<float, metal::access::sample> t_shadow [[user(fake0)]]
|
||||
, metal::sampler sampler_shadow [[user(fake0)]]
|
||||
) {
|
||||
const VertexOutput in_1 = { proj_position_1, varyings_2.world_normal, varyings_2.world_position };
|
||||
const VertexOutput _in_1 = { proj_position_1, varyings_2.world_normal, varyings_2.world_position };
|
||||
metal::float3 color_1 = c_ambient;
|
||||
uint i_1 = 0u;
|
||||
metal::float3 normal_2 = metal::normalize(in_1.world_normal);
|
||||
metal::float3 normal_2 = metal::normalize(_in_1.world_normal);
|
||||
bool loop_init_1 = true;
|
||||
while(true) {
|
||||
if (!loop_init_1) {
|
||||
@@ -164,8 +164,8 @@ fragment fs_main_without_storageOutput fs_main_without_storage(
|
||||
uint _e23 = i_1;
|
||||
Light light_1 = u_lights.inner[_e23];
|
||||
uint _e26 = i_1;
|
||||
float _e30 = fetch_shadow(_e26, light_1.proj * in_1.world_position, t_shadow, sampler_shadow);
|
||||
metal::float3 light_dir_1 = metal::normalize(light_1.pos.xyz - in_1.world_position.xyz);
|
||||
float _e30 = fetch_shadow(_e26, light_1.proj * _in_1.world_position, t_shadow, sampler_shadow);
|
||||
metal::float3 light_dir_1 = metal::normalize(light_1.pos.xyz - _in_1.world_position.xyz);
|
||||
float diffuse_1 = metal::max(0.0, metal::dot(normal_2, light_dir_1));
|
||||
metal::float3 _e40 = color_1;
|
||||
color_1 = _e40 + ((_e30 * diffuse_1) * light_1.color.xyz);
|
||||
|
||||
@@ -60,7 +60,7 @@ fragment fs_mainOutput fs_main(
|
||||
metal::min_filter::linear,
|
||||
metal::coord::normalized
|
||||
);
|
||||
const VertexOutput in = { position, varyings_1.uv };
|
||||
metal::float4 _e5 = r_texture.sample(r_sampler, in.uv);
|
||||
const VertexOutput _in = { position, varyings_1.uv };
|
||||
metal::float4 _e5 = r_texture.sample(r_sampler, _in.uv);
|
||||
return fs_mainOutput { _e5 };
|
||||
}
|
||||
@@ -14,7 +14,7 @@ OpExecutionMode %204 LocalSize 1 1 1
|
||||
OpSource GLSL 450
|
||||
OpMemberName %32 0 "value"
|
||||
OpName %32 "AlignedWrapper"
|
||||
OpMemberName %41 0 "matrix"
|
||||
OpMemberName %41 0 "_matrix"
|
||||
OpMemberName %41 1 "matrix_array"
|
||||
OpMemberName %41 2 "atom"
|
||||
OpMemberName %41 3 "arr"
|
||||
|
||||
@@ -36,7 +36,7 @@ OpName %92 "coords"
|
||||
OpName %93 "level"
|
||||
OpName %94 "test_textureLoad_3d"
|
||||
OpName %107 "coords"
|
||||
OpName %108 "sample"
|
||||
OpName %108 "_sample"
|
||||
OpName %109 "test_textureLoad_multisampled_2d"
|
||||
OpName %121 "coords"
|
||||
OpName %122 "level"
|
||||
@@ -46,7 +46,7 @@ OpName %138 "index"
|
||||
OpName %139 "level"
|
||||
OpName %140 "test_textureLoad_depth_2d_array"
|
||||
OpName %155 "coords"
|
||||
OpName %156 "sample"
|
||||
OpName %156 "_sample"
|
||||
OpName %157 "test_textureLoad_depth_multisampled_2d"
|
||||
OpName %170 "coords"
|
||||
OpName %171 "value"
|
||||
|
||||
@@ -36,7 +36,7 @@ OpName %103 "coords"
|
||||
OpName %104 "level"
|
||||
OpName %105 "test_textureLoad_3d"
|
||||
OpName %121 "coords"
|
||||
OpName %122 "sample"
|
||||
OpName %122 "_sample"
|
||||
OpName %123 "test_textureLoad_multisampled_2d"
|
||||
OpName %138 "coords"
|
||||
OpName %139 "level"
|
||||
@@ -46,7 +46,7 @@ OpName %158 "index"
|
||||
OpName %159 "level"
|
||||
OpName %160 "test_textureLoad_depth_2d_array"
|
||||
OpName %178 "coords"
|
||||
OpName %179 "sample"
|
||||
OpName %179 "_sample"
|
||||
OpName %180 "test_textureLoad_depth_multisampled_2d"
|
||||
OpName %196 "coords"
|
||||
OpName %197 "value"
|
||||
|
||||
@@ -13,8 +13,8 @@ OpEntryPoint GLCompute %76 "main" %73
|
||||
OpEntryPoint GLCompute %121 "depth_load" %119
|
||||
OpEntryPoint Vertex %142 "queries" %140
|
||||
OpEntryPoint Vertex %194 "levels_queries" %193
|
||||
OpEntryPoint Fragment %223 "sample" %222
|
||||
OpEntryPoint Fragment %252 "sample_comparison" %250
|
||||
OpEntryPoint Fragment %223 "texture_sample" %222
|
||||
OpEntryPoint Fragment %252 "texture_sample_comparison" %250
|
||||
OpEntryPoint Fragment %272 "gather" %271
|
||||
OpEntryPoint Fragment %294 "depth_no_comparison" %293
|
||||
OpExecutionMode %76 LocalSize 16 1 1
|
||||
@@ -49,8 +49,8 @@ OpName %119 "local_id"
|
||||
OpName %121 "depth_load"
|
||||
OpName %142 "queries"
|
||||
OpName %194 "levels_queries"
|
||||
OpName %223 "sample"
|
||||
OpName %252 "sample_comparison"
|
||||
OpName %223 "texture_sample"
|
||||
OpName %252 "texture_sample_comparison"
|
||||
OpName %272 "gather"
|
||||
OpName %294 "depth_no_comparison"
|
||||
OpDecorate %34 DescriptorSet 0
|
||||
|
||||
@@ -11,18 +11,18 @@ OpEntryPoint Fragment %108 "frag_main" %87 %90 %93 %96 %99 %102 %104 %106
|
||||
OpExecutionMode %108 OriginUpperLeft
|
||||
OpSource GLSL 450
|
||||
OpMemberName %25 0 "position"
|
||||
OpMemberName %25 1 "flat"
|
||||
OpMemberName %25 2 "linear"
|
||||
OpMemberName %25 1 "_flat"
|
||||
OpMemberName %25 2 "_linear"
|
||||
OpMemberName %25 3 "linear_centroid"
|
||||
OpMemberName %25 4 "linear_sample"
|
||||
OpMemberName %25 5 "perspective"
|
||||
OpMemberName %25 6 "perspective_centroid"
|
||||
OpMemberName %25 7 "perspective_sample"
|
||||
OpName %25 "FragmentInput"
|
||||
OpName %26 "out"
|
||||
OpName %26 "_out"
|
||||
OpName %29 "position"
|
||||
OpName %31 "flat"
|
||||
OpName %33 "linear"
|
||||
OpName %31 "_flat"
|
||||
OpName %33 "_linear"
|
||||
OpName %35 "linear_centroid"
|
||||
OpName %37 "linear_sample"
|
||||
OpName %39 "perspective"
|
||||
@@ -30,8 +30,8 @@ OpName %40 "perspective_centroid"
|
||||
OpName %41 "perspective_sample"
|
||||
OpName %45 "vert_main"
|
||||
OpName %87 "position"
|
||||
OpName %90 "flat"
|
||||
OpName %93 "linear"
|
||||
OpName %90 "_flat"
|
||||
OpName %93 "_linear"
|
||||
OpName %96 "linear_centroid"
|
||||
OpName %99 "linear_sample"
|
||||
OpName %102 "perspective"
|
||||
|
||||
@@ -18,7 +18,7 @@ OpName %11 "Test2"
|
||||
OpMemberName %13 0 "a"
|
||||
OpMemberName %13 1 "b"
|
||||
OpName %13 "Test3"
|
||||
OpName %15 "input"
|
||||
OpName %15 "input1"
|
||||
OpName %18 "input2"
|
||||
OpName %21 "input3"
|
||||
OpName %27 "vertex"
|
||||
|
||||
@@ -37,7 +37,7 @@ OpName %45 "sampler_shadow"
|
||||
OpName %48 "light_id"
|
||||
OpName %49 "homogeneous_coords"
|
||||
OpName %50 "fetch_shadow"
|
||||
OpName %80 "out"
|
||||
OpName %80 "_out"
|
||||
OpName %83 "position"
|
||||
OpName %86 "normal"
|
||||
OpName %88 "proj_position"
|
||||
|
||||
@@ -3,7 +3,7 @@ struct AlignedWrapper {
|
||||
}
|
||||
|
||||
struct Bar {
|
||||
matrix: mat4x3<f32>,
|
||||
_matrix: mat4x3<f32>,
|
||||
matrix_array: array<mat2x2<f32>,2>,
|
||||
atom: atomic<i32>,
|
||||
arr: array<vec2<u32>,2>,
|
||||
@@ -87,9 +87,9 @@ fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4<f32> {
|
||||
let baz_1 = foo;
|
||||
foo = 1.0;
|
||||
test_matrix_within_struct_accesses();
|
||||
let matrix = bar.matrix;
|
||||
let _matrix = bar._matrix;
|
||||
let arr = bar.arr;
|
||||
let b = bar.matrix[3][0];
|
||||
let b = bar._matrix[3][0];
|
||||
let a_1 = bar.data[(arrayLength((&bar.data)) - 2u)].value;
|
||||
let data_pointer = (&bar.data[0].value);
|
||||
let _e28 = read_from_private((&foo));
|
||||
@@ -98,13 +98,13 @@ fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4<f32> {
|
||||
let value = c[vi];
|
||||
let _e42 = test_arr_as_arg(array<array<f32,10>,5>(array<f32,10>(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), array<f32,10>(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), array<f32,10>(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), array<f32,10>(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), array<f32,10>(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)));
|
||||
unnamed = _e42;
|
||||
return vec4<f32>((matrix * vec4<f32>(vec4<i32>(value))), 2.0);
|
||||
return vec4<f32>((_matrix * vec4<f32>(vec4<i32>(value))), 2.0);
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn foo_frag() -> @location(0) vec4<f32> {
|
||||
bar.matrix[1][2] = 1.0;
|
||||
bar.matrix = mat4x3<f32>(vec3<f32>(0.0), vec3<f32>(1.0), vec3<f32>(2.0), vec3<f32>(3.0));
|
||||
bar._matrix[1][2] = 1.0;
|
||||
bar._matrix = mat4x3<f32>(vec3<f32>(0.0), vec3<f32>(1.0), vec3<f32>(2.0), vec3<f32>(3.0));
|
||||
bar.arr = array<vec2<u32>,2>(vec2<u32>(0u), vec2<u32>(1u));
|
||||
bar.data[1].value = 1;
|
||||
return vec4<f32>(0.0);
|
||||
|
||||
@@ -11,11 +11,11 @@ struct FragmentIn {
|
||||
var<push_constant> pc: PushConstants;
|
||||
|
||||
@fragment
|
||||
fn main(in: FragmentIn) -> @location(0) vec4<f32> {
|
||||
fn main(_in: FragmentIn) -> @location(0) vec4<f32> {
|
||||
let _e4 = pc.index;
|
||||
if (in.primitive_index == _e4) {
|
||||
return in.color;
|
||||
if (_in.primitive_index == _e4) {
|
||||
return _in.color;
|
||||
} else {
|
||||
return vec4<f32>((vec3<f32>(1.0) - in.color.xyz), in.color.w);
|
||||
return vec4<f32>((vec3<f32>(1.0) - _in.color.xyz), _in.color.w);
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ fn levels_queries() -> @builtin(position) vec4<f32> {
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn sample() -> @location(0) vec4<f32> {
|
||||
fn texture_sample() -> @location(0) vec4<f32> {
|
||||
let tc = vec2<f32>(0.5);
|
||||
let s1d = textureSample(image_1d, sampler_reg, tc.x);
|
||||
let s2d = textureSample(image_2d, sampler_reg, tc);
|
||||
@@ -105,7 +105,7 @@ fn sample() -> @location(0) vec4<f32> {
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn sample_comparison() -> @location(0) f32 {
|
||||
fn texture_sample_comparison() -> @location(0) f32 {
|
||||
let tc_1 = vec2<f32>(0.5);
|
||||
let s2d_depth = textureSampleCompare(image_2d_depth, sampler_cmp, tc_1, 0.5);
|
||||
let s2d_depth_level = textureSampleCompareLevel(image_2d_depth, sampler_cmp, tc_1, 0.5);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
struct VertexOutput {
|
||||
@builtin(position) @invariant position: vec4<f32>,
|
||||
@location(1) varying: f32,
|
||||
@location(1) _varying: f32,
|
||||
}
|
||||
|
||||
struct FragmentOutput {
|
||||
@@ -17,7 +17,7 @@ struct Input2_ {
|
||||
@builtin(instance_index) index: u32,
|
||||
}
|
||||
|
||||
var<workgroup> output: array<u32,1>;
|
||||
var<workgroup> _output: array<u32,1>;
|
||||
|
||||
@vertex
|
||||
fn vertex(@builtin(vertex_index) vertex_index: u32, @builtin(instance_index) instance_index: u32, @location(10) color: u32) -> VertexOutput {
|
||||
@@ -26,15 +26,15 @@ fn vertex(@builtin(vertex_index) vertex_index: u32, @builtin(instance_index) ins
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment(in: VertexOutput, @builtin(front_facing) front_facing: bool, @builtin(sample_index) sample_index: u32, @builtin(sample_mask) sample_mask: u32) -> FragmentOutput {
|
||||
fn fragment(_in: VertexOutput, @builtin(front_facing) front_facing: bool, @builtin(sample_index) sample_index: u32, @builtin(sample_mask) sample_mask: u32) -> FragmentOutput {
|
||||
let mask: u32 = (sample_mask & (1u << sample_index));
|
||||
let color_1: f32 = select(0.0, 1.0, front_facing);
|
||||
return FragmentOutput(in.varying, mask, color_1);
|
||||
return FragmentOutput(_in._varying, mask, color_1);
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1, 1, 1)
|
||||
fn compute(@builtin(global_invocation_id) global_id: vec3<u32>, @builtin(local_invocation_id) local_id: vec3<u32>, @builtin(local_invocation_index) local_index: u32, @builtin(workgroup_id) wg_id: vec3<u32>, @builtin(num_workgroups) num_wgs: vec3<u32>) {
|
||||
output[0] = ((((global_id.x + local_id.x) + local_index) + wg_id.x) + num_wgs.x);
|
||||
_output[0] = ((((global_id.x + local_id.x) + local_index) + wg_id.x) + num_wgs.x);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
struct FragmentInput {
|
||||
@builtin(position) position: vec4<f32>,
|
||||
@location(0) flat: u32,
|
||||
@location(1) @interpolate(linear) linear: f32,
|
||||
@location(0) _flat: u32,
|
||||
@location(1) @interpolate(linear) _linear: f32,
|
||||
@location(2) @interpolate(linear, centroid) linear_centroid: vec2<f32>,
|
||||
@location(3) @interpolate(linear, sample) linear_sample: vec3<f32>,
|
||||
@location(4) perspective: vec4<f32>,
|
||||
@@ -11,17 +11,17 @@ struct FragmentInput {
|
||||
|
||||
@vertex
|
||||
fn vert_main() -> FragmentInput {
|
||||
var out: FragmentInput;
|
||||
var _out: FragmentInput;
|
||||
|
||||
out.position = vec4<f32>(2.0, 4.0, 5.0, 6.0);
|
||||
out.flat = 8u;
|
||||
out.linear = 27.0;
|
||||
out.linear_centroid = vec2<f32>(64.0, 125.0);
|
||||
out.linear_sample = vec3<f32>(216.0, 343.0, 512.0);
|
||||
out.perspective = vec4<f32>(729.0, 1000.0, 1331.0, 1728.0);
|
||||
out.perspective_centroid = 2197.0;
|
||||
out.perspective_sample = 2744.0;
|
||||
let _e30 = out;
|
||||
_out.position = vec4<f32>(2.0, 4.0, 5.0, 6.0);
|
||||
_out._flat = 8u;
|
||||
_out._linear = 27.0;
|
||||
_out.linear_centroid = vec2<f32>(64.0, 125.0);
|
||||
_out.linear_sample = vec3<f32>(216.0, 343.0, 512.0);
|
||||
_out.perspective = vec4<f32>(729.0, 1000.0, 1331.0, 1728.0);
|
||||
_out.perspective_centroid = 2197.0;
|
||||
_out.perspective_sample = 2744.0;
|
||||
let _e30 = _out;
|
||||
return _e30;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ struct Test3_ {
|
||||
}
|
||||
|
||||
@group(0) @binding(0)
|
||||
var<uniform> input: Test;
|
||||
var<uniform> input1_: Test;
|
||||
@group(0) @binding(1)
|
||||
var<uniform> input2_: Test2_;
|
||||
@group(0) @binding(2)
|
||||
@@ -26,7 +26,7 @@ var<uniform> input3_: Test3_;
|
||||
|
||||
@vertex
|
||||
fn vertex() -> @builtin(position) vec4<f32> {
|
||||
let _e6 = input.b;
|
||||
let _e6 = input1_.b;
|
||||
let _e9 = input2_.b;
|
||||
let _e12 = input3_.b;
|
||||
return (((vec4<f32>(1.0) * _e6) * _e9) * _e12);
|
||||
|
||||
+13
-13
@@ -49,25 +49,25 @@ fn fetch_shadow(light_id: u32, homogeneous_coords: vec4<f32>) -> f32 {
|
||||
|
||||
@vertex
|
||||
fn vs_main(@location(0) position: vec4<i32>, @location(1) normal: vec4<i32>) -> VertexOutput {
|
||||
var out: VertexOutput;
|
||||
var _out: VertexOutput;
|
||||
|
||||
let w = u_entity.world;
|
||||
let _e7 = u_entity.world;
|
||||
let world_pos = (_e7 * vec4<f32>(position));
|
||||
out.world_normal = (mat3x3<f32>(w[0].xyz, w[1].xyz, w[2].xyz) * vec3<f32>(normal.xyz));
|
||||
out.world_position = world_pos;
|
||||
_out.world_normal = (mat3x3<f32>(w[0].xyz, w[1].xyz, w[2].xyz) * vec3<f32>(normal.xyz));
|
||||
_out.world_position = world_pos;
|
||||
let _e25 = u_globals.view_proj;
|
||||
out.proj_position = (_e25 * world_pos);
|
||||
let _e27 = out;
|
||||
_out.proj_position = (_e25 * world_pos);
|
||||
let _e27 = _out;
|
||||
return _e27;
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
fn fs_main(_in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
var color: vec3<f32> = vec3<f32>(0.05000000074505806, 0.05000000074505806, 0.05000000074505806);
|
||||
var i: u32 = 0u;
|
||||
|
||||
let normal_1 = normalize(in.world_normal);
|
||||
let normal_1 = normalize(_in.world_normal);
|
||||
loop {
|
||||
let _e14 = i;
|
||||
let _e17 = u_globals.num_lights.x;
|
||||
@@ -78,8 +78,8 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let _e23 = i;
|
||||
let light = s_lights[_e23];
|
||||
let _e26 = i;
|
||||
let _e30 = fetch_shadow(_e26, (light.proj * in.world_position));
|
||||
let light_dir = normalize((light.pos.xyz - in.world_position.xyz));
|
||||
let _e30 = fetch_shadow(_e26, (light.proj * _in.world_position));
|
||||
let light_dir = normalize((light.pos.xyz - _in.world_position.xyz));
|
||||
let diffuse = max(0.0, dot(normal_1, light_dir));
|
||||
let _e40 = color;
|
||||
color = (_e40 + ((_e30 * diffuse) * light.color.xyz));
|
||||
@@ -94,11 +94,11 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fs_main_without_storage(in_1: VertexOutput) -> @location(0) vec4<f32> {
|
||||
fn fs_main_without_storage(_in_1: VertexOutput) -> @location(0) vec4<f32> {
|
||||
var color_1: vec3<f32> = vec3<f32>(0.05000000074505806, 0.05000000074505806, 0.05000000074505806);
|
||||
var i_1: u32 = 0u;
|
||||
|
||||
let normal_2 = normalize(in_1.world_normal);
|
||||
let normal_2 = normalize(_in_1.world_normal);
|
||||
loop {
|
||||
let _e14 = i_1;
|
||||
let _e17 = u_globals.num_lights.x;
|
||||
@@ -109,8 +109,8 @@ fn fs_main_without_storage(in_1: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let _e23 = i_1;
|
||||
let light_1 = u_lights[_e23];
|
||||
let _e26 = i_1;
|
||||
let _e30 = fetch_shadow(_e26, (light_1.proj * in_1.world_position));
|
||||
let light_dir_1 = normalize((light_1.pos.xyz - in_1.world_position.xyz));
|
||||
let _e30 = fetch_shadow(_e26, (light_1.proj * _in_1.world_position));
|
||||
let light_dir_1 = normalize((light_1.pos.xyz - _in_1.world_position.xyz));
|
||||
let diffuse_1 = max(0.0, dot(normal_2, light_dir_1));
|
||||
let _e40 = color_1;
|
||||
color_1 = (_e40 + ((_e30 * diffuse_1) * light_1.color.xyz));
|
||||
|
||||
@@ -35,7 +35,7 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VertexOutput {
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let _e5 = textureSample(r_texture, r_sampler, in.uv);
|
||||
fn fs_main(_in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let _e5 = textureSample(r_texture, r_sampler, _in.uv);
|
||||
return _e5;
|
||||
}
|
||||
+13
-13
@@ -1012,8 +1012,8 @@ fn missing_bindings() {
|
||||
check_validation_error! {
|
||||
"
|
||||
@vertex
|
||||
fn vertex(input: vec4<f32>) -> @location(0) vec4<f32> {
|
||||
return input;
|
||||
fn vertex(_input: vec4<f32>) -> @location(0) vec4<f32> {
|
||||
return _input;
|
||||
}
|
||||
":
|
||||
Err(naga::valid::ValidationError::EntryPoint {
|
||||
@@ -1029,8 +1029,8 @@ fn missing_bindings() {
|
||||
check_validation_error! {
|
||||
"
|
||||
@vertex
|
||||
fn vertex(@location(0) input: vec4<f32>, more_input: f32) -> @location(0) vec4<f32> {
|
||||
return input + more_input;
|
||||
fn vertex(@location(0) _input: vec4<f32>, more_input: f32) -> @location(0) vec4<f32> {
|
||||
return _input + more_input;
|
||||
}
|
||||
":
|
||||
Err(naga::valid::ValidationError::EntryPoint {
|
||||
@@ -1046,8 +1046,8 @@ fn missing_bindings() {
|
||||
check_validation_error! {
|
||||
"
|
||||
@vertex
|
||||
fn vertex(@location(0) input: vec4<f32>) -> vec4<f32> {
|
||||
return input;
|
||||
fn vertex(@location(0) _input: vec4<f32>) -> vec4<f32> {
|
||||
return _input;
|
||||
}
|
||||
":
|
||||
Err(naga::valid::ValidationError::EntryPoint {
|
||||
@@ -1067,8 +1067,8 @@ fn missing_bindings() {
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex(input: VertexIn) -> @location(0) vec4<f32> {
|
||||
return input.pos;
|
||||
fn vertex(_input: VertexIn) -> @location(0) vec4<f32> {
|
||||
return _input.pos;
|
||||
}
|
||||
":
|
||||
Err(naga::valid::ValidationError::EntryPoint {
|
||||
@@ -1213,13 +1213,13 @@ fn invalid_runtime_sized_arrays() {
|
||||
|
||||
struct Outer {
|
||||
legit: i32,
|
||||
unsized: Unsized
|
||||
_unsized: Unsized
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage> outer: Outer;
|
||||
|
||||
fn fetch(i: i32) -> f32 {
|
||||
return outer.unsized.arr[i];
|
||||
return outer._unsized.arr[i];
|
||||
}
|
||||
":
|
||||
Err(naga::valid::ValidationError::Type {
|
||||
@@ -1227,7 +1227,7 @@ fn invalid_runtime_sized_arrays() {
|
||||
error: naga::valid::TypeError::InvalidDynamicArray(member_name, _),
|
||||
..
|
||||
})
|
||||
if struct_name == "Outer" && member_name == "unsized"
|
||||
if struct_name == "Outer" && member_name == "_unsized"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1238,8 +1238,8 @@ fn select() {
|
||||
fn select_pointers(which: bool) -> i32 {
|
||||
var x: i32 = 1;
|
||||
var y: i32 = 2;
|
||||
let ptr = select(&x, &y, which);
|
||||
return *ptr;
|
||||
let p = select(&x, &y, which);
|
||||
return *p;
|
||||
}
|
||||
",
|
||||
"
|
||||
|
||||
Reference in new issue
Block a user