hanskristian-work / dxil-spirv Goto Github PK
View Code? Open in Web Editor NEWDXIL conversion to SPIR-V for D3D12 translation libraries
License: Other
DXIL conversion to SPIR-V for D3D12 translation libraries
License: Other
cfg_structurizer.cpp@master Line 2889 is asserting with the attached dxil.
The DXIL shader I am testing fails at parseIR with the AtEndOfStream check with 12 bytes left. I have attached the DXIL file below.
Hi,
I'm unsure if this belongs here or in vkd3d-proton
.
Reproducible with latest vkd3d-proton
& dxil-spirv
on F1 2021.
20568.822:010c:01ac:trace:seh:raise (22)
Assertion failed: std::find(succ.begin(), succ.end(), to_next) == succ.end(), file ../src-vkd3d-proton/subprojects/dxil-spirv/node.cpp, line 354
Originally posted in Proton issue: ValveSoftware/Proton#4966 (comment)
Cheers,
David
convert fail with prompt "can't found dxil blob"
Code2.zip
I'm encountering the following error while attempting to run Cyberpunk 2077 with Proton 5.13-4:
Dec 12 01:19:00 steam steam.desktop[17194]: 216:err:vkd3d_dxil_log_callback: dxil-spirv: Raw 16-bit load-store was used, which must be implemented with SSBO or BDA.
Dec 12 01:19:00 steam steam.desktop[17194]: 216:err:vkd3d_dxil_log_callback: dxil-spirv: Failed to convert function.
More details here: ValveSoftware/Proton#4450 (comment)
Since adding the above comment on the ValveSoftware/Proton issue tracker I have updated to the latest Mesa git:
steam@steam:~$ glxinfo | grep OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon R9 200 Series (HAWAII, DRM 3.39.0, 5.9.0-4-amd64, LLVM 11.0.0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.0.0-devel (git-d7911f9c6b)
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.0.0-devel (git-d7911f9c6b)
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.0.0-devel (git-d7911f9c6b)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
It seems in certain rare instances the recompute_immediate_post_dominator can end up in a recursive infinite loop.
To reproduce, clone https://github.com/Juice-Labs/vkd3d-proton/tree/dxil-converter (branch dxil-converter).
Apply the attached patch to node.cpp in the dxil-spirv subproject and then run the vkd3d-proton-converter program with the attached bin file as the first and only argument. This will execute a serialized conversion call from the game I am debugging and reproduces the stack overflow. Some changes may need to be done if your build has a different order of elements in node 96's fake_succ. Comments are in node.cpp with the ordering from the game that causes the stack overflow.
meson command-line used on Windows with Visual Studio 2019
meson setup --backend=vs2019 --buildtype=debugoptimized build\debugoptimized_vs2019 -Denable_extras=true
Also attached is a mini dump of the stack overflow.
recursive-error.zip
Please let me know if you have any issues.
Hey! Trying to launch BF 2042 using latest bleeding-edge Proton Experimental (should contain latest dxil-spirv) leads to Assertion Failed! error.
Here are also packed to zip shaders what are generated when trying to launch 2042: 2042.zip
6cd20427d70bda04.dxil from https://gpuopen.com/learn/sample-tressfx/ hits this assert:
dxil-spirv/node.cpp:290: static dxil_spv::CFGNode* dxil_spv::CFGNode::find_common_post_dominator(dxil_spv::CFGNode*, dxil_spv::CFGNode*): Assertion `a->immediate_post_dominator' failed.
shaders:
tressfx-shaders.zip
Faulting DXIL:
gotg_rt_crash_dxil.zip
Backtrace:
#0 0x00007ffff7e8adf6 in dxil_spv::CFGNode::dominates (this=0x555555dafff0, other=0x0) at node.cpp:95
#1 0x00007ffff7e631fc in dxil_spv::CFGStructurizer::find_switch_blocks (this=0x7fffffffb5d0, pass=0) at cfg_structurizer.cpp:2056
#2 0x00007ffff7e67318 in dxil_spv::CFGStructurizer::structurize (this=0x7fffffffb5d0, pass=0) at cfg_structurizer.cpp:3067
#3 0x00007ffff7e5c2d8 in dxil_spv::CFGStructurizer::run (this=0x7fffffffb5d0) at cfg_structurizer.cpp:382
#4 0x00007ffff7dfd2cd in dxil_spv_converter_run (converter=0x555555b85ea0) at dxil_spirv_c.cpp:531
#5 0x0000555555582628 in main (argc=2, argv=0x7fffffffdca8) at dxil_spirv.cpp:900
Failure when compiling https://github.com/HansKristian-Work/vkd3d-proton as PE's for Wine:
FAILED: subprojects/dxil-spirv/libdxil-spirv.a.p/bc_module.cpp.obj
x86_64-w64-mingw32-g++ -Isubprojects/dxil-spirv/libdxil-spirv.a.p -Isubprojects/dxil-spirv -I../../vkd3d-proton/subprojects/dxil-spirv -I../../vkd3d-proton/subprojects/dxil-spirv/bc -I../../vkd3d-proton/subprojects/dxil-spirv/debug -I../../vkd3d-proton/subprojects/dxil-spirv/util -I../../vkd3d-proton/subprojects/dxil-spirv/third_party/bc-decoder -I../../vkd3d-proton/subprojects/dxil-spirv/third_party/glslang-spirv -I../../vkd3d-proton/subprojects/dxil-spirv/third_party/spirv-headers/include/spirv/unified1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++14 -DAMD_EXTENSIONS -DHAVE_LLVMBC -DNOMINMAX -Wno-missing-field-initializers -Wno-empty-body -ffast-math -Wno-unused-parameter -fno-exceptions -fvisibility=hidden -march=native -mtune=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -w -Wno-deprecated-declarations -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fpermissive -MD -MQ subprojects/dxil-spirv/libdxil-spirv.a.p/bc_module.cpp.obj -MF subprojects/dxil-spirv/libdxil-spirv.a.p/bc_module.cpp.obj.d -o subprojects/dxil-spirv/libdxil-spirv.a.p/bc_module.cpp.obj -c ../../vkd3d-proton/subprojects/dxil-spirv/bc/module.cpp
during RTL pass: final
In file included from /usr/x86_64-w64-mingw32/include/c++/12.2.0/vector:64,
from ../../vkd3d-proton/subprojects/dxil-spirv/util/thread_local_allocator.hpp:27,
from ../../vkd3d-proton/subprojects/dxil-spirv/bc/data_structures.hpp:27,
from ../../vkd3d-proton/subprojects/dxil-spirv/bc/module.hpp:27,
from ../../vkd3d-proton/subprojects/dxil-spirv/bc/module.cpp:25:
/usr/x86_64-w64-mingw32/include/c++/12.2.0/bits/stl_vector.h: In function 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = long long unsigned int; _Alloc = dxil_spv::ThreadLocalAllocator<long long unsigned int>]':
/usr/x86_64-w64-mingw32/include/c++/12.2.0/bits/stl_vector.h:1144:7: internal compiler error: in seh_emit_stackalloc, at config/i386/winnt.cc:1055
1144 | }
| ^
0x1b5de97 internal_error(char const*, ...)
???:0
0x6a0bea fancy_abort(char const*, int, char const*)
???:0
0x1162278 i386_pe_seh_unwind_emit(_IO_FILE*, rtx_insn*)
???:0
0xa78c3b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
???:0
Sorry for reporting: Fixed by โ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458
Hi,
finally looking into issues on 3 DXR NV demos:
HansKristian-Work/vkd3d-proton#596
there attached a patch to be able to run Reflections demo (and also Atomic Heart) under VKD3D..
Reflections demo renders OK, Atomic Heart still no seems some issue still present..
anyway last one is Justice RTX demo and did a VKD3D debug build to dump shaders as log was showing failing cause:
170:info:vkd3d_shader_dump_blob: Dumping blob to ./vkd3dshaders/f990137678a6ba18.lib.dxil.
0170:err:msvcrt:msvcrt_get_flags incorrect mode flag: x
0170:err:vkd3d_dxil_log_callback: dxil-spirv: Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private.
I attach this shader:
f990137678a6ba18.lib.zip
I can confirm manually by running:
./dxil-spirv f990137678a6ba18.lib.dxil
[ERROR]: Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private.
that this is the failing shader..
hope you can give a look..
sadly from source code I see:
// Have to deal with this from the outside. Should only be relevant for getelementptr and instructions like that.
LOGE("Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private.\n");
hope fix is not difficult to implement..
thanks..
Trying to get Greed of Man beta to work with proton, but it crashes when joining a lobby with the following error:
25155.030:019c:01ac:trace:seh:raise (22)
Assertion failed: frontier, file ../src-vkd3d-proton/subprojects/dxil-spirv/cfg_structurizer.cpp, line 1290
Hello HansKristian,
I am getting the following error when I keep my dxil files in a folder shaders/dk:
[ERROR]: Failed to parse blob.
Error: Command '['build/dxil-spirv', '--output', '/tmp/tmpw8s9hededilan_gt1.qcc!eva_player_exe-Context-fb417d660ba93b43-Compile-170.PS.dc0d44c1.dxil', 'shaders/dk/dilan_gt1.qcc!eva_player_exe-Context-fb417d660ba93b43-Compile-170.PS.dc0d44c1.dxil', '--vertex-input', 'ATTR', '0', '--asm', '--glsl', '--validate', '--ssbo-uav', '--ssbo-srv']' returned non-zero exit status 1
I am using Ubuntu 16.04, g++ version 7.5.0.
I used to be able to boot into Horizon: Zero Dawn just fine, despite barely playable performance - now I'm back to crashing at launch.
Looking through the logs, I see two dxil-spirv errors which declare:
316:err:vkd3d_dxil_log_callback: dxil-spirv: There is no candidate for ladder merging.
Hi,
will try to capture dxil shaders later but for now fails..
log with:
07:49:37.279 INFO workload: 990c:err:vkd3d_dxil_log_callback: dxil-spirv: Unimplemented DXIL opcode 177
07:49:37.279 INFO workload: 990c:err:vkd3d_dxil_log_callback: dxil-spirv: Failed to emit instruction.
07:49:37.279 INFO workload: 990c:err:vkd3d_dxil_log_callback: dxil-spirv: Failed to convert function.
07:49:37.279 INFO workload: 990c:err:vkd3d_dxil_log_callback: dxil-spirv: Unimplemented DXIL opcode 177
07:49:37.279 INFO workload: 990c:err:vkd3d_dxil_log_callback: dxil-spirv: Failed to emit instruction.
07:49:37.279 INFO workload: 990c:err:vkd3d_dxil_log_callback: dxil-spirv: Failed to convert function.
EDIT: using latest master & VKD3D_FEATURE_LEVEL=12_2 on a RTX 4070
I've bisected HansKristian-Work/vkd3d-proton#1357 down to commit d3947f7.
Issue is happening since this commit was made.
For some cases, it could be interesting to go in the opposite direction (SPIR-V to DXIL), what would you believe would be the level of difficulty in implementing this?
In reference to earlier today's ticket at: HansKristian-Work/vkd3d-proton#212
I've tried to build dxil-spirv by itself without vkd3d but the compile still fails.
Steps I took:
Let me know if there's anything else I could try.
we can get the variable names and register binding, but the glsl outputs do not contain them
ZIP containing DXIL + invalid translated SPIR-V to reproduce: shaders.zip
For later, this shader fails CFG validation.
float main(int4 i : I) : SV_Target
{
[loop]
for (;;)
{
switch (i.x)
{
case 5:
i.x++;
i = i.yzwx;
continue;
case 7:
i.x += 10;
i = i.yzwx;
continue;
default:
break;
}
i = i.yzwx;
break;
}
return float(i.x + i.y);
}
Maybe renaming "spirv-headers" into "SPIRV-Headers" for consistency.
It helps a bit when packaging, as you can activate all modules in a loop:
for Module in "${Modules[@]}"; do
so git submodule init "${Dir}/${Module}"
so git submodule set-url "${Dir}/${Module}" "${srcdir}/${Module#*/}"
so git -c protocol.file.allow=always submodule update "${Dir}/${Module}"
done
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.