update spirv-cross (#6881)
This commit is contained in:
+8
-4
@@ -14,15 +14,15 @@ jobs:
|
||||
name: "Build ${{ matrix.platform }}"
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [windows-latest, ubuntu-18.04, ubuntu-20.04, macos-latest]
|
||||
platform: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-latest]
|
||||
env:
|
||||
PARALLEL: -j 2
|
||||
|
||||
runs-on: "${{ matrix.platform }}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
@@ -50,6 +50,10 @@ jobs:
|
||||
cmake --build . --config Release
|
||||
cmake --build . --config Release --target install
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.platform }}-binaries
|
||||
path: build/output
|
||||
- name: Test SPIRV-Cross
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/build
|
||||
@@ -60,7 +64,7 @@ jobs:
|
||||
container: khronosgroup/docker-images:asciidoctor-spec
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# REUSE license checker
|
||||
- name: license-check
|
||||
|
||||
+12
-6
@@ -242,7 +242,19 @@ set(spirv-cross-util-sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.hpp)
|
||||
|
||||
set(spirv-cross-abi-major 0)
|
||||
set(spirv-cross-abi-minor 57)
|
||||
set(spirv-cross-abi-patch 0)
|
||||
set(SPIRV_CROSS_VERSION ${spirv-cross-abi-major}.${spirv-cross-abi-minor}.${spirv-cross-abi-patch})
|
||||
|
||||
if (SPIRV_CROSS_STATIC)
|
||||
if (NOT SPIRV_CROSS_SKIP_INSTALL)
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pkg-config/spirv-cross-c.pc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/spirv-cross-c.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/spirv-cross-c.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
endif()
|
||||
|
||||
spirv_cross_add_library(spirv-cross-core spirv_cross_core STATIC
|
||||
${spirv-cross-core-sources})
|
||||
|
||||
@@ -331,13 +343,7 @@ if (SPIRV_CROSS_STATIC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(spirv-cross-abi-major 0)
|
||||
set(spirv-cross-abi-minor 56)
|
||||
set(spirv-cross-abi-patch 0)
|
||||
|
||||
if (SPIRV_CROSS_SHARED)
|
||||
set(SPIRV_CROSS_VERSION ${spirv-cross-abi-major}.${spirv-cross-abi-minor}.${spirv-cross-abi-patch})
|
||||
|
||||
if (NOT SPIRV_CROSS_SKIP_INSTALL)
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pkg-config/spirv-cross-c-shared.pc.in
|
||||
|
||||
Vendored
+4
@@ -732,6 +732,7 @@ struct CLIArguments
|
||||
bool hlsl_nonwritable_uav_texture_as_srv = false;
|
||||
bool hlsl_enable_16bit_types = false;
|
||||
bool hlsl_flatten_matrix_vertex_input_semantics = false;
|
||||
bool hlsl_preserve_structured_buffers = false;
|
||||
HLSLBindingFlags hlsl_binding_flags = 0;
|
||||
bool vulkan_semantics = false;
|
||||
bool flatten_multidimensional_arrays = false;
|
||||
@@ -839,6 +840,7 @@ static void print_help_hlsl()
|
||||
"\t\tOpName reflection information must be intact.\n"
|
||||
"\t[--hlsl-enable-16bit-types]:\n\t\tEnables native use of half/int16_t/uint16_t and ByteAddressBuffer interaction with these types. Requires SM 6.2.\n"
|
||||
"\t[--hlsl-flatten-matrix-vertex-input-semantics]:\n\t\tEmits matrix vertex inputs with input semantics as if they were independent vectors, e.g. TEXCOORD{2,3,4} rather than matrix form TEXCOORD2_{0,1,2}.\n"
|
||||
"\t[--hlsl-preserve-structured-buffers]:\n\t\tEmit SturucturedBuffer<T> rather than ByteAddressBuffer. Requires UserTypeGOOGLE to be emitted. Intended for DXC roundtrips.\n"
|
||||
);
|
||||
// clang-format on
|
||||
}
|
||||
@@ -1421,6 +1423,7 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
|
||||
hlsl_opts.nonwritable_uav_texture_as_srv = args.hlsl_nonwritable_uav_texture_as_srv;
|
||||
hlsl_opts.enable_16bit_types = args.hlsl_enable_16bit_types;
|
||||
hlsl_opts.flatten_matrix_vertex_input_semantics = args.hlsl_flatten_matrix_vertex_input_semantics;
|
||||
hlsl_opts.preserve_structured_buffers = args.hlsl_preserve_structured_buffers;
|
||||
hlsl->set_hlsl_options(hlsl_opts);
|
||||
hlsl->set_resource_binding_flags(args.hlsl_binding_flags);
|
||||
if (args.hlsl_base_vertex_index_explicit_binding)
|
||||
@@ -1622,6 +1625,7 @@ static int main_inner(int argc, char *argv[])
|
||||
cbs.add("--hlsl-enable-16bit-types", [&args](CLIParser &) { args.hlsl_enable_16bit_types = true; });
|
||||
cbs.add("--hlsl-flatten-matrix-vertex-input-semantics",
|
||||
[&args](CLIParser &) { args.hlsl_flatten_matrix_vertex_input_semantics = true; });
|
||||
cbs.add("--hlsl-preserve-structured-buffers", [&args](CLIParser &) { args.hlsl_preserve_structured_buffers = true; });
|
||||
cbs.add("--vulkan-semantics", [&args](CLIParser &) { args.vulkan_semantics = true; });
|
||||
cbs.add("-V", [&args](CLIParser &) { args.vulkan_semantics = true; });
|
||||
cbs.add("--flatten-multidimensional-arrays", [&args](CLIParser &) { args.flatten_multidimensional_arrays = true; });
|
||||
|
||||
@@ -8,7 +8,7 @@ sharedlibdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/spirv_cross
|
||||
|
||||
Name: spirv-cross-c-shared
|
||||
Description: C API for SPIRV-Cross
|
||||
Description: C API for SPIRV-Cross (shared)
|
||||
Version: @SPIRV_CROSS_VERSION@
|
||||
|
||||
Requires:
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright 2020-2021 Hans-Kristian Arntzen
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/spirv_cross
|
||||
|
||||
Name: spirv-cross-c
|
||||
Description: C API for SPIRV-Cross (static)
|
||||
Version: @SPIRV_CROSS_VERSION@
|
||||
|
||||
Requires:
|
||||
Libs: -L${libdir} -lspirv-cross-c
|
||||
Cflags: -I${includedir}
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
RWByteAddressBuffer _4 : register(u0);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uint _21 = _4.Load(_4.Load(0) * 4 + 4);
|
||||
for (uint _23 = 0u; _23 < 64u; )
|
||||
{
|
||||
_4.Store(_23 * 4 + 4, 0u);
|
||||
_23++;
|
||||
continue;
|
||||
}
|
||||
_4.Store(_4.Load(0) * 4 + 4, _21);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
RWByteAddressBuffer u0_counter : register(u1);
|
||||
RWBuffer<uint> u0 : register(u0);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uint _29;
|
||||
u0_counter.InterlockedAdd(0, -1, _29);
|
||||
u0[asint(asfloat(_29))] = uint(int(gl_GlobalInvocationID.x)).x;
|
||||
}
|
||||
|
||||
[numthreads(4, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
RWByteAddressBuffer u0_counter : register(u1);
|
||||
RWBuffer<uint> u0 : register(u0);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uint _29;
|
||||
u0_counter.InterlockedAdd(0, 1, _29);
|
||||
u0[asint(asfloat(_29))] = uint(int(gl_GlobalInvocationID.x)).x;
|
||||
}
|
||||
|
||||
[numthreads(4, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
RWByteAddressBuffer _5 : register(u0);
|
||||
RWByteAddressBuffer _6 : register(u1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_6.Store4(0, uint4(bool4(int(_5.Load4(16).x) < int4(_5.Load4(0)).x, int(_5.Load4(16).y) < int4(_5.Load4(0)).y, int(_5.Load4(16).z) < int4(_5.Load4(0)).z, int(_5.Load4(16).w) < int4(_5.Load4(0)).w)));
|
||||
_6.Store4(0, uint4(bool4(int(_5.Load4(16).x) <= int4(_5.Load4(0)).x, int(_5.Load4(16).y) <= int4(_5.Load4(0)).y, int(_5.Load4(16).z) <= int4(_5.Load4(0)).z, int(_5.Load4(16).w) <= int4(_5.Load4(0)).w)));
|
||||
_6.Store4(0, uint4(bool4(_5.Load4(16).x < uint(int4(_5.Load4(0)).x), _5.Load4(16).y < uint(int4(_5.Load4(0)).y), _5.Load4(16).z < uint(int4(_5.Load4(0)).z), _5.Load4(16).w < uint(int4(_5.Load4(0)).w))));
|
||||
_6.Store4(0, uint4(bool4(_5.Load4(16).x <= uint(int4(_5.Load4(0)).x), _5.Load4(16).y <= uint(int4(_5.Load4(0)).y), _5.Load4(16).z <= uint(int4(_5.Load4(0)).z), _5.Load4(16).w <= uint(int4(_5.Load4(0)).w))));
|
||||
_6.Store4(0, uint4(bool4(int(_5.Load4(16).x) > int4(_5.Load4(0)).x, int(_5.Load4(16).y) > int4(_5.Load4(0)).y, int(_5.Load4(16).z) > int4(_5.Load4(0)).z, int(_5.Load4(16).w) > int4(_5.Load4(0)).w)));
|
||||
_6.Store4(0, uint4(bool4(int(_5.Load4(16).x) >= int4(_5.Load4(0)).x, int(_5.Load4(16).y) >= int4(_5.Load4(0)).y, int(_5.Load4(16).z) >= int4(_5.Load4(0)).z, int(_5.Load4(16).w) >= int4(_5.Load4(0)).w)));
|
||||
_6.Store4(0, uint4(bool4(_5.Load4(16).x > uint(int4(_5.Load4(0)).x), _5.Load4(16).y > uint(int4(_5.Load4(0)).y), _5.Load4(16).z > uint(int4(_5.Load4(0)).z), _5.Load4(16).w > uint(int4(_5.Load4(0)).w))));
|
||||
_6.Store4(0, uint4(bool4(_5.Load4(16).x >= uint(int4(_5.Load4(0)).x), _5.Load4(16).y >= uint(int4(_5.Load4(0)).y), _5.Load4(16).z >= uint(int4(_5.Load4(0)).z), _5.Load4(16).w >= uint(int4(_5.Load4(0)).w))));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
struct A
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
};
|
||||
|
||||
RWByteAddressBuffer C1 : register(u1);
|
||||
cbuffer C2 : register(b2)
|
||||
{
|
||||
A C2_1_Data[1024] : packoffset(c0);
|
||||
};
|
||||
|
||||
RWByteAddressBuffer C3 : register(u0);
|
||||
cbuffer B : register(b3)
|
||||
{
|
||||
A C4_Data[1024] : packoffset(c0);
|
||||
};
|
||||
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
C1.Store(gl_GlobalInvocationID.x * 8 + 0, uint(C2_1_Data[gl_GlobalInvocationID.x].a));
|
||||
C1.Store(gl_GlobalInvocationID.x * 8 + 4, uint(C2_1_Data[gl_GlobalInvocationID.x].b));
|
||||
C3.Store(gl_GlobalInvocationID.x * 8 + 0, uint(C4_Data[gl_GlobalInvocationID.x].a));
|
||||
C3.Store(gl_GlobalInvocationID.x * 8 + 4, uint(C4_Data[gl_GlobalInvocationID.x].b));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
RWByteAddressBuffer bar : register(u0);
|
||||
RWByteAddressBuffer foo : register(u1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
bar.Store4(0, asuint(asfloat(foo.Load4(0))));
|
||||
bar.Store4(16, asuint(asfloat(foo.Load4(16))));
|
||||
bar.Store4(32, asuint(asfloat(foo.Load4(32))));
|
||||
bar.Store4(48, asuint(asfloat(foo.Load4(48))));
|
||||
bar.Store4(64, asuint(asfloat(foo.Load4(64))));
|
||||
bar.Store4(80, asuint(asfloat(foo.Load4(80))));
|
||||
bar.Store4(96, asuint(asfloat(foo.Load4(96))));
|
||||
bar.Store4(112, asuint(asfloat(foo.Load4(112))));
|
||||
bar.Store4(128, asuint(asfloat(foo.Load4(128))));
|
||||
bar.Store4(144, asuint(asfloat(foo.Load4(144))));
|
||||
bar.Store4(160, asuint(asfloat(foo.Load4(160))));
|
||||
bar.Store4(176, asuint(asfloat(foo.Load4(176))));
|
||||
bar.Store4(192, asuint(asfloat(foo.Load4(192))));
|
||||
bar.Store4(208, asuint(asfloat(foo.Load4(208))));
|
||||
bar.Store4(224, asuint(asfloat(foo.Load4(224))));
|
||||
bar.Store4(240, asuint(asfloat(foo.Load4(240))));
|
||||
[loop]
|
||||
for (int _137 = 0; _137 < 16; )
|
||||
{
|
||||
bar.Store4((15 - _137) * 16 + 0, asuint(asfloat(foo.Load4(_137 * 16 + 0))));
|
||||
_137++;
|
||||
continue;
|
||||
}
|
||||
[branch]
|
||||
if (asfloat(bar.Load(160)) > 10.0f)
|
||||
{
|
||||
foo.Store4(320, asuint(5.0f.xxxx));
|
||||
}
|
||||
foo.Store4(320, asuint(20.0f.xxxx));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
void comp_main()
|
||||
{
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
RWByteAddressBuffer _4 : register(u0);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_4.Store(0, asuint(isnan(asfloat(_4.Load(96))) ? asfloat(_4.Load(48)) : (isnan(asfloat(_4.Load(48))) ? asfloat(_4.Load(96)) : min(asfloat(_4.Load(48)), asfloat(_4.Load(96))))));
|
||||
bool2 _146 = isnan(asfloat(_4.Load2(56)));
|
||||
bool2 _147 = isnan(asfloat(_4.Load2(104)));
|
||||
float2 _148 = min(asfloat(_4.Load2(56)), asfloat(_4.Load2(104)));
|
||||
float2 _149 = float2(_146.x ? asfloat(_4.Load2(104)).x : _148.x, _146.y ? asfloat(_4.Load2(104)).y : _148.y);
|
||||
_4.Store2(8, asuint(float2(_147.x ? asfloat(_4.Load2(56)).x : _149.x, _147.y ? asfloat(_4.Load2(56)).y : _149.y)));
|
||||
bool3 _151 = isnan(asfloat(_4.Load3(64)));
|
||||
bool3 _152 = isnan(asfloat(_4.Load3(112)));
|
||||
float3 _153 = min(asfloat(_4.Load3(64)), asfloat(_4.Load3(112)));
|
||||
float3 _154 = float3(_151.x ? asfloat(_4.Load3(112)).x : _153.x, _151.y ? asfloat(_4.Load3(112)).y : _153.y, _151.z ? asfloat(_4.Load3(112)).z : _153.z);
|
||||
_4.Store3(16, asuint(float3(_152.x ? asfloat(_4.Load3(64)).x : _154.x, _152.y ? asfloat(_4.Load3(64)).y : _154.y, _152.z ? asfloat(_4.Load3(64)).z : _154.z)));
|
||||
bool4 _156 = isnan(asfloat(_4.Load4(80)));
|
||||
bool4 _157 = isnan(asfloat(_4.Load4(128)));
|
||||
float4 _158 = min(asfloat(_4.Load4(80)), asfloat(_4.Load4(128)));
|
||||
float4 _159 = float4(_156.x ? asfloat(_4.Load4(128)).x : _158.x, _156.y ? asfloat(_4.Load4(128)).y : _158.y, _156.z ? asfloat(_4.Load4(128)).z : _158.z, _156.w ? asfloat(_4.Load4(128)).w : _158.w);
|
||||
_4.Store4(32, asuint(float4(_157.x ? asfloat(_4.Load4(80)).x : _159.x, _157.y ? asfloat(_4.Load4(80)).y : _159.y, _157.z ? asfloat(_4.Load4(80)).z : _159.z, _157.w ? asfloat(_4.Load4(80)).w : _159.w)));
|
||||
_4.Store(0, asuint(isnan(asfloat(_4.Load(96))) ? asfloat(_4.Load(48)) : (isnan(asfloat(_4.Load(48))) ? asfloat(_4.Load(96)) : max(asfloat(_4.Load(48)), asfloat(_4.Load(96))))));
|
||||
bool2 _166 = isnan(asfloat(_4.Load2(56)));
|
||||
bool2 _167 = isnan(asfloat(_4.Load2(104)));
|
||||
float2 _168 = max(asfloat(_4.Load2(56)), asfloat(_4.Load2(104)));
|
||||
float2 _169 = float2(_166.x ? asfloat(_4.Load2(104)).x : _168.x, _166.y ? asfloat(_4.Load2(104)).y : _168.y);
|
||||
_4.Store2(8, asuint(float2(_167.x ? asfloat(_4.Load2(56)).x : _169.x, _167.y ? asfloat(_4.Load2(56)).y : _169.y)));
|
||||
bool3 _171 = isnan(asfloat(_4.Load3(64)));
|
||||
bool3 _172 = isnan(asfloat(_4.Load3(112)));
|
||||
float3 _173 = max(asfloat(_4.Load3(64)), asfloat(_4.Load3(112)));
|
||||
float3 _174 = float3(_171.x ? asfloat(_4.Load3(112)).x : _173.x, _171.y ? asfloat(_4.Load3(112)).y : _173.y, _171.z ? asfloat(_4.Load3(112)).z : _173.z);
|
||||
_4.Store3(16, asuint(float3(_172.x ? asfloat(_4.Load3(64)).x : _174.x, _172.y ? asfloat(_4.Load3(64)).y : _174.y, _172.z ? asfloat(_4.Load3(64)).z : _174.z)));
|
||||
bool4 _176 = isnan(asfloat(_4.Load4(80)));
|
||||
bool4 _177 = isnan(asfloat(_4.Load4(128)));
|
||||
float4 _178 = max(asfloat(_4.Load4(80)), asfloat(_4.Load4(128)));
|
||||
float4 _179 = float4(_176.x ? asfloat(_4.Load4(128)).x : _178.x, _176.y ? asfloat(_4.Load4(128)).y : _178.y, _176.z ? asfloat(_4.Load4(128)).z : _178.z, _176.w ? asfloat(_4.Load4(128)).w : _178.w);
|
||||
_4.Store4(32, asuint(float4(_177.x ? asfloat(_4.Load4(80)).x : _179.x, _177.y ? asfloat(_4.Load4(80)).y : _179.y, _177.z ? asfloat(_4.Load4(80)).z : _179.z, _177.w ? asfloat(_4.Load4(80)).w : _179.w)));
|
||||
float _180 = isnan(asfloat(_4.Load(48))) ? asfloat(_4.Load(0)) : (isnan(asfloat(_4.Load(0))) ? asfloat(_4.Load(48)) : max(asfloat(_4.Load(0)), asfloat(_4.Load(48))));
|
||||
_4.Store(0, asuint(isnan(asfloat(_4.Load(96))) ? _180 : (isnan(_180) ? asfloat(_4.Load(96)) : min(_180, asfloat(_4.Load(96))))));
|
||||
bool2 _193 = isnan(asfloat(_4.Load2(8)));
|
||||
bool2 _194 = isnan(asfloat(_4.Load2(56)));
|
||||
float2 _195 = max(asfloat(_4.Load2(8)), asfloat(_4.Load2(56)));
|
||||
float2 _196 = float2(_193.x ? asfloat(_4.Load2(56)).x : _195.x, _193.y ? asfloat(_4.Load2(56)).y : _195.y);
|
||||
float2 _191 = float2(_194.x ? asfloat(_4.Load2(8)).x : _196.x, _194.y ? asfloat(_4.Load2(8)).y : _196.y);
|
||||
bool2 _198 = isnan(_191);
|
||||
bool2 _199 = isnan(asfloat(_4.Load2(104)));
|
||||
float2 _200 = min(_191, asfloat(_4.Load2(104)));
|
||||
float2 _201 = float2(_198.x ? asfloat(_4.Load2(104)).x : _200.x, _198.y ? asfloat(_4.Load2(104)).y : _200.y);
|
||||
_4.Store2(8, asuint(float2(_199.x ? _191.x : _201.x, _199.y ? _191.y : _201.y)));
|
||||
bool3 _204 = isnan(asfloat(_4.Load3(16)));
|
||||
bool3 _205 = isnan(asfloat(_4.Load3(64)));
|
||||
float3 _206 = max(asfloat(_4.Load3(16)), asfloat(_4.Load3(64)));
|
||||
float3 _207 = float3(_204.x ? asfloat(_4.Load3(64)).x : _206.x, _204.y ? asfloat(_4.Load3(64)).y : _206.y, _204.z ? asfloat(_4.Load3(64)).z : _206.z);
|
||||
float3 _202 = float3(_205.x ? asfloat(_4.Load3(16)).x : _207.x, _205.y ? asfloat(_4.Load3(16)).y : _207.y, _205.z ? asfloat(_4.Load3(16)).z : _207.z);
|
||||
bool3 _209 = isnan(_202);
|
||||
bool3 _210 = isnan(asfloat(_4.Load3(112)));
|
||||
float3 _211 = min(_202, asfloat(_4.Load3(112)));
|
||||
float3 _212 = float3(_209.x ? asfloat(_4.Load3(112)).x : _211.x, _209.y ? asfloat(_4.Load3(112)).y : _211.y, _209.z ? asfloat(_4.Load3(112)).z : _211.z);
|
||||
_4.Store3(16, asuint(float3(_210.x ? _202.x : _212.x, _210.y ? _202.y : _212.y, _210.z ? _202.z : _212.z)));
|
||||
bool4 _215 = isnan(asfloat(_4.Load4(32)));
|
||||
bool4 _216 = isnan(asfloat(_4.Load4(80)));
|
||||
float4 _217 = max(asfloat(_4.Load4(32)), asfloat(_4.Load4(80)));
|
||||
float4 _218 = float4(_215.x ? asfloat(_4.Load4(80)).x : _217.x, _215.y ? asfloat(_4.Load4(80)).y : _217.y, _215.z ? asfloat(_4.Load4(80)).z : _217.z, _215.w ? asfloat(_4.Load4(80)).w : _217.w);
|
||||
float4 _213 = float4(_216.x ? asfloat(_4.Load4(32)).x : _218.x, _216.y ? asfloat(_4.Load4(32)).y : _218.y, _216.z ? asfloat(_4.Load4(32)).z : _218.z, _216.w ? asfloat(_4.Load4(32)).w : _218.w);
|
||||
bool4 _220 = isnan(_213);
|
||||
bool4 _221 = isnan(asfloat(_4.Load4(128)));
|
||||
float4 _222 = min(_213, asfloat(_4.Load4(128)));
|
||||
float4 _223 = float4(_220.x ? asfloat(_4.Load4(128)).x : _222.x, _220.y ? asfloat(_4.Load4(128)).y : _222.y, _220.z ? asfloat(_4.Load4(128)).z : _222.z, _220.w ? asfloat(_4.Load4(128)).w : _222.w);
|
||||
_4.Store4(32, asuint(float4(_221.x ? _213.x : _223.x, _221.y ? _213.y : _223.y, _221.z ? _213.z : _223.z, _221.w ? _213.w : _223.w)));
|
||||
for (int _139 = 0; _139 < 2; )
|
||||
{
|
||||
bool2 _225 = isnan(asfloat(_4.Load2(56)));
|
||||
bool2 _226 = isnan(asfloat(_4.Load2(104)));
|
||||
float2 _227 = min(asfloat(_4.Load2(56)), asfloat(_4.Load2(104)));
|
||||
float2 _228 = float2(_225.x ? asfloat(_4.Load2(104)).x : _227.x, _225.y ? asfloat(_4.Load2(104)).y : _227.y);
|
||||
_4.Store2(8, asuint(float2(_226.x ? asfloat(_4.Load2(56)).x : _228.x, _226.y ? asfloat(_4.Load2(56)).y : _228.y)));
|
||||
float _229 = isnan(asfloat(_4.Load(56))) ? asfloat(_4.Load(0)) : (isnan(asfloat(_4.Load(0))) ? asfloat(_4.Load(56)) : max(asfloat(_4.Load(0)), asfloat(_4.Load(56))));
|
||||
_4.Store(0, asuint(isnan(asfloat(_4.Load(60))) ? _229 : (isnan(_229) ? asfloat(_4.Load(60)) : min(_229, asfloat(_4.Load(60))))));
|
||||
_139++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
RWByteAddressBuffer _4 : register(u0);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_4.Store(0, asuint(min(asfloat(_4.Load(48)), asfloat(_4.Load(96)))));
|
||||
_4.Store2(8, asuint(min(asfloat(_4.Load2(56)), asfloat(_4.Load2(104)))));
|
||||
_4.Store3(16, asuint(min(asfloat(_4.Load3(64)), asfloat(_4.Load3(112)))));
|
||||
_4.Store4(32, asuint(min(asfloat(_4.Load4(80)), asfloat(_4.Load4(128)))));
|
||||
_4.Store(0, asuint(max(asfloat(_4.Load(48)), asfloat(_4.Load(96)))));
|
||||
_4.Store2(8, asuint(max(asfloat(_4.Load2(56)), asfloat(_4.Load2(104)))));
|
||||
_4.Store3(16, asuint(max(asfloat(_4.Load3(64)), asfloat(_4.Load3(112)))));
|
||||
_4.Store4(32, asuint(max(asfloat(_4.Load4(80)), asfloat(_4.Load4(128)))));
|
||||
_4.Store(0, asuint(clamp(asfloat(_4.Load(0)), asfloat(_4.Load(48)), asfloat(_4.Load(96)))));
|
||||
_4.Store2(8, asuint(clamp(asfloat(_4.Load2(8)), asfloat(_4.Load2(56)), asfloat(_4.Load2(104)))));
|
||||
_4.Store3(16, asuint(clamp(asfloat(_4.Load3(16)), asfloat(_4.Load3(64)), asfloat(_4.Load3(112)))));
|
||||
_4.Store4(32, asuint(clamp(asfloat(_4.Load4(32)), asfloat(_4.Load4(80)), asfloat(_4.Load4(128)))));
|
||||
for (int _139 = 0; _139 < 2; )
|
||||
{
|
||||
_4.Store2(8, asuint(min(asfloat(_4.Load2(56)), asfloat(_4.Load2(104)))));
|
||||
_4.Store(0, asuint(clamp(asfloat(_4.Load(0)), asfloat(_4.Load(56)), asfloat(_4.Load(60)))));
|
||||
_139++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
struct Data
|
||||
{
|
||||
float4 Color;
|
||||
};
|
||||
|
||||
StructuredBuffer<Data> Colors[2] : register(t0);
|
||||
|
||||
static float4 out_var_SV_Target;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 out_var_SV_Target : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
out_var_SV_Target = Colors[1][3u].Color;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.out_var_SV_Target = out_var_SV_Target;
|
||||
return stage_output;
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
cbuffer _4_5 : register(b0)
|
||||
{
|
||||
column_major float2x4 _5_m0 : packoffset(c0);
|
||||
float4 _5_m1 : packoffset(c4);
|
||||
};
|
||||
|
||||
|
||||
static float2 _3;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 _3 : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
_3 = mul(_5_m0, _5_m1);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output._3 = _3;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
Texture2D<float4> uTex : register(t1);
|
||||
SamplerState uSampler : register(s0);
|
||||
|
||||
static float4 FragColor;
|
||||
static float2 vUV;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 vUV : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uTex.Sample(uSampler, vUV);
|
||||
FragColor += uTex.Sample(uSampler, vUV, int2(1, 1));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vUV = stage_input.vUV;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
static float4 FragColor;
|
||||
static float4 vA;
|
||||
static float4 vB;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vA : TEXCOORD0;
|
||||
float4 vB : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = fmod(vA, vB);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vA = stage_input.vA;
|
||||
vB = stage_input.vB;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = 10.0f.xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
Texture2D<float4> uTexture : register(t0);
|
||||
SamplerState _uTexture_sampler : register(s0);
|
||||
|
||||
static int2 Size;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
int2 Size : SV_Target0;
|
||||
};
|
||||
|
||||
uint2 spvTextureSize(Texture2D<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint2 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
uint _19_dummy_parameter;
|
||||
uint _20_dummy_parameter;
|
||||
Size = int2(spvTextureSize(uTexture, uint(0), _19_dummy_parameter)) + int2(spvTextureSize(uTexture, uint(1), _20_dummy_parameter));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.Size = Size;
|
||||
return stage_output;
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
Texture2D<float4> uImage : register(t0);
|
||||
SamplerState _uImage_sampler : register(s0);
|
||||
|
||||
static float4 v0;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 v0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float phi;
|
||||
float4 _36;
|
||||
int _51;
|
||||
_51 = 0;
|
||||
phi = 1.0f;
|
||||
_36 = float4(1.0f, 2.0f, 1.0f, 2.0f);
|
||||
for (;;)
|
||||
{
|
||||
FragColor = _36;
|
||||
if (_51 < 4)
|
||||
{
|
||||
if (v0[_51] > 0.0f)
|
||||
{
|
||||
float2 _48 = phi.xx;
|
||||
_51++;
|
||||
phi += 2.0f;
|
||||
_36 = uImage.SampleLevel(_uImage_sampler, _48, 0.0f);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
v0 = stage_input.v0;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
static float3 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float3 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float3(asfloat(0x7f800000u /* inf */), asfloat(0xff800000u /* -inf */), asfloat(0x7fc00000u /* nan */));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
static float FragColor;
|
||||
static float vColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float vColor : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
#line 8 "test.frag"
|
||||
void frag_main()
|
||||
{
|
||||
#line 8 "test.frag"
|
||||
FragColor = 1.0f;
|
||||
#line 9 "test.frag"
|
||||
FragColor = 2.0f;
|
||||
#line 10 "test.frag"
|
||||
if (vColor < 0.0f)
|
||||
{
|
||||
#line 12 "test.frag"
|
||||
FragColor = 3.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
#line 16 "test.frag"
|
||||
FragColor = 4.0f;
|
||||
}
|
||||
#line 19 "test.frag"
|
||||
for (int _127 = 0; float(_127) < (40.0f + vColor); )
|
||||
{
|
||||
#line 21 "test.frag"
|
||||
FragColor += 0.20000000298023223876953125f;
|
||||
#line 22 "test.frag"
|
||||
FragColor += 0.300000011920928955078125f;
|
||||
#line 19 "test.frag"
|
||||
_127 += (int(vColor) + 5);
|
||||
continue;
|
||||
}
|
||||
#line 25 "test.frag"
|
||||
switch (int(vColor))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
#line 28 "test.frag"
|
||||
FragColor += 0.20000000298023223876953125f;
|
||||
#line 29 "test.frag"
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
#line 32 "test.frag"
|
||||
FragColor += 0.4000000059604644775390625f;
|
||||
#line 33 "test.frag"
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
#line 36 "test.frag"
|
||||
FragColor += 0.800000011920928955078125f;
|
||||
#line 37 "test.frag"
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
#line 42 "test.frag"
|
||||
FragColor += (10.0f + vColor);
|
||||
#line 43 "test.frag"
|
||||
if (FragColor < 100.0f)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
#line 48 "test.frag"
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vColor = stage_input.vColor;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+57
@@ -0,0 +1,57 @@
|
||||
static const float _46[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f };
|
||||
static const float4 _76[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx };
|
||||
static const float4 _90[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx };
|
||||
|
||||
static float FragColor;
|
||||
static int index;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int index : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 foobar[4] = _76;
|
||||
float4 baz[4] = _76;
|
||||
FragColor = _46[index];
|
||||
if (index < 10)
|
||||
{
|
||||
FragColor += _46[index ^ 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor += _46[index & 1];
|
||||
}
|
||||
bool _99 = index > 30;
|
||||
if (_99)
|
||||
{
|
||||
FragColor += _76[index & 3].y;
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor += _76[index & 1].x;
|
||||
}
|
||||
if (_99)
|
||||
{
|
||||
foobar[1].z = 20.0f;
|
||||
}
|
||||
int _37 = index & 3;
|
||||
FragColor += foobar[_37].z;
|
||||
baz = _90;
|
||||
FragColor += baz[_37].z;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
index = stage_input.index;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float4(18.0f, 52.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
cbuffer Registers
|
||||
{
|
||||
float registers_foo : packoffset(c0);
|
||||
};
|
||||
|
||||
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = 10.0f + registers_foo;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
Texture2D<float4> g_Texture : register(t0);
|
||||
SamplerState g_Sampler : register(s0);
|
||||
SamplerComparisonState g_CompareSampler : register(s1);
|
||||
|
||||
static float2 in_var_TEXCOORD0;
|
||||
static float out_var_SV_Target;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 in_var_TEXCOORD0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float out_var_SV_Target : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
out_var_SV_Target = g_Texture.Sample(g_Sampler, in_var_TEXCOORD0).x + g_Texture.SampleCmpLevelZero(g_CompareSampler, in_var_TEXCOORD0, 0.5f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
in_var_TEXCOORD0 = stage_input.in_var_TEXCOORD0;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.out_var_SV_Target = out_var_SV_Target;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+63
@@ -0,0 +1,63 @@
|
||||
struct myType
|
||||
{
|
||||
float data;
|
||||
};
|
||||
|
||||
static const myType _18 = { 0.0f };
|
||||
static const myType _20 = { 1.0f };
|
||||
static const myType _21[5] = { { 0.0f }, { 1.0f }, { 0.0f }, { 1.0f }, { 0.0f } };
|
||||
|
||||
static float4 gl_FragCoord;
|
||||
static float4 o_color;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 o_color : SV_Target0;
|
||||
};
|
||||
|
||||
float mod(float x, float y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float2 mod(float2 x, float2 y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float3 mod(float3 x, float3 y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float4 mod(float4 x, float4 y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
if (_21[int(mod(gl_FragCoord.x, 4.0f))].data > 0.0f)
|
||||
{
|
||||
o_color = float4(0.0f, 1.0f, 0.0f, 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
o_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
gl_FragCoord.w = 1.0 / gl_FragCoord.w;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.o_color = o_color;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
static float4 FragColor;
|
||||
static int4 vA;
|
||||
static int4 vB;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int4 vA : TEXCOORD0;
|
||||
nointerpolation int4 vB : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float4(vA - vB * (vA / vB));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vA = stage_input.vA;
|
||||
vB = stage_input.vB;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
static const float4 _20[2] = { float4(1.0f, 2.0f, 3.0f, 4.0f), 10.0f.xxxx };
|
||||
|
||||
static float4 FragColors[2] = _20;
|
||||
static float4 FragColor = 5.0f.xxxx;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColors[2] : SV_Target0;
|
||||
float4 FragColor : SV_Target2;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColors = FragColors;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
struct Data
|
||||
{
|
||||
float4 Color;
|
||||
};
|
||||
|
||||
StructuredBuffer<Data> Colors : register(t0);
|
||||
|
||||
static float4 out_var_SV_Target;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 out_var_SV_Target : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
out_var_SV_Target = Colors[3u].Color;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.out_var_SV_Target = out_var_SV_Target;
|
||||
return stage_output;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
Texture2D<float4> uTexture : register(t0);
|
||||
SamplerState _uTexture_sampler : register(s0);
|
||||
|
||||
static float4 gl_FragCoord;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uTexture.Load(int3(int2(gl_FragCoord.xy), 0));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
gl_FragCoord.w = 1.0 / gl_FragCoord.w;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
Texture2D<float4> uTexture : register(t0);
|
||||
SamplerState _uTexture_sampler : register(s0);
|
||||
|
||||
static min16float4 FragColor;
|
||||
static min16float2 UV;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
min16float2 UV : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
min16float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = min16float4(uTexture.Sample(_uTexture_sampler, UV));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
UV = stage_input.UV;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
Texture2D<float4> uShadow : register(t0);
|
||||
SamplerComparisonState _uShadow_sampler : register(s0);
|
||||
Texture2D<float4> uTexture : register(t1);
|
||||
SamplerComparisonState uSampler : register(s2);
|
||||
|
||||
static float3 vUV;
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float3 vUV : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uShadow.SampleCmp(_uShadow_sampler, vUV.xy, vUV.z) + uTexture.SampleCmp(uSampler, vUV.xy, vUV.z);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vUV = stage_input.vUV;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
static int counter;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int counter : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _33;
|
||||
for (;;)
|
||||
{
|
||||
if (counter == 10)
|
||||
{
|
||||
_33 = 10.0f.xxxx;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
_33 = 30.0f.xxxx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
FragColor = _33;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
counter = stage_input.counter;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
struct InstanceData
|
||||
{
|
||||
column_major float4x4 MATRIX_MVP;
|
||||
float4 Color;
|
||||
};
|
||||
|
||||
cbuffer gInstanceData : register(b0)
|
||||
{
|
||||
InstanceData gInstanceData_1_data[32] : packoffset(c0);
|
||||
};
|
||||
|
||||
|
||||
static float4 gl_Position;
|
||||
static int gl_InstanceIndex;
|
||||
static float3 PosL;
|
||||
static float4 _entryPointOutput_Color;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float3 PosL : TEXCOORD0;
|
||||
uint gl_InstanceIndex : SV_InstanceID;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 _entryPointOutput_Color : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = mul(float4(PosL, 1.0f), gInstanceData_1_data[uint(gl_InstanceIndex)].MATRIX_MVP);
|
||||
_entryPointOutput_Color = gInstanceData_1_data[uint(gl_InstanceIndex)].Color;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
|
||||
PosL = stage_input.PosL;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output._entryPointOutput_Color = _entryPointOutput_Color;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_201
|
||||
#define SPIRV_CROSS_CONSTANT_ID_201 -10
|
||||
#endif
|
||||
static const int _7 = SPIRV_CROSS_CONSTANT_ID_201;
|
||||
static const int _20 = (_7 + 2);
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_202
|
||||
#define SPIRV_CROSS_CONSTANT_ID_202 100u
|
||||
#endif
|
||||
static const uint _8 = SPIRV_CROSS_CONSTANT_ID_202;
|
||||
static const uint _25 = (_8 % 5u);
|
||||
static const int4 _30 = int4(20, 30, _20, _20);
|
||||
static const int2 _32 = int2(_30.y, _30.x);
|
||||
static const int _33 = _30.y;
|
||||
|
||||
static float4 gl_Position;
|
||||
static int _4;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
nointerpolation int _4 : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
float4 _63 = 0.0f.xxxx;
|
||||
_63.y = float(_20);
|
||||
_63.z = float(_25);
|
||||
float4 _52 = _63 + float4(_30);
|
||||
float2 _56 = _52.xy + float2(_32);
|
||||
gl_Position = float4(_56.x, _56.y, _52.z, _52.w);
|
||||
_4 = _33;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output._4 = _4;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
static float4 gl_Position;
|
||||
static int gl_VertexIndex;
|
||||
static int gl_InstanceIndex;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint gl_VertexIndex : SV_VertexID;
|
||||
uint gl_InstanceIndex : SV_InstanceID;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = float(uint(gl_VertexIndex) + uint(gl_InstanceIndex)).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_VertexIndex = int(stage_input.gl_VertexIndex);
|
||||
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
static float4 gl_Position;
|
||||
static int gl_VertexIndex;
|
||||
static int gl_InstanceIndex;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint gl_VertexIndex : SV_VertexID;
|
||||
uint gl_InstanceIndex : SV_InstanceID;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = float(gl_VertexIndex + gl_InstanceIndex).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_VertexIndex = int(stage_input.gl_VertexIndex);
|
||||
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
struct Baz
|
||||
{
|
||||
float c;
|
||||
};
|
||||
|
||||
struct Bar
|
||||
{
|
||||
float d[2][4];
|
||||
Baz baz[2];
|
||||
};
|
||||
|
||||
struct Foo
|
||||
{
|
||||
column_major float2x2 a;
|
||||
float2 b;
|
||||
Bar c[5];
|
||||
};
|
||||
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _31 : register(u0);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
Foo _36;
|
||||
_36.a = asfloat(uint2x2(_31.Load(0), _31.Load(8), _31.Load(4), _31.Load(12)));
|
||||
_36.b = asfloat(_31.Load2(16));
|
||||
[unroll]
|
||||
for (int _4ident = 0; _4ident < 5; _4ident++)
|
||||
{
|
||||
[unroll]
|
||||
for (int _5ident = 0; _5ident < 2; _5ident++)
|
||||
{
|
||||
[unroll]
|
||||
for (int _6ident = 0; _6ident < 4; _6ident++)
|
||||
{
|
||||
_36.c[_4ident].d[_5ident][_6ident] = asfloat(_31.Load(_6ident * 4 + _5ident * 16 + _4ident * 40 + 24));
|
||||
}
|
||||
}
|
||||
[unroll]
|
||||
for (int _7ident = 0; _7ident < 2; _7ident++)
|
||||
{
|
||||
_36.c[_4ident].baz[_7ident].c = asfloat(_31.Load(_7ident * 4 + _4ident * 40 + 56));
|
||||
}
|
||||
}
|
||||
float2x2 _234 = float2x2(_36.a[0] + 1.0f.xx, _36.a[1] + 1.0f.xx);
|
||||
_31.Store(224, asuint(_234[0].x));
|
||||
_31.Store(228, asuint(_234[1].x));
|
||||
_31.Store(232, asuint(_234[0].y));
|
||||
_31.Store(236, asuint(_234[1].y));
|
||||
_31.Store2(240, asuint(_36.b + 2.0f.xx));
|
||||
_31.Store(248, asuint(_36.c[0].d[0][0]));
|
||||
_31.Store(252, asuint(_36.c[0].d[0][1]));
|
||||
_31.Store(256, asuint(_36.c[0].d[0][2]));
|
||||
_31.Store(260, asuint(_36.c[0].d[0][3]));
|
||||
_31.Store(264, asuint(_36.c[0].d[1][0]));
|
||||
_31.Store(268, asuint(_36.c[0].d[1][1]));
|
||||
_31.Store(272, asuint(_36.c[0].d[1][2]));
|
||||
_31.Store(276, asuint(_36.c[0].d[1][3]));
|
||||
_31.Store(280, asuint(_36.c[0].baz[0].c));
|
||||
_31.Store(284, asuint(_36.c[0].baz[1].c));
|
||||
_31.Store(288, asuint(_36.c[1].d[0][0]));
|
||||
_31.Store(292, asuint(_36.c[1].d[0][1]));
|
||||
_31.Store(296, asuint(_36.c[1].d[0][2]));
|
||||
_31.Store(300, asuint(_36.c[1].d[0][3]));
|
||||
_31.Store(304, asuint(_36.c[1].d[1][0]));
|
||||
_31.Store(308, asuint(_36.c[1].d[1][1]));
|
||||
_31.Store(312, asuint(_36.c[1].d[1][2]));
|
||||
_31.Store(316, asuint(_36.c[1].d[1][3]));
|
||||
_31.Store(320, asuint(_36.c[1].baz[0].c));
|
||||
_31.Store(324, asuint(_36.c[1].baz[1].c));
|
||||
_31.Store(328, asuint(_36.c[2].d[0][0]));
|
||||
_31.Store(332, asuint(_36.c[2].d[0][1]));
|
||||
_31.Store(336, asuint(_36.c[2].d[0][2]));
|
||||
_31.Store(340, asuint(_36.c[2].d[0][3]));
|
||||
_31.Store(344, asuint(_36.c[2].d[1][0]));
|
||||
_31.Store(348, asuint(_36.c[2].d[1][1]));
|
||||
_31.Store(352, asuint(_36.c[2].d[1][2]));
|
||||
_31.Store(356, asuint(_36.c[2].d[1][3]));
|
||||
_31.Store(360, asuint(_36.c[2].baz[0].c));
|
||||
_31.Store(364, asuint(_36.c[2].baz[1].c));
|
||||
_31.Store(368, asuint(_36.c[3].d[0][0]));
|
||||
_31.Store(372, asuint(_36.c[3].d[0][1]));
|
||||
_31.Store(376, asuint(_36.c[3].d[0][2]));
|
||||
_31.Store(380, asuint(_36.c[3].d[0][3]));
|
||||
_31.Store(384, asuint(_36.c[3].d[1][0]));
|
||||
_31.Store(388, asuint(_36.c[3].d[1][1] + 5.0f));
|
||||
_31.Store(392, asuint(_36.c[3].d[1][2]));
|
||||
_31.Store(396, asuint(_36.c[3].d[1][3]));
|
||||
_31.Store(400, asuint(_36.c[3].baz[0].c));
|
||||
_31.Store(404, asuint(_36.c[3].baz[1].c));
|
||||
_31.Store(408, asuint(_36.c[4].d[0][0]));
|
||||
_31.Store(412, asuint(_36.c[4].d[0][1]));
|
||||
_31.Store(416, asuint(_36.c[4].d[0][2]));
|
||||
_31.Store(420, asuint(_36.c[4].d[0][3]));
|
||||
_31.Store(424, asuint(_36.c[4].d[1][0]));
|
||||
_31.Store(428, asuint(_36.c[4].d[1][1]));
|
||||
_31.Store(432, asuint(_36.c[4].d[1][2]));
|
||||
_31.Store(436, asuint(_36.c[4].d[1][3]));
|
||||
_31.Store(440, asuint(_36.c[4].baz[0].c));
|
||||
_31.Store(444, asuint(_36.c[4].baz[1].c));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer wo : register(u1);
|
||||
ByteAddressBuffer ro : register(t0);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
wo.Store4(gl_GlobalInvocationID.x * 64 + 272, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 64 + 160))));
|
||||
wo.Store4(gl_GlobalInvocationID.x * 16 + 480, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 16 + 480))));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer wo : register(u1);
|
||||
RWByteAddressBuffer ro : register(u0);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
wo.Store4(gl_GlobalInvocationID.x * 64 + 272, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 64 + 160))));
|
||||
wo.Store4(gl_GlobalInvocationID.x * 16 + 480, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 16 + 480))));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer WriteOnly : register(u2);
|
||||
ByteAddressBuffer ReadOnly : register(t0);
|
||||
RWByteAddressBuffer ReadWrite : register(u1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
WriteOnly.Store4(0, asuint(asfloat(ReadOnly.Load4(0))));
|
||||
ReadWrite.Store4(0, asuint(asfloat(ReadWrite.Load4(0)) + 10.0f.xxxx));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer ssbo : register(u2);
|
||||
RWTexture2D<uint> uImage : register(u0);
|
||||
RWTexture2D<int> iImage : register(u1);
|
||||
|
||||
groupshared int int_atomic;
|
||||
groupshared uint uint_atomic;
|
||||
groupshared int int_atomic_array[1];
|
||||
groupshared uint uint_atomic_array[1];
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uint _19;
|
||||
InterlockedAdd(uImage[int2(1, 5)], 1u, _19);
|
||||
uint _27;
|
||||
InterlockedAdd(uImage[int2(1, 5)], 1u, _27);
|
||||
iImage[int2(1, 6)] = int(_27).x;
|
||||
uint _32;
|
||||
InterlockedOr(uImage[int2(1, 5)], 1u, _32);
|
||||
uint _34;
|
||||
InterlockedXor(uImage[int2(1, 5)], 1u, _34);
|
||||
uint _36;
|
||||
InterlockedAnd(uImage[int2(1, 5)], 1u, _36);
|
||||
uint _38;
|
||||
InterlockedMin(uImage[int2(1, 5)], 1u, _38);
|
||||
uint _40;
|
||||
InterlockedMax(uImage[int2(1, 5)], 1u, _40);
|
||||
uint _44;
|
||||
InterlockedCompareExchange(uImage[int2(1, 5)], 10u, 2u, _44);
|
||||
int _47;
|
||||
InterlockedAdd(iImage[int2(1, 6)], 1, _47);
|
||||
int _49;
|
||||
InterlockedOr(iImage[int2(1, 6)], 1, _49);
|
||||
int _51;
|
||||
InterlockedXor(iImage[int2(1, 6)], 1, _51);
|
||||
int _53;
|
||||
InterlockedAnd(iImage[int2(1, 6)], 1, _53);
|
||||
int _55;
|
||||
InterlockedMin(iImage[int2(1, 6)], 1, _55);
|
||||
int _57;
|
||||
InterlockedMax(iImage[int2(1, 6)], 1, _57);
|
||||
int _61;
|
||||
InterlockedCompareExchange(iImage[int2(1, 5)], 10, 2, _61);
|
||||
uint _68;
|
||||
ssbo.InterlockedAdd(0, 1u, _68);
|
||||
uint _70;
|
||||
ssbo.InterlockedOr(0, 1u, _70);
|
||||
uint _72;
|
||||
ssbo.InterlockedXor(0, 1u, _72);
|
||||
uint _74;
|
||||
ssbo.InterlockedAnd(0, 1u, _74);
|
||||
uint _76;
|
||||
ssbo.InterlockedMin(0, 1u, _76);
|
||||
uint _78;
|
||||
ssbo.InterlockedMax(0, 1u, _78);
|
||||
uint _80;
|
||||
ssbo.InterlockedExchange(0, 1u, _80);
|
||||
uint _82;
|
||||
ssbo.InterlockedCompareExchange(0, 10u, 2u, _82);
|
||||
int _85;
|
||||
ssbo.InterlockedAdd(4, 1, _85);
|
||||
int _87;
|
||||
ssbo.InterlockedOr(4, 1, _87);
|
||||
int _89;
|
||||
ssbo.InterlockedXor(4, 1, _89);
|
||||
int _91;
|
||||
ssbo.InterlockedAnd(4, 1, _91);
|
||||
int _93;
|
||||
ssbo.InterlockedMin(4, 1, _93);
|
||||
int _95;
|
||||
ssbo.InterlockedMax(4, 1, _95);
|
||||
int _97;
|
||||
ssbo.InterlockedExchange(4, 1, _97);
|
||||
int _99;
|
||||
ssbo.InterlockedCompareExchange(4, 10, 2, _99);
|
||||
int _102;
|
||||
InterlockedAdd(int_atomic, 10, _102);
|
||||
uint _105;
|
||||
InterlockedAdd(uint_atomic, 10u, _105);
|
||||
int _110;
|
||||
InterlockedAdd(int_atomic_array[0], 10, _110);
|
||||
uint _115;
|
||||
InterlockedAdd(uint_atomic_array[0], 10u, _115);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
GroupMemoryBarrier();
|
||||
AllMemoryBarrier();
|
||||
DeviceMemoryBarrier();
|
||||
DeviceMemoryBarrier();
|
||||
AllMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
AllMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
DeviceMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
DeviceMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
AllMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
}
|
||||
|
||||
[numthreads(4, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(8u, 4u, 2u);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
}
|
||||
|
||||
[numthreads(8, 4, 2)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
struct Data
|
||||
{
|
||||
float a;
|
||||
float b;
|
||||
};
|
||||
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_0
|
||||
#define SPIRV_CROSS_CONSTANT_ID_0 4.0f
|
||||
#endif
|
||||
static const float X = SPIRV_CROSS_CONSTANT_ID_0;
|
||||
|
||||
static const uint3 gl_WorkGroupSize = uint3(2u, 1u, 1u);
|
||||
|
||||
static const Data _21 = { 1.0f, 2.0f };
|
||||
static const Data _24 = { 3.0f, 4.0f };
|
||||
static const Data _25[2] = { { 1.0f, 2.0f }, { 3.0f, 4.0f } };
|
||||
static const Data _30 = { 3.0f, 5.0f };
|
||||
|
||||
RWByteAddressBuffer _61 : register(u0);
|
||||
|
||||
static uint3 gl_WorkGroupID;
|
||||
static uint3 gl_LocalInvocationID;
|
||||
static uint gl_LocalInvocationIndex;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_WorkGroupID : SV_GroupID;
|
||||
uint3 gl_LocalInvocationID : SV_GroupThreadID;
|
||||
uint gl_LocalInvocationIndex : SV_GroupIndex;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
Data _28 = { X, 2.0f };
|
||||
Data _31[2] = { _28, _30 };
|
||||
Data data2[2] = _31;
|
||||
if (gl_LocalInvocationIndex == 0u)
|
||||
{
|
||||
_61.Store(gl_WorkGroupID.x * 8 + 0, asuint(_25[gl_LocalInvocationID.x].a + data2[gl_LocalInvocationID.x].a));
|
||||
_61.Store(gl_WorkGroupID.x * 8 + 4, asuint(_25[gl_LocalInvocationID.x].b + data2[gl_LocalInvocationID.x].b));
|
||||
}
|
||||
}
|
||||
|
||||
[numthreads(2, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_WorkGroupID = stage_input.gl_WorkGroupID;
|
||||
gl_LocalInvocationID = stage_input.gl_LocalInvocationID;
|
||||
gl_LocalInvocationIndex = stage_input.gl_LocalInvocationIndex;
|
||||
comp_main();
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
globallycoherent RWByteAddressBuffer _29 : register(u3);
|
||||
ByteAddressBuffer _33 : register(t2);
|
||||
RWTexture2D<float> uImageIn : register(u0);
|
||||
globallycoherent RWTexture2D<float> uImageOut : register(u1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uImageOut[int2(9, 7)] = uImageIn[int2(9, 7)].x;
|
||||
_29.Store(0, asuint(asfloat(_33.Load(0))));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWTexture2D<float> uImageInF : register(u0);
|
||||
RWTexture2D<float> uImageOutF : register(u1);
|
||||
RWTexture2D<int> uImageInI : register(u2);
|
||||
RWTexture2D<int> uImageOutI : register(u3);
|
||||
RWTexture2D<uint> uImageInU : register(u4);
|
||||
RWTexture2D<uint> uImageOutU : register(u5);
|
||||
RWBuffer<float> uImageInBuffer : register(u6);
|
||||
RWBuffer<float> uImageOutBuffer : register(u7);
|
||||
RWTexture2D<float2> uImageInF2 : register(u8);
|
||||
RWTexture2D<float2> uImageOutF2 : register(u9);
|
||||
RWTexture2D<int2> uImageInI2 : register(u10);
|
||||
RWTexture2D<int2> uImageOutI2 : register(u11);
|
||||
RWTexture2D<uint2> uImageInU2 : register(u12);
|
||||
RWTexture2D<uint2> uImageOutU2 : register(u13);
|
||||
RWBuffer<float2> uImageInBuffer2 : register(u14);
|
||||
RWBuffer<float2> uImageOutBuffer2 : register(u15);
|
||||
RWTexture2D<float4> uImageInF4 : register(u16);
|
||||
RWTexture2D<float4> uImageOutF4 : register(u17);
|
||||
RWTexture2D<int4> uImageInI4 : register(u18);
|
||||
RWTexture2D<int4> uImageOutI4 : register(u19);
|
||||
RWTexture2D<uint4> uImageInU4 : register(u20);
|
||||
RWTexture2D<uint4> uImageOutU4 : register(u21);
|
||||
RWBuffer<float4> uImageInBuffer4 : register(u22);
|
||||
RWBuffer<float4> uImageOutBuffer4 : register(u23);
|
||||
RWTexture2D<float4> uImageNoFmtF : register(u24);
|
||||
RWTexture2D<uint4> uImageNoFmtU : register(u25);
|
||||
RWTexture2D<int4> uImageNoFmtI : register(u26);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
int2 _23 = int2(gl_GlobalInvocationID.xy);
|
||||
uImageOutF[_23] = uImageInF[_23].x;
|
||||
uImageOutI[_23] = uImageInI[_23].x;
|
||||
uImageOutU[_23] = uImageInU[_23].x;
|
||||
int _74 = int(gl_GlobalInvocationID.x);
|
||||
uImageOutBuffer[_74] = uImageInBuffer[_74].x;
|
||||
uImageOutF2[_23] = uImageInF2[_23].xy;
|
||||
uImageOutI2[_23] = uImageInI2[_23].xy;
|
||||
uImageOutU2[_23] = uImageInU2[_23].xy;
|
||||
float4 _135 = uImageInBuffer2[_74].xyyy;
|
||||
uImageOutBuffer2[_74] = _135.xy;
|
||||
uImageOutF4[_23] = uImageInF4[_23];
|
||||
int4 _165 = uImageInI4[_23];
|
||||
uImageOutI4[_23] = _165;
|
||||
uint4 _180 = uImageInU4[_23];
|
||||
uImageOutU4[_23] = _180;
|
||||
uImageOutBuffer4[_74] = uImageInBuffer4[_74];
|
||||
uImageNoFmtF[_23] = _135;
|
||||
uImageNoFmtU[_23] = _180;
|
||||
uImageNoFmtI[_23] = _165;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
Texture2D<float4> uImageInF : register(t0);
|
||||
RWTexture2D<float> uImageOutF : register(u1);
|
||||
Texture2D<int4> uImageInI : register(t2);
|
||||
RWTexture2D<int> uImageOutI : register(u3);
|
||||
Texture2D<uint4> uImageInU : register(t4);
|
||||
RWTexture2D<uint> uImageOutU : register(u5);
|
||||
Buffer<float4> uImageInBuffer : register(t6);
|
||||
RWBuffer<float> uImageOutBuffer : register(u7);
|
||||
Texture2D<float4> uImageInF2 : register(t8);
|
||||
RWTexture2D<float2> uImageOutF2 : register(u9);
|
||||
Texture2D<int4> uImageInI2 : register(t10);
|
||||
RWTexture2D<int2> uImageOutI2 : register(u11);
|
||||
Texture2D<uint4> uImageInU2 : register(t12);
|
||||
RWTexture2D<uint2> uImageOutU2 : register(u13);
|
||||
Buffer<float4> uImageInBuffer2 : register(t14);
|
||||
RWBuffer<float2> uImageOutBuffer2 : register(u15);
|
||||
Texture2D<float4> uImageInF4 : register(t16);
|
||||
RWTexture2D<float4> uImageOutF4 : register(u17);
|
||||
Texture2D<int4> uImageInI4 : register(t18);
|
||||
RWTexture2D<int4> uImageOutI4 : register(u19);
|
||||
Texture2D<uint4> uImageInU4 : register(t20);
|
||||
RWTexture2D<uint4> uImageOutU4 : register(u21);
|
||||
Buffer<float4> uImageInBuffer4 : register(t22);
|
||||
RWBuffer<float4> uImageOutBuffer4 : register(u23);
|
||||
RWTexture2D<float4> uImageNoFmtF : register(u24);
|
||||
RWTexture2D<uint4> uImageNoFmtU : register(u25);
|
||||
RWTexture2D<int4> uImageNoFmtI : register(u26);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
int2 _23 = int2(gl_GlobalInvocationID.xy);
|
||||
uImageOutF[_23] = uImageInF[_23].x;
|
||||
uImageOutI[_23] = uImageInI[_23].x;
|
||||
uImageOutU[_23] = uImageInU[_23].x;
|
||||
int _74 = int(gl_GlobalInvocationID.x);
|
||||
uImageOutBuffer[_74] = uImageInBuffer[_74].x;
|
||||
uImageOutF2[_23] = uImageInF2[_23].xy;
|
||||
uImageOutI2[_23] = uImageInI2[_23].xy;
|
||||
uImageOutU2[_23] = uImageInU2[_23].xy;
|
||||
float4 _135 = uImageInBuffer2[_74];
|
||||
uImageOutBuffer2[_74] = _135.xy;
|
||||
uImageOutF4[_23] = uImageInF4[_23];
|
||||
int4 _165 = uImageInI4[_23];
|
||||
uImageOutI4[_23] = _165;
|
||||
uint4 _180 = uImageInU4[_23];
|
||||
uImageOutU4[_23] = _180;
|
||||
uImageOutBuffer4[_74] = uImageInBuffer4[_74];
|
||||
uImageNoFmtF[_23] = _135;
|
||||
uImageNoFmtU[_23] = _180;
|
||||
uImageNoFmtI[_23] = _165;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _15 : register(u0);
|
||||
ByteAddressBuffer _20 : register(t1);
|
||||
|
||||
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
|
||||
// adjoint and dividing by the determinant. The contents of the matrix are changed.
|
||||
float2x2 spvInverse(float2x2 m)
|
||||
{
|
||||
float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
// Create the transpose of the cofactors, as the classical adjoint of the matrix.
|
||||
adj[0][0] = m[1][1];
|
||||
adj[0][1] = -m[0][1];
|
||||
|
||||
adj[1][0] = -m[1][0];
|
||||
adj[1][1] = m[0][0];
|
||||
|
||||
// Calculate the determinant as a combination of the cofactors of the first row.
|
||||
float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]);
|
||||
|
||||
// Divide the classical adjoint matrix by the determinant.
|
||||
// If determinant is zero, matrix is not invertable, so leave it unchanged.
|
||||
return (det != 0.0f) ? (adj * (1.0f / det)) : m;
|
||||
}
|
||||
|
||||
// Returns the determinant of a 2x2 matrix.
|
||||
float spvDet2x2(float a1, float a2, float b1, float b2)
|
||||
{
|
||||
return a1 * b2 - b1 * a2;
|
||||
}
|
||||
|
||||
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
|
||||
// adjoint and dividing by the determinant. The contents of the matrix are changed.
|
||||
float3x3 spvInverse(float3x3 m)
|
||||
{
|
||||
float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
// Create the transpose of the cofactors, as the classical adjoint of the matrix.
|
||||
adj[0][0] = spvDet2x2(m[1][1], m[1][2], m[2][1], m[2][2]);
|
||||
adj[0][1] = -spvDet2x2(m[0][1], m[0][2], m[2][1], m[2][2]);
|
||||
adj[0][2] = spvDet2x2(m[0][1], m[0][2], m[1][1], m[1][2]);
|
||||
|
||||
adj[1][0] = -spvDet2x2(m[1][0], m[1][2], m[2][0], m[2][2]);
|
||||
adj[1][1] = spvDet2x2(m[0][0], m[0][2], m[2][0], m[2][2]);
|
||||
adj[1][2] = -spvDet2x2(m[0][0], m[0][2], m[1][0], m[1][2]);
|
||||
|
||||
adj[2][0] = spvDet2x2(m[1][0], m[1][1], m[2][0], m[2][1]);
|
||||
adj[2][1] = -spvDet2x2(m[0][0], m[0][1], m[2][0], m[2][1]);
|
||||
adj[2][2] = spvDet2x2(m[0][0], m[0][1], m[1][0], m[1][1]);
|
||||
|
||||
// Calculate the determinant as a combination of the cofactors of the first row.
|
||||
float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]);
|
||||
|
||||
// Divide the classical adjoint matrix by the determinant.
|
||||
// If determinant is zero, matrix is not invertable, so leave it unchanged.
|
||||
return (det != 0.0f) ? (adj * (1.0f / det)) : m;
|
||||
}
|
||||
|
||||
// Returns the determinant of a 3x3 matrix.
|
||||
float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
|
||||
{
|
||||
return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, b2, b3);
|
||||
}
|
||||
|
||||
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
|
||||
// adjoint and dividing by the determinant. The contents of the matrix are changed.
|
||||
float4x4 spvInverse(float4x4 m)
|
||||
{
|
||||
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
// Create the transpose of the cofactors, as the classical adjoint of the matrix.
|
||||
adj[0][0] = spvDet3x3(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3]);
|
||||
adj[0][1] = -spvDet3x3(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3]);
|
||||
adj[0][2] = spvDet3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], m[3][3]);
|
||||
adj[0][3] = -spvDet3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3]);
|
||||
|
||||
adj[1][0] = -spvDet3x3(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3]);
|
||||
adj[1][1] = spvDet3x3(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3]);
|
||||
adj[1][2] = -spvDet3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], m[3][3]);
|
||||
adj[1][3] = spvDet3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3]);
|
||||
|
||||
adj[2][0] = spvDet3x3(m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3]);
|
||||
adj[2][1] = -spvDet3x3(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3]);
|
||||
adj[2][2] = spvDet3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], m[3][3]);
|
||||
adj[2][3] = -spvDet3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3]);
|
||||
|
||||
adj[3][0] = -spvDet3x3(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2]);
|
||||
adj[3][1] = spvDet3x3(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2]);
|
||||
adj[3][2] = -spvDet3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], m[3][2]);
|
||||
adj[3][3] = spvDet3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2]);
|
||||
|
||||
// Calculate the determinant as a combination of the cofactors of the first row.
|
||||
float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]) + (adj[0][3] * m[3][0]);
|
||||
|
||||
// Divide the classical adjoint matrix by the determinant.
|
||||
// If determinant is zero, matrix is not invertable, so leave it unchanged.
|
||||
return (det != 0.0f) ? (adj * (1.0f / det)) : m;
|
||||
}
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
float2x2 _23 = asfloat(uint2x2(_20.Load2(0), _20.Load2(8)));
|
||||
float2x2 _24 = spvInverse(_23);
|
||||
_15.Store2(0, asuint(_24[0]));
|
||||
_15.Store2(8, asuint(_24[1]));
|
||||
float3x3 _29 = asfloat(uint3x3(_20.Load3(16), _20.Load3(32), _20.Load3(48)));
|
||||
float3x3 _30 = spvInverse(_29);
|
||||
_15.Store3(16, asuint(_30[0]));
|
||||
_15.Store3(32, asuint(_30[1]));
|
||||
_15.Store3(48, asuint(_30[2]));
|
||||
float4x4 _35 = asfloat(uint4x4(_20.Load4(64), _20.Load4(80), _20.Load4(96), _20.Load4(112)));
|
||||
float4x4 _36 = spvInverse(_35);
|
||||
_15.Store4(64, asuint(_36[0]));
|
||||
_15.Store4(80, asuint(_36[1]));
|
||||
_15.Store4(96, asuint(_36[2]));
|
||||
_15.Store4(112, asuint(_36[3]));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _10 : register(u0);
|
||||
cbuffer SPIRV_Cross_NumWorkgroups
|
||||
{
|
||||
uint3 SPIRV_Cross_NumWorkgroups_1_count : packoffset(c0);
|
||||
};
|
||||
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_10.Store3(0, SPIRV_Cross_NumWorkgroups_1_count);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _10 : register(u0);
|
||||
cbuffer SPIRV_Cross_NumWorkgroups
|
||||
{
|
||||
uint3 SPIRV_Cross_NumWorkgroups_1_count : packoffset(c0);
|
||||
};
|
||||
|
||||
|
||||
static uint3 gl_WorkGroupID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_WorkGroupID : SV_GroupID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_10.Store3(0, SPIRV_Cross_NumWorkgroups_1_count + gl_WorkGroupID);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_WorkGroupID = stage_input.gl_WorkGroupID;
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _21 : register(u0);
|
||||
ByteAddressBuffer _26 : register(t1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
float2x2 _32 = float2x2(asfloat(_26.Load2(0)) * asfloat(_26.Load2(0)).x, asfloat(_26.Load2(0)) * asfloat(_26.Load2(0)).y);
|
||||
_21.Store2(0, asuint(_32[0]));
|
||||
_21.Store2(8, asuint(_32[1]));
|
||||
float2x3 _41 = float2x3(asfloat(_26.Load3(16)) * asfloat(_26.Load2(0)).x, asfloat(_26.Load3(16)) * asfloat(_26.Load2(0)).y);
|
||||
_21.Store3(16, asuint(_41[0]));
|
||||
_21.Store3(32, asuint(_41[1]));
|
||||
float2x4 _50 = float2x4(asfloat(_26.Load4(32)) * asfloat(_26.Load2(0)).x, asfloat(_26.Load4(32)) * asfloat(_26.Load2(0)).y);
|
||||
_21.Store4(48, asuint(_50[0]));
|
||||
_21.Store4(64, asuint(_50[1]));
|
||||
float3x2 _58 = float3x2(asfloat(_26.Load2(0)) * asfloat(_26.Load3(16)).x, asfloat(_26.Load2(0)) * asfloat(_26.Load3(16)).y, asfloat(_26.Load2(0)) * asfloat(_26.Load3(16)).z);
|
||||
_21.Store2(80, asuint(_58[0]));
|
||||
_21.Store2(88, asuint(_58[1]));
|
||||
_21.Store2(96, asuint(_58[2]));
|
||||
float3x3 _66 = float3x3(asfloat(_26.Load3(16)) * asfloat(_26.Load3(16)).x, asfloat(_26.Load3(16)) * asfloat(_26.Load3(16)).y, asfloat(_26.Load3(16)) * asfloat(_26.Load3(16)).z);
|
||||
_21.Store3(112, asuint(_66[0]));
|
||||
_21.Store3(128, asuint(_66[1]));
|
||||
_21.Store3(144, asuint(_66[2]));
|
||||
float3x4 _74 = float3x4(asfloat(_26.Load4(32)) * asfloat(_26.Load3(16)).x, asfloat(_26.Load4(32)) * asfloat(_26.Load3(16)).y, asfloat(_26.Load4(32)) * asfloat(_26.Load3(16)).z);
|
||||
_21.Store4(160, asuint(_74[0]));
|
||||
_21.Store4(176, asuint(_74[1]));
|
||||
_21.Store4(192, asuint(_74[2]));
|
||||
float4x2 _82 = float4x2(asfloat(_26.Load2(0)) * asfloat(_26.Load4(32)).x, asfloat(_26.Load2(0)) * asfloat(_26.Load4(32)).y, asfloat(_26.Load2(0)) * asfloat(_26.Load4(32)).z, asfloat(_26.Load2(0)) * asfloat(_26.Load4(32)).w);
|
||||
_21.Store2(208, asuint(_82[0]));
|
||||
_21.Store2(216, asuint(_82[1]));
|
||||
_21.Store2(224, asuint(_82[2]));
|
||||
_21.Store2(232, asuint(_82[3]));
|
||||
float4x3 _90 = float4x3(asfloat(_26.Load3(16)) * asfloat(_26.Load4(32)).x, asfloat(_26.Load3(16)) * asfloat(_26.Load4(32)).y, asfloat(_26.Load3(16)) * asfloat(_26.Load4(32)).z, asfloat(_26.Load3(16)) * asfloat(_26.Load4(32)).w);
|
||||
_21.Store3(240, asuint(_90[0]));
|
||||
_21.Store3(256, asuint(_90[1]));
|
||||
_21.Store3(272, asuint(_90[2]));
|
||||
_21.Store3(288, asuint(_90[3]));
|
||||
float4x4 _98 = float4x4(asfloat(_26.Load4(32)) * asfloat(_26.Load4(32)).x, asfloat(_26.Load4(32)) * asfloat(_26.Load4(32)).y, asfloat(_26.Load4(32)) * asfloat(_26.Load4(32)).z, asfloat(_26.Load4(32)) * asfloat(_26.Load4(32)).w);
|
||||
_21.Store4(304, asuint(_98[0]));
|
||||
_21.Store4(320, asuint(_98[1]));
|
||||
_21.Store4(336, asuint(_98[2]));
|
||||
_21.Store4(352, asuint(_98[3]));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
+242
@@ -0,0 +1,242 @@
|
||||
static float3x4 _362;
|
||||
static float4x3 _364;
|
||||
|
||||
RWByteAddressBuffer _17 : register(u0);
|
||||
uniform RaytracingAccelerationStructure rtas : register(t1);
|
||||
|
||||
static RayQuery<RAY_FLAG_NONE> rayQuery;
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
RayDesc _1ident = {0.0f.xxx, 0.0f, float3(1.0f, 0.0f, 0.0f), 9999.0f};
|
||||
rayQuery.TraceRayInline(rtas, 0u, 255u, _1ident);
|
||||
float3x4 _361;
|
||||
float4x3 _363;
|
||||
_363 = _364;
|
||||
_361 = _362;
|
||||
float3x4 _387;
|
||||
float4x3 _398;
|
||||
for (;;)
|
||||
{
|
||||
bool _67 = rayQuery.Proceed();
|
||||
if (_67)
|
||||
{
|
||||
uint _71 = rayQuery.CandidateType();
|
||||
switch (_71)
|
||||
{
|
||||
case 0u:
|
||||
{
|
||||
rayQuery.Abort();
|
||||
float4x3 _79 = rayQuery.CandidateObjectToWorld4x3();
|
||||
rayQuery.CommitNonOpaqueTriangleHit();
|
||||
bool _87 = rayQuery.CommittedTriangleFrontFace();
|
||||
if (_87)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float2 _92 = rayQuery.CommittedTriangleBarycentrics();
|
||||
if (_92.x == 0.0f)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
int _98 = rayQuery.CommittedInstanceID();
|
||||
if (_98 > 0)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
int _103 = rayQuery.CommittedInstanceIndex();
|
||||
if (_103 > 0)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float3 _108 = rayQuery.CommittedObjectRayDirection();
|
||||
if (_108.x > 0.0f)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float3 _114 = rayQuery.CommittedObjectRayOrigin();
|
||||
if (_114.x > 0.0f)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
int _120 = rayQuery.CommittedPrimitiveIndex();
|
||||
if (_120 > 0)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float _125 = rayQuery.CommittedRayT();
|
||||
if (_125 > 0.0f)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
uint _130 = rayQuery.CommittedInstanceContributionToHitGroupIndex();
|
||||
if (_130 > 0u)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
_398 = _79;
|
||||
_387 = transpose(_79);
|
||||
break;
|
||||
}
|
||||
case 1u:
|
||||
{
|
||||
float4x3 _136 = rayQuery.CandidateObjectToWorld4x3();
|
||||
bool _139 = rayQuery.CandidateProceduralPrimitiveNonOpaque();
|
||||
if (_139)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
rayQuery.CommitProceduralPrimitiveHit(0.5f);
|
||||
rayQuery.Abort();
|
||||
_398 = _136;
|
||||
_387 = transpose(_136);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
_398 = _363;
|
||||
_387 = _361;
|
||||
break;
|
||||
}
|
||||
}
|
||||
_363 = _398;
|
||||
_361 = _387;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (_361[0].x == _363[0].x)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
uint _157 = rayQuery.CommittedStatus();
|
||||
float3x4 _365;
|
||||
float4x3 _376;
|
||||
switch (_157)
|
||||
{
|
||||
case 0u:
|
||||
{
|
||||
float4x3 _163 = rayQuery.CandidateWorldToObject4x3();
|
||||
_376 = _163;
|
||||
_365 = transpose(_163);
|
||||
break;
|
||||
}
|
||||
case 1u:
|
||||
{
|
||||
float4x3 _167 = rayQuery.CommittedWorldToObject4x3();
|
||||
bool _170 = rayQuery.CommittedTriangleFrontFace();
|
||||
if (_170)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float2 _174 = rayQuery.CommittedTriangleBarycentrics();
|
||||
if (_174.y == 0.0f)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
_376 = _167;
|
||||
_365 = transpose(_167);
|
||||
break;
|
||||
}
|
||||
case 2u:
|
||||
{
|
||||
int _182 = rayQuery.CommittedGeometryIndex();
|
||||
if (_182 > 0)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
int _187 = rayQuery.CommittedInstanceIndex();
|
||||
if (_187 > 0)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
int _192 = rayQuery.CommittedInstanceID();
|
||||
if (_192 > 0)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float3 _197 = rayQuery.CommittedObjectRayDirection();
|
||||
if (_197.z > 0.0f)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float3 _204 = rayQuery.CommittedObjectRayOrigin();
|
||||
if (_204.x > 0.0f)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
int _210 = rayQuery.CommittedPrimitiveIndex();
|
||||
if (_210 > 0)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float _215 = rayQuery.CommittedRayT();
|
||||
if (_215 > 0.0f)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
_376 = _363;
|
||||
_365 = _361;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
_376 = _363;
|
||||
_365 = _361;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (_365[0].x == _376[0].x)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
uint _230 = rayQuery.RayFlags();
|
||||
if (_230 > 256u)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float _236 = rayQuery.RayTMin();
|
||||
if (_236 > 0.0f)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
float3 _242 = rayQuery.WorldRayOrigin();
|
||||
float3 _244 = rayQuery.WorldRayDirection();
|
||||
if (_242.x == _244.z)
|
||||
{
|
||||
_17.Store(0, 0u);
|
||||
_17.Store(4, 0u);
|
||||
}
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _11 : register(u0);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_11.Store(0, asuint(asfloat(_11.Load(0)) * asfloat(_11.Load(96))));
|
||||
_11.Store4(16, asuint(asfloat(_11.Load4(16)) * asfloat(_11.Load4(112))));
|
||||
float4x4 _35 = asfloat(uint4x4(_11.Load4(128), _11.Load4(144), _11.Load4(160), _11.Load4(176)));
|
||||
float4x4 _37 = asfloat(uint4x4(_11.Load4(32), _11.Load4(48), _11.Load4(64), _11.Load4(80)));
|
||||
float4x4 _38 = mul(_35, _37);
|
||||
_11.Store4(32, asuint(_38[0]));
|
||||
_11.Store4(48, asuint(_38[1]));
|
||||
_11.Store4(64, asuint(_38[2]));
|
||||
_11.Store4(80, asuint(_38[3]));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _28 : register(u0);
|
||||
cbuffer UBO : register(b1)
|
||||
{
|
||||
int _68_index0 : packoffset(c0);
|
||||
int _68_index1 : packoffset(c0.y);
|
||||
};
|
||||
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
float4x4 _258 = asfloat(uint4x4(_28.Load(64), _28.Load(80), _28.Load(96), _28.Load(112), _28.Load(68), _28.Load(84), _28.Load(100), _28.Load(116), _28.Load(72), _28.Load(88), _28.Load(104), _28.Load(120), _28.Load(76), _28.Load(92), _28.Load(108), _28.Load(124)));
|
||||
_28.Store4(0, asuint(_258[0]));
|
||||
_28.Store4(16, asuint(_258[1]));
|
||||
_28.Store4(32, asuint(_258[2]));
|
||||
_28.Store4(48, asuint(_258[3]));
|
||||
float2x2 _261 = asfloat(uint2x2(_28.Load(144), _28.Load(152), _28.Load(148), _28.Load(156)));
|
||||
_28.Store2(128, asuint(_261[0]));
|
||||
_28.Store2(136, asuint(_261[1]));
|
||||
float2x3 _264 = asfloat(uint2x3(_28.Load(192), _28.Load(200), _28.Load(208), _28.Load(196), _28.Load(204), _28.Load(212)));
|
||||
_28.Store3(160, asuint(_264[0]));
|
||||
_28.Store3(176, asuint(_264[1]));
|
||||
float3x2 _267 = asfloat(uint3x2(_28.Load(240), _28.Load(256), _28.Load(244), _28.Load(260), _28.Load(248), _28.Load(264)));
|
||||
_28.Store2(216, asuint(_267[0]));
|
||||
_28.Store2(224, asuint(_267[1]));
|
||||
_28.Store2(232, asuint(_267[2]));
|
||||
float4x4 _271 = asfloat(uint4x4(_28.Load4(0), _28.Load4(16), _28.Load4(32), _28.Load4(48)));
|
||||
_28.Store(64, asuint(_271[0].x));
|
||||
_28.Store(68, asuint(_271[1].x));
|
||||
_28.Store(72, asuint(_271[2].x));
|
||||
_28.Store(76, asuint(_271[3].x));
|
||||
_28.Store(80, asuint(_271[0].y));
|
||||
_28.Store(84, asuint(_271[1].y));
|
||||
_28.Store(88, asuint(_271[2].y));
|
||||
_28.Store(92, asuint(_271[3].y));
|
||||
_28.Store(96, asuint(_271[0].z));
|
||||
_28.Store(100, asuint(_271[1].z));
|
||||
_28.Store(104, asuint(_271[2].z));
|
||||
_28.Store(108, asuint(_271[3].z));
|
||||
_28.Store(112, asuint(_271[0].w));
|
||||
_28.Store(116, asuint(_271[1].w));
|
||||
_28.Store(120, asuint(_271[2].w));
|
||||
_28.Store(124, asuint(_271[3].w));
|
||||
float2x2 _274 = asfloat(uint2x2(_28.Load2(128), _28.Load2(136)));
|
||||
_28.Store(144, asuint(_274[0].x));
|
||||
_28.Store(148, asuint(_274[1].x));
|
||||
_28.Store(152, asuint(_274[0].y));
|
||||
_28.Store(156, asuint(_274[1].y));
|
||||
float2x3 _277 = asfloat(uint2x3(_28.Load3(160), _28.Load3(176)));
|
||||
_28.Store(192, asuint(_277[0].x));
|
||||
_28.Store(196, asuint(_277[1].x));
|
||||
_28.Store(200, asuint(_277[0].y));
|
||||
_28.Store(204, asuint(_277[1].y));
|
||||
_28.Store(208, asuint(_277[0].z));
|
||||
_28.Store(212, asuint(_277[1].z));
|
||||
float3x2 _280 = asfloat(uint3x2(_28.Load2(216), _28.Load2(224), _28.Load2(232)));
|
||||
_28.Store(240, asuint(_280[0].x));
|
||||
_28.Store(244, asuint(_280[1].x));
|
||||
_28.Store(248, asuint(_280[2].x));
|
||||
_28.Store(256, asuint(_280[0].y));
|
||||
_28.Store(260, asuint(_280[1].y));
|
||||
_28.Store(264, asuint(_280[2].y));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 16 + 64, asuint(1.0f));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 8 + 144, asuint(2.0f));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 8 + 192, asuint(3.0f));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 16 + 240, asuint(4.0f));
|
||||
_28.Store(_68_index0 * 4 + 64, asuint(1.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 80, asuint(1.0f.xxxx.y));
|
||||
_28.Store(_68_index0 * 4 + 96, asuint(1.0f.xxxx.z));
|
||||
_28.Store(_68_index0 * 4 + 112, asuint(1.0f.xxxx.w));
|
||||
_28.Store(_68_index0 * 4 + 144, asuint(2.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 152, asuint(2.0f.xx.y));
|
||||
_28.Store(_68_index0 * 4 + 192, asuint(3.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 200, asuint(3.0f.xxx.y));
|
||||
_28.Store(_68_index0 * 4 + 208, asuint(3.0f.xxx.z));
|
||||
_28.Store(_68_index0 * 4 + 240, asuint(4.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 256, asuint(4.0f.xx.y));
|
||||
_28.Store(_68_index0 * 16 + _68_index1 * 4 + 0, asuint(1.0f));
|
||||
_28.Store(_68_index0 * 8 + _68_index1 * 4 + 128, asuint(2.0f));
|
||||
_28.Store(_68_index0 * 16 + _68_index1 * 4 + 160, asuint(3.0f));
|
||||
_28.Store(_68_index0 * 8 + _68_index1 * 4 + 216, asuint(4.0f));
|
||||
_28.Store4(_68_index0 * 16 + 0, asuint(1.0f.xxxx));
|
||||
_28.Store2(_68_index0 * 8 + 128, asuint(2.0f.xx));
|
||||
_28.Store3(_68_index0 * 16 + 160, asuint(3.0f.xxx));
|
||||
_28.Store2(_68_index0 * 8 + 216, asuint(4.0f.xx));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
third_party/spirv-cross/reference/opt/shaders-hlsl/comp/scalar-std450-distance-length-normalize.comp
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _9 : register(u0);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_9.Store(8, asuint(distance(asfloat(_9.Load(0)), asfloat(_9.Load(4)))));
|
||||
_9.Store(12, asuint(length(asfloat(_9.Load(0)))));
|
||||
_9.Store(16, asuint(sign(asfloat(_9.Load(0)))));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u);
|
||||
|
||||
ByteAddressBuffer _22 : register(t0);
|
||||
RWByteAddressBuffer _44 : register(u1);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
static uint gl_LocalInvocationIndex;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
uint gl_LocalInvocationIndex : SV_GroupIndex;
|
||||
};
|
||||
|
||||
groupshared float sShared[4];
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
sShared[gl_LocalInvocationIndex] = asfloat(_22.Load(gl_GlobalInvocationID.x * 4 + 0));
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
_44.Store(gl_GlobalInvocationID.x * 4 + 0, asuint(sShared[3u - gl_LocalInvocationIndex]));
|
||||
}
|
||||
|
||||
[numthreads(4, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
gl_LocalInvocationIndex = stage_input.gl_LocalInvocationIndex;
|
||||
comp_main();
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_0
|
||||
#define SPIRV_CROSS_CONSTANT_ID_0 100
|
||||
#endif
|
||||
static const int a = SPIRV_CROSS_CONSTANT_ID_0;
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_1
|
||||
#define SPIRV_CROSS_CONSTANT_ID_1 200
|
||||
#endif
|
||||
static const int b = SPIRV_CROSS_CONSTANT_ID_1;
|
||||
|
||||
struct A
|
||||
{
|
||||
int member0[a];
|
||||
int member1[b];
|
||||
};
|
||||
|
||||
struct B
|
||||
{
|
||||
int member0[b];
|
||||
int member1[a];
|
||||
};
|
||||
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_2
|
||||
#define SPIRV_CROSS_CONSTANT_ID_2 300
|
||||
#endif
|
||||
static const int c = SPIRV_CROSS_CONSTANT_ID_2;
|
||||
static const int d = (c + 50);
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_3
|
||||
#define SPIRV_CROSS_CONSTANT_ID_3 400
|
||||
#endif
|
||||
static const int e = SPIRV_CROSS_CONSTANT_ID_3;
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _22 : register(u0);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_22.Store(gl_GlobalInvocationID.x * 4 + 2800, uint(int(_22.Load(gl_GlobalInvocationID.x * 4 + 2800)) + (int(_22.Load(gl_GlobalInvocationID.x * 4 + 2400)) + e)));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_1
|
||||
#define SPIRV_CROSS_CONSTANT_ID_1 2
|
||||
#endif
|
||||
static const int b = SPIRV_CROSS_CONSTANT_ID_1;
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_0
|
||||
#define SPIRV_CROSS_CONSTANT_ID_0 1
|
||||
#endif
|
||||
static const int a = SPIRV_CROSS_CONSTANT_ID_0;
|
||||
static const uint _26 = (uint(a) + 0u);
|
||||
#ifndef SPIRV_CROSS_CONSTANT_ID_10
|
||||
#define SPIRV_CROSS_CONSTANT_ID_10 1u
|
||||
#endif
|
||||
static const uint _27 = SPIRV_CROSS_CONSTANT_ID_10;
|
||||
static const uint3 gl_WorkGroupSize = uint3(_27, 20u, 1u);
|
||||
static const uint _32 = gl_WorkGroupSize.x;
|
||||
static const uint _33 = (_26 + _32);
|
||||
static const uint _34 = gl_WorkGroupSize.y;
|
||||
static const uint _35 = (_33 + _34);
|
||||
static const int _42 = (1 - a);
|
||||
|
||||
RWByteAddressBuffer _23 : register(u0);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
int spec_const_array_size[b];
|
||||
spec_const_array_size[0] = 10;
|
||||
spec_const_array_size[1] = 40;
|
||||
spec_const_array_size[a] = a;
|
||||
_23.Store((_35 + gl_GlobalInvocationID.x) * 4 + 0, uint(b + spec_const_array_size[_42]));
|
||||
}
|
||||
|
||||
[numthreads(SPIRV_CROSS_CONSTANT_ID_10, 20, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
RWByteAddressBuffer _11 : register(u1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uint _14;
|
||||
_11.GetDimensions(_14);
|
||||
_14 = (_14 - 16) / 16;
|
||||
_11.Store(0, uint(int(_14)));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(1u, 1u, 1u);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
uniform float4 UBO[56];
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 aVertex;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 aVertex : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = (mul(aVertex, float4x4(UBO[40], UBO[41], UBO[42], UBO[43])) + UBO[55]) + ((UBO[50] + UBO[45]) + UBO[54].x.xxxx);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
aVertex = stage_input.aVertex;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
uniform float4 UBO[4];
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 aVertex;
|
||||
static float3 vNormal;
|
||||
static float3 aNormal;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 aVertex : TEXCOORD0;
|
||||
float3 aNormal : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float3 vNormal : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = mul(aVertex, float4x4(UBO[0], UBO[1], UBO[2], UBO[3]));
|
||||
vNormal = aNormal;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
aVertex = stage_input.aVertex;
|
||||
aNormal = stage_input.aNormal;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.vNormal = vNormal;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
struct Light
|
||||
{
|
||||
float3 Position;
|
||||
float Radius;
|
||||
float4 Color;
|
||||
};
|
||||
|
||||
uniform float4 UBO[12];
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 aVertex;
|
||||
static float4 vColor;
|
||||
static float3 aNormal;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 aVertex : TEXCOORD0;
|
||||
float3 aNormal : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = mul(aVertex, float4x4(UBO[0], UBO[1], UBO[2], UBO[3]));
|
||||
vColor = 0.0f.xxxx;
|
||||
for (int _96 = 0; _96 < 4; )
|
||||
{
|
||||
Light _51 = {UBO[_96 * 2 + 4].xyz, UBO[_96 * 2 + 4].w, UBO[_96 * 2 + 5]};
|
||||
float3 _68 = aVertex.xyz - _51.Position;
|
||||
vColor += ((UBO[_96 * 2 + 5] * clamp(1.0f - (length(_68) / _51.Radius), 0.0f, 1.0f)) * dot(aNormal, normalize(_68)));
|
||||
_96++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
aVertex = stage_input.aVertex;
|
||||
aNormal = stage_input.aNormal;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.vColor = vColor;
|
||||
return stage_output;
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
struct Light
|
||||
{
|
||||
float3 Position;
|
||||
float Radius;
|
||||
float4 Color;
|
||||
};
|
||||
|
||||
uniform float4 UBO[12];
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 aVertex;
|
||||
static float4 vColor;
|
||||
static float3 aNormal;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 aVertex : TEXCOORD0;
|
||||
float3 aNormal : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = mul(aVertex, float4x4(UBO[0], UBO[1], UBO[2], UBO[3]));
|
||||
vColor = 0.0f.xxxx;
|
||||
for (int _82 = 0; _82 < 4; )
|
||||
{
|
||||
float3 _54 = aVertex.xyz - UBO[_82 * 2 + 4].xyz;
|
||||
vColor += ((UBO[_82 * 2 + 5] * clamp(1.0f - (length(_54) / UBO[_82 * 2 + 4].w), 0.0f, 1.0f)) * dot(aNormal, normalize(_54)));
|
||||
_82++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
aVertex = stage_input.aVertex;
|
||||
aNormal = stage_input.aNormal;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.vColor = vColor;
|
||||
return stage_output;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
uniform float4 UBO[4];
|
||||
|
||||
static float3 FragColor;
|
||||
static float3 vNormal;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation float3 vNormal : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float3 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4x4 _19 = float4x4(UBO[0], UBO[1], UBO[2], UBO[3]);
|
||||
FragColor = mul(vNormal, float3x3(_19[0].xyz, _19[1].xyz, _19[2].xyz));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vNormal = stage_input.vNormal;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
uniform float4 UBO[14];
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 oA;
|
||||
static float4 oB;
|
||||
static float4 oC;
|
||||
static float4 oD;
|
||||
static float4 oE;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 oA : TEXCOORD0;
|
||||
float4 oB : TEXCOORD1;
|
||||
float4 oC : TEXCOORD2;
|
||||
float4 oD : TEXCOORD3;
|
||||
float4 oE : TEXCOORD4;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = 0.0f.xxxx;
|
||||
oA = UBO[1];
|
||||
oB = float4(UBO[4].y, UBO[5].y, UBO[6].y, UBO[7].y);
|
||||
oC = UBO[9];
|
||||
oD = float4(UBO[10].x, UBO[11].x, UBO[12].x, UBO[13].x);
|
||||
oE = float4(UBO[1].z, UBO[6].y, UBO[9].z, UBO[12].y);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.oA = oA;
|
||||
stage_output.oB = oB;
|
||||
stage_output.oC = oC;
|
||||
stage_output.oD = oD;
|
||||
stage_output.oE = oE;
|
||||
return stage_output;
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
uniform float4 UBO[15];
|
||||
|
||||
static float4 gl_Position;
|
||||
static int2 aIndex;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
int2 aIndex : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = UBO[aIndex.x * 5 + aIndex.y * 1 + 0];
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
aIndex = stage_input.aIndex;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
uniform float4 PushMe[6];
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 Pos;
|
||||
static float2 vRot;
|
||||
static float2 Rot;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 Rot : TEXCOORD0;
|
||||
float4 Pos : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 vRot : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = mul(Pos, float4x4(PushMe[0], PushMe[1], PushMe[2], PushMe[3]));
|
||||
vRot = mul(Rot, float2x2(PushMe[4].xy, PushMe[4].zw)) + PushMe[5].z.xx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
Pos = stage_input.Pos;
|
||||
Rot = stage_input.Rot;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.vRot = vRot;
|
||||
return stage_output;
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
uniform float4 UBO[12];
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 aVertex;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 aVertex : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = mul(aVertex, float4x4(UBO[0], UBO[1], UBO[2], UBO[3])) + mul(aVertex, transpose(float4x4(UBO[4], UBO[5], UBO[6], UBO[7])));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
aVertex = stage_input.aVertex;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
struct Light
|
||||
{
|
||||
float3 Position;
|
||||
float Radius;
|
||||
float4 Color;
|
||||
};
|
||||
|
||||
uniform float4 UBO[6];
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 aVertex;
|
||||
static float4 vColor;
|
||||
static float3 aNormal;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 aVertex : TEXCOORD0;
|
||||
float3 aNormal : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = mul(aVertex, float4x4(UBO[0], UBO[1], UBO[2], UBO[3]));
|
||||
vColor = 0.0f.xxxx;
|
||||
float3 _39 = aVertex.xyz - UBO[4].xyz;
|
||||
vColor += ((UBO[5] * clamp(1.0f - (length(_39) / UBO[4].w), 0.0f, 1.0f)) * dot(aNormal, normalize(_39)));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
aVertex = stage_input.aVertex;
|
||||
aNormal = stage_input.aNormal;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.vColor = vColor;
|
||||
return stage_output;
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
struct Foo
|
||||
{
|
||||
column_major float3x4 MVP0;
|
||||
column_major float3x4 MVP1;
|
||||
};
|
||||
|
||||
uniform float4 UBO[8];
|
||||
|
||||
static float4 v0;
|
||||
static float4 v1;
|
||||
static float3 V0;
|
||||
static float3 V1;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 v0 : TEXCOORD0;
|
||||
float4 v1 : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float3 V0 : TEXCOORD0;
|
||||
float3 V1 : TEXCOORD1;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
Foo _19 = {transpose(float4x3(UBO[0].xyz, UBO[1].xyz, UBO[2].xyz, UBO[3].xyz)), transpose(float4x3(UBO[4].xyz, UBO[5].xyz, UBO[6].xyz, UBO[7].xyz))};
|
||||
Foo _20 = _19;
|
||||
V0 = mul(_20.MVP0, v0);
|
||||
V1 = mul(_20.MVP1, v1);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
v0 = stage_input.v0;
|
||||
v1 = stage_input.v1;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.V0 = V0;
|
||||
stage_output.V1 = V1;
|
||||
return stage_output;
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
uniform float4 UBO[8];
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 oA;
|
||||
static float4 oB;
|
||||
static float4 oC;
|
||||
static float4 oD;
|
||||
static float4 oE;
|
||||
static float4 oF;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 oA : TEXCOORD0;
|
||||
float4 oB : TEXCOORD1;
|
||||
float4 oC : TEXCOORD2;
|
||||
float4 oD : TEXCOORD3;
|
||||
float4 oE : TEXCOORD4;
|
||||
float4 oF : TEXCOORD5;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = 0.0f.xxxx;
|
||||
oA = UBO[0];
|
||||
oB = float4(UBO[1].xy, UBO[1].zw);
|
||||
oC = float4(UBO[2].x, UBO[3].xyz);
|
||||
oD = float4(UBO[4].xyz, UBO[4].w);
|
||||
oE = float4(UBO[5].x, UBO[5].y, UBO[5].z, UBO[5].w);
|
||||
oF = float4(UBO[6].x, UBO[6].zw, UBO[7].x);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.oA = oA;
|
||||
stage_output.oB = oB;
|
||||
stage_output.oC = oC;
|
||||
stage_output.oD = oD;
|
||||
stage_output.oE = oE;
|
||||
stage_output.oF = oF;
|
||||
return stage_output;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
uniform int4 UBO1[2];
|
||||
uniform uint4 UBO2[2];
|
||||
uniform float4 UBO0[2];
|
||||
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = ((((float4(UBO1[0]) + float4(UBO1[1])) + float4(UBO2[0])) + float4(UBO2[1])) + UBO0[0]) + UBO0[1];
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
static const float _17[5] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f };
|
||||
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
for (int _46 = 0; _46 < 4; )
|
||||
{
|
||||
int _33 = _46 + 1;
|
||||
FragColor += _17[_33].xxxx;
|
||||
_46 = _33;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
static float3 FragColor;
|
||||
static float4 vColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : COLOR0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = vColor.xyz;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vColor = stage_input.vColor;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = float4(FragColor, 0.0);
|
||||
return stage_output;
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
static float3 FragColor;
|
||||
static float4 vColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float3 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = vColor.xyz;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vColor = stage_input.vColor;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
Texture2D<float4> uTex : register(t0);
|
||||
SamplerState _uTex_sampler : register(s0);
|
||||
|
||||
static float4 FragColor;
|
||||
static float4 vColor;
|
||||
static float2 vTex;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
float2 vTex : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = vColor * uTex.Sample(_uTex_sampler, vTex);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vColor = stage_input.vColor;
|
||||
vTex = stage_input.vTex;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
static float2 value;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 value : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float4(1.0f, 0.0f, asfloat(asint(value.x)), 1.0f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
value = stage_input.value;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
static float2 FragColor;
|
||||
static float2 x0;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 x0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
bool2 _27 = (x0.x > x0.y).xx;
|
||||
FragColor = float2(_27.x ? float2(1.0f, 0.0f).x : float2(0.0f, 1.0f).x, _27.y ? float2(1.0f, 0.0f).y : float2(0.0f, 1.0f).y);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
x0 = stage_input.x0;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
static float4 gl_FragCoord;
|
||||
static float gl_FragDepth;
|
||||
static float4 FragColor;
|
||||
static float4 vColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
float gl_FragDepth : SV_Depth;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = gl_FragCoord + vColor;
|
||||
gl_FragDepth = 0.5f;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
gl_FragCoord.w = 1.0 / gl_FragCoord.w;
|
||||
vColor = stage_input.vColor;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_FragDepth = gl_FragDepth;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
static bool _47;
|
||||
|
||||
static float2 value;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 value : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
bool2 _25 = bool2(value.x == 0.0f, _47);
|
||||
FragColor = float4(1.0f, 0.0f, float(bool2(!_25.x, !_25.y).x), float(bool2(value.x <= float2(1.5f, 0.5f).x, value.y <= float2(1.5f, 0.5f).y).x));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
value = stage_input.value;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
static float gl_ClipDistance[2];
|
||||
static float gl_CullDistance[1];
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 gl_ClipDistance0 : SV_ClipDistance0;
|
||||
float gl_CullDistance0 : SV_CullDistance0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (gl_ClipDistance[0] + gl_CullDistance[0]) + gl_ClipDistance[1];
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_ClipDistance[0] = stage_input.gl_ClipDistance0.x;
|
||||
gl_ClipDistance[1] = stage_input.gl_ClipDistance0.y;
|
||||
gl_CullDistance[0] = stage_input.gl_CullDistance0.x;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
Texture2D<float4> uSampler : register(t0);
|
||||
SamplerState _uSampler_sampler : register(s0);
|
||||
Texture2D<float4> uSamplerShadow : register(t1);
|
||||
SamplerComparisonState _uSamplerShadow_sampler : register(s1);
|
||||
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (uSampler.Sample(_uSampler_sampler, 1.0f.xx) + uSampler.Load(int3(int2(10, 10), 0))).x + uSamplerShadow.SampleCmp(_uSamplerShadow_sampler, 1.0f.xxx.xy, 1.0f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
Texture2D<float4> uDepth : register(t2);
|
||||
SamplerComparisonState uSampler : register(s0);
|
||||
SamplerState uSampler1 : register(s1);
|
||||
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uDepth.SampleCmp(uSampler, 1.0f.xxx.xy, 1.0f) + uDepth.Sample(uSampler1, 1.0f.xx).x;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
RWByteAddressBuffer _34 : register(u0);
|
||||
Texture2D<int4> Buf : register(t1);
|
||||
SamplerState _Buf_sampler : register(s1);
|
||||
|
||||
static float4 gl_FragCoord;
|
||||
static int vIn;
|
||||
static int vIn2;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int vIn : TEXCOORD0;
|
||||
nointerpolation int vIn2 : TEXCOORD1;
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
int _40 = Buf.Load(int3(int2(gl_FragCoord.xy), 0)).x % 16;
|
||||
FragColor = (asfloat(_34.Load4(_40 * 16 + 0)) + asfloat(_34.Load4(_40 * 16 + 0))) + asfloat(_34.Load4(((vIn * vIn) + (vIn2 * vIn2)) * 16 + 0));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
gl_FragCoord.w = 1.0 / gl_FragCoord.w;
|
||||
vIn = stage_input.vIn;
|
||||
vIn2 = stage_input.vIn2;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
struct Foo
|
||||
{
|
||||
float a;
|
||||
float b;
|
||||
};
|
||||
|
||||
static const float _16[4] = { 1.0f, 4.0f, 3.0f, 2.0f };
|
||||
static const Foo _24 = { 10.0f, 20.0f };
|
||||
static const Foo _27 = { 30.0f, 40.0f };
|
||||
static const Foo _28[2] = { { 10.0f, 20.0f }, { 30.0f, 40.0f } };
|
||||
|
||||
static float4 FragColor;
|
||||
static int _line;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int _line : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = _16[_line].xxxx;
|
||||
FragColor += (_28[_line].a * _28[1 - _line].a).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
_line = stage_input._line;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
Texture2D<float4> uSampler : register(t0);
|
||||
SamplerState _uSampler_sampler : register(s0);
|
||||
|
||||
static float4 FragColor;
|
||||
static float4 vInput;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vInput : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = vInput;
|
||||
float4 _23 = uSampler.Sample(_uSampler_sampler, vInput.xy);
|
||||
float4 _26 = ddx(vInput);
|
||||
float4 _29 = ddy(vInput);
|
||||
float4 _32 = fwidth(vInput);
|
||||
float4 _35 = ddx_coarse(vInput);
|
||||
float4 _38 = ddy_coarse(vInput);
|
||||
float4 _41 = fwidth(vInput);
|
||||
float4 _44 = ddx_fine(vInput);
|
||||
float4 _47 = ddy_fine(vInput);
|
||||
float4 _50 = fwidth(vInput);
|
||||
float _56_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vInput.zw);
|
||||
float2 _56 = _56_tmp.xx;
|
||||
if (vInput.y > 10.0f)
|
||||
{
|
||||
FragColor += _23;
|
||||
FragColor += _26;
|
||||
FragColor += _29;
|
||||
FragColor += _32;
|
||||
FragColor += _35;
|
||||
FragColor += _38;
|
||||
FragColor += _41;
|
||||
FragColor += _44;
|
||||
FragColor += _47;
|
||||
FragColor += _50;
|
||||
FragColor += _56.xyxy;
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vInput = stage_input.vInput;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
void frag_main()
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
static float gl_FragDepth;
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float gl_FragDepth : SV_DepthGreaterEqual;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
gl_FragDepth = 0.5f;
|
||||
}
|
||||
|
||||
[earlydepthstencil]
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_FragDepth = gl_FragDepth;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
static float gl_FragDepth;
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float gl_FragDepth : SV_DepthLessEqual;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
gl_FragDepth = 0.5f;
|
||||
}
|
||||
|
||||
[earlydepthstencil]
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_FragDepth = gl_FragDepth;
|
||||
return stage_output;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
static float4 FragColor0;
|
||||
static float4 FragColor1;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor0 : SV_Target0;
|
||||
float4 FragColor1 : SV_Target1;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor0 = 1.0f.xxxx;
|
||||
FragColor1 = 2.0f.xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor0 = FragColor0;
|
||||
stage_output.FragColor1 = FragColor1;
|
||||
return stage_output;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
[earlydepthstencil]
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = 0.0f.xxxx;
|
||||
for (int _43 = 0; _43 < 3; )
|
||||
{
|
||||
FragColor[_43] += float(_43);
|
||||
_43++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
static float2 FP32Out;
|
||||
static uint FP16;
|
||||
static uint FP16Out;
|
||||
static float2 FP32;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation uint FP16 : TEXCOORD0;
|
||||
nointerpolation float2 FP32 : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 FP32Out : SV_Target0;
|
||||
uint FP16Out : SV_Target1;
|
||||
};
|
||||
|
||||
uint spvPackHalf2x16(float2 value)
|
||||
{
|
||||
uint2 Packed = f32tof16(value);
|
||||
return Packed.x | (Packed.y << 16);
|
||||
}
|
||||
|
||||
float2 spvUnpackHalf2x16(uint value)
|
||||
{
|
||||
return f16tof32(uint2(value & 0xffff, value >> 16));
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FP32Out = spvUnpackHalf2x16(FP16);
|
||||
FP16Out = spvPackHalf2x16(FP32);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
FP16 = stage_input.FP16;
|
||||
FP32 = stage_input.FP32;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FP32Out = FP32Out;
|
||||
stage_output.FP16Out = FP16Out;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
static bool gl_FrontFacing;
|
||||
static float4 FragColor;
|
||||
static float4 vA;
|
||||
static float4 vB;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vA : TEXCOORD0;
|
||||
float4 vB : TEXCOORD1;
|
||||
bool gl_FrontFacing : SV_IsFrontFace;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
if (gl_FrontFacing)
|
||||
{
|
||||
FragColor = vA;
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor = vB;
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FrontFacing = stage_input.gl_FrontFacing;
|
||||
vA = stage_input.vA;
|
||||
vB = stage_input.vB;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
static float4 result;
|
||||
static float scalar;
|
||||
static float3 _vector;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float scalar : TEXCOORD0;
|
||||
float3 _vector : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 result : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
result = 1.0f.xxxx;
|
||||
result.w *= sinh(scalar);
|
||||
result.w *= cosh(scalar);
|
||||
result.w *= tanh(scalar);
|
||||
result.w *= log(scalar + sqrt(scalar * scalar + 1.0f));
|
||||
result.w *= log(scalar + sqrt(scalar * scalar - 1.0f));
|
||||
result.w *= (log((1.0f + scalar) / (1.0f - scalar)) * 0.5f);
|
||||
float4 _58 = result;
|
||||
float3 _60 = _58.xyz * sinh(_vector);
|
||||
result.x = _60.x;
|
||||
result.y = _60.y;
|
||||
result.z = _60.z;
|
||||
float4 _72 = result;
|
||||
float3 _74 = _72.xyz * cosh(_vector);
|
||||
result.x = _74.x;
|
||||
result.y = _74.y;
|
||||
result.z = _74.z;
|
||||
float4 _83 = result;
|
||||
float3 _85 = _83.xyz * tanh(_vector);
|
||||
result.x = _85.x;
|
||||
result.y = _85.y;
|
||||
result.z = _85.z;
|
||||
float4 _94 = result;
|
||||
float3 _96 = _94.xyz * log(_vector + sqrt(_vector * _vector + 1.0f));
|
||||
result.x = _96.x;
|
||||
result.y = _96.y;
|
||||
result.z = _96.z;
|
||||
float4 _105 = result;
|
||||
float3 _107 = _105.xyz * log(_vector + sqrt(_vector * _vector - 1.0f));
|
||||
result.x = _107.x;
|
||||
result.y = _107.y;
|
||||
result.z = _107.z;
|
||||
float4 _116 = result;
|
||||
float3 _118 = _116.xyz * (log((1.0f + _vector) / (1.0f - _vector)) * 0.5f);
|
||||
result.x = _118.x;
|
||||
result.y = _118.y;
|
||||
result.z = _118.z;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
scalar = stage_input.scalar;
|
||||
_vector = stage_input._vector;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.result = result;
|
||||
return stage_output;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user