http://bugs.winehq.org/show_bug.cgi?id=24614
Summary: Medieval Total War crashes on startup Product: Wine Version: 1.2 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3dx9 AssignedTo: wine-bugs@winehq.org ReportedBy: th.seltsam@gmail.com CC: wine-bugs@winehq.org
Running the game just shows a black window, no crash dialog, and an infinite console output err:d3dx:assemble-shader Asm reading failed err:d3dx:assemble-shader Asm reading failed err:d3dx:assemble-shader Asm reading failed err:d3dx:assemble-shader Asm reading failed
Using d3dx9-36 did not solve the problem.
http://bugs.winehq.org/show_bug.cgi?id=24614
Thomas th.seltsam@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Medieval Total War crashes |Medieval Total War II |on startup |crashes on startup
http://bugs.winehq.org/show_bug.cgi?id=24614
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #1 from joaopa jeremielapuree@yahoo.fr 2010-10-03 17:15:53 CDT --- Does this demo show the same problem?
http://www.jeuxvideopc.com/demo/9761-medieval-2-total-war.php
http://bugs.winehq.org/show_bug.cgi?id=24614
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |matteo.mystral@gmail.com
--- Comment #2 from Matteo Bruni matteo.mystral@gmail.com 2010-10-04 06:49:35 CDT --- Can you retest with a newer Wine version?
http://bugs.winehq.org/show_bug.cgi?id=24614
Thomas th.seltsam@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.2 |1.3.4
--- Comment #3 from Thomas th.seltsam@gmail.com 2010-10-05 16:13:01 CDT --- (In reply to comment #2)
Can you retest with a newer Wine version?
Updated to 1.3.4, Downloaded the two files from the link mentioned in #1:
For Medieval II Total War Demo and Medieval II Total War Demo screen blanks and freezes. Console: fixme:win:EnumDisplayDevicesW ((null),0,0x32adcc,0x00000000), stub! fixme:d3d:swapchain_init Add OpenGL context recreation support to context_validate_onscreen_formats fixme:win:EnumDisplayDevicesW ((null),0,0x32a354,0x00000000), stub! fixme:win:EnumDisplayDevicesW ((null),0,0x329d90,0x00000000), stub! do_wait: drmWaitVBlank returned -1, IRQs don't seem to be working correctly. Try adjusting the vblank_mode configuration parameter. fixme:win:EnumDisplayDevicesW ((null),0,0x329e80,0x00000000), stub! fixme:mixer:ALSA_MixerInit No master control found on ThinkPad Console Audio Control, disabling mixer fixme:devenum:DEVENUM_ICreateDevEnum_CreateClassEnumerator Category {cc7bfb41-f175-11d1-a392-00e0291f3959} not found fixme:devenum:DEVENUM_ICreateDevEnum_CreateClassEnumerator Category {cc7bfb46-f175-11d1-a392-00e0291f3959} not found err:d3d:IWineD3DDeviceImpl_Reset Cannot change the back buffer count yet err:d3d:IWineD3DDeviceImpl_Reset Cannot change the back buffer format yet fixme:d3d9:Direct3DShaderValidatorCreate9 stub
For the Medieval II Total War Game I get err:d3dcompiler:assemble_shader Asm reading failed for d3d
Changed version to 1.3.4
http://bugs.winehq.org/show_bug.cgi?id=24614
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.3.4 |1.2
--- Comment #4 from Dmitry Timoshkov dmitry@codeweavers.com 2010-10-06 00:55:45 CDT --- Please don't change an originally reported Wine version.
http://bugs.winehq.org/show_bug.cgi?id=24614
Xavier Vachon xvachon@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |xvachon@gmail.com
--- Comment #5 from Xavier Vachon xvachon@gmail.com 2010-11-22 15:52:55 CST --- This is still an issue in 1.3.7. It seems that this has evolved since, because winetricks d3dx9_36 solves it for me. This was tested in a clean prefix.
http://bugs.winehq.org/show_bug.cgi?id=24614
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com
--- Comment #6 from Jerome Leclanche adys.wh@gmail.com 2011-02-08 21:55:45 CST --- A patch was sent, but is still in pending state.
http://www.winehq.org/pipermail/wine-patches/2011-February/098609.html
http://bugs.winehq.org/show_bug.cgi?id=24614
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #7 from Dan Kegel dank@kegel.com 2011-07-03 18:21:37 CDT --- *** Bug 27678 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=24614
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |wylda@volny.cz Ever Confirmed|0 |1
--- Comment #8 from Wylda wylda@volny.cz 2011-07-04 02:30:15 CDT ---
Dan's duplicate confirm this, marking NEW.
http://bugs.winehq.org/show_bug.cgi?id=24614
--- Comment #9 from Dan Kegel dank@kegel.com 2011-07-04 06:25:01 CDT --- Created an attachment (id=35425) --> (http://bugs.winehq.org/attachment.cgi?id=35425) Patch that adds an assembly mode in the preprocessor, and turns it on when needed.
I can't reproduce the problem with the demo (though I can with yu-gi-oh online).
Does this patch help? It adds an assembly parsing mode. It's the kind of kludge that might actually get used in practice, with enough duct tape.
This has Matteo's tests from the last try, except for the one designed to show that native has errors when preprocessing assembly with comments, since this approach doesn't have those errors.
http://bugs.winehq.org/show_bug.cgi?id=24614
quan chi m4ag@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |m4ag@hotmail.com
--- Comment #10 from quan chi m4ag@hotmail.com 2011-09-28 06:05:39 CDT --- when i start midieval 2 up it tells me ca-libs wtf should i do
http://bugs.winehq.org/show_bug.cgi?id=24614
Julian Rüger jr98@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jr98@gmx.net
http://bugs.winehq.org/show_bug.cgi?id=24614
higuita higuita@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |higuita@gmx.net
https://bugs.winehq.org/show_bug.cgi?id=24614
--- Comment #11 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for two years. Is this still an issue in current (1.7.25 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=24614
--- Comment #12 from Matteo Bruni matteo.mystral@gmail.com --- (In reply to Austin English from comment #11)
This is your friendly reminder that there has been no bug activity for two years. Is this still an issue in current (1.7.25 or newer) wine?
Safe to say it still is. It's not immediately clear from the comments but the issue here is with D3D ASM shaders containing comments starting with ';'. Native d3dx9_xx is a workaround.
https://bugs.winehq.org/show_bug.cgi?id=24614
--- Comment #13 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.51 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=24614
--- Comment #14 from Matteo Bruni matteo.mystral@gmail.com --- (In reply to Austin English from comment #13)
This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.51 or newer) wine?
See comment 12.
https://bugs.winehq.org/show_bug.cgi?id=24614
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Summary|Medieval Total War II |Medieval II: Total War |crashes on startup |(Sega) crashes on startup | |or hangs (D3D ASM shader | |comment parsing | |incomplete)('winetricks -q | |d3dx9_36' is a workaround)
--- Comment #15 from Anastasius Focht focht@gmx.net --- Hello folks,
still present but it now hangs in endless loop (no crash). I was looking for another issue (bug 31020) but encountered this one.
--- snip ---
Wine-dbg>bt Backtrace: =>0 0xf7737ba0 __kernel_vsyscall+0x10() in [vdso].so (0x0032a6c8) 1 0xf73c16d2 __xstat64@GLIBC_2+0x21() in libc.so.6 (0x0032a6c8) 2 0xf738868a __tzfile_read+0x109() in libc.so.6 (0x0032a6c8) 3 0xf738833c __tz_convert+0x10b() in libc.so.6 (0xf74a8780) 4 0xf7386301 localtime+0x20() in libc.so.6 (0x0032a788) 5 0x7ecfb9ee add_special_defines+0x58() [/home/focht/projects/wine/wine.repo/src/libs/wpp/wpp.c:71] in d3dcompiler_43 (0x0032a788) 6 0x7ecfbd35 wpp_parse+0x4d(input="", output=(nil)) [/home/focht/projects/wine/wine.repo/src/libs/wpp/wpp.c:197] in d3dcompiler_43 (0x0032a7a8) 7 0x7ecd8e80 preprocess_shader+0xd4(data=0x36afa28, data_size=0x36b, filename=0x0(nil), defines=(nil), include=(nil), error_messages=0x32a8f4) [/home/focht/projects/wine/wine.repo/src/dlls/d3dcompiler_43/compiler.c:349] in d3dcompiler_43 (0x0032a808) 8 0x7ecd957a D3DAssemble+0xf9(data=<couldn't compute location>, datasize=<couldn't compute location>, filename=<couldn't compute location>, defines=<couldn't compute location>, include=<couldn't compute location>, flags=<couldn't compute location>, shader=<couldn't compute location>, error_messages=<couldn't compute location>) [/home/focht/projects/wine/wine.repo/src/dlls/d3dcompiler_43/compiler.c:486] in d3dcompiler_43 (0x0032a858) 9 0x7ed940de D3DXAssembleShader+0x7d(data=<couldn't compute location>, data_len=<couldn't compute location>, defines=<couldn't compute location>, include=<couldn't compute location>, flags=<couldn't compute location>, shader=<couldn't compute location>, error_messages=<couldn't compute location>) [/home/focht/projects/wine/wine.repo/src/dlls/d3dx9_36/shader.c:212] in d3dx9_36 (0x0032a8a8) ... --- snip ---
Refining summary and state the workaround.
$ wine --version wine-1.7.55
Regards
https://bugs.winehq.org/show_bug.cgi?id=24614
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
https://bugs.winehq.org/show_bug.cgi?id=24614
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #16 from winetest@luukku.com --- Dan's patch.
patching file dlls/d3dcompiler_43/compiler.c Hunk #1 FAILED at 483. Hunk #2 succeeded at 737 with fuzz 1 (offset 228 lines). Hunk #3 FAILED at 541. 2 out of 3 hunks FAILED -- saving rejects to file dlls/d3dcompiler_43/compiler.c.rej patching file dlls/d3dcompiler_43/tests/asm.c Hunk #1 succeeded at 91 (offset -2 lines). Hunk #2 succeeded at 107 (offset -2 lines). Hunk #3 succeeded at 1641 with fuzz 1 (offset 42 lines). Hunk #4 succeeded at 1731 with fuzz 2 (offset 46 lines). patching file include/wine/wpp.h patching file libs/wpp/ppl.l Hunk #2 succeeded at 600 (offset 2 lines). patching file libs/wpp/wpp.c Hunk #1 succeeded at 180 (offset 18 lines). patching file libs/wpp/wpp_private.h
against wine 2.0rc4.
https://bugs.winehq.org/show_bug.cgi?id=24614
ZenAnonX BM-2cUwG2wgWXGUJb7ja8qctbv4cKkDJxp72r@bitmessage.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |BM-2cUwG2wgWXGUJb7ja8qctbv4 | |cKkDJxp72r@bitmessage.ch
https://bugs.winehq.org/show_bug.cgi?id=24614
--- Comment #17 from joaopa jeremielapuree@yahoo.fr --- Does the bug still occur with wine-6.5?
https://bugs.winehq.org/show_bug.cgi?id=24614
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Medieval II: Total War |Multiple games crash or |(Sega) crashes on startup |hang on startup due to |or hangs (D3D ASM shader |D3DXAssembleShader not |comment parsing |handling apostrophes in |incomplete)('winetricks -q |comments (Medieval II: |d3dx9_36' is a workaround) |Total War, Yu-Gi-Oh! ONLINE | |3 client)('winetricks -q | |d3dx9_xx' is a workaround) Keywords| |download URL| |https://archive.org/details | |/yo3setup_20100709en
--- Comment #18 from Anastasius Focht focht@gmx.net --- Hello folks,
when you are merging bugs, please always reflect that in the summary line.
It's as Dan said in comment #9 - the 'Medieval II: Total War' demo (https://web.archive.org/web/20210417091753/https://dl.4players.de/f1/pc/medi...) doesn't exhibit the problem, works fine here.
Adding the download from duplicate bug 27678 ("Yu-Gi-Oh! ONLINE 3 client shows black screen on startup (D3DXAssembleShader doesn't handle apostrophes in comments)") for reproduce.
https://archive.org/details/yo3setup_20100709en
--- snip --- $ pwd /home/focht/.wine/drive_c/Program Files (x86)/Konami/Yu-Gi-Oh! ONLINE 3
$ wine ./yo3.exe ... 0118:Call d3dx9_40.D3DXAssembleShader(0076bca0,00000b7b,00000000,00000000,00000000,01b2f498,01b2f49c) ret=00550bdf 0118:Call d3dcompiler_47.D3DAssemble(0076bca0,00000b7b,00000000,00000000,00000000,00000000,01b2f498,01b2f49c) ret=0113fd51 0118:trace:d3dcompiler:D3DAssemble data 0076BCA0, datasize 2939, filename (null), defines 00000000, include 00000000, sflags 0, shader 01B2F498, error_messages 01B2F49C. ... 0118:trace:d3dcompiler:preprocess_shader Error during shader preprocessing 0118:trace:d3dcompiler:preprocess_shader Preprocessor messages: ":19:1: Warning: Newline in string constant encountered (started line 18)\n:20:1: Warning: Newline in string constant encountered (started line 18)\n:21:1: Warning: Newline in string constant encountered (started line 18)\n:22:1: Warning: Newline in string constant encountered (started line "... ... 0118:trace:d3dcompiler:D3DCreateBlob data_size 4220, blob 01B2F320 ... 0118:trace:d3dcompiler:preprocess_shader Shader source: ";Irrlicht Engine 0.10 D3D9 render path parallax mapping vertex shader\n; c0-3: Transposed world matrix \n; c4: Eye position \n; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n; c12: Light01 position \n; c13: x,y,z: Light01 color; .w: 1/LightRadius\xb2 \n; c14: Light02 "... ... 0118:Ret d3dcompiler_47.D3DAssemble() retval=80004005 ret=0113fd51 0118:Ret d3dx9_40.D3DXAssembleShader() retval=88760b59 ret=00550bdf ... 0118:Call KERNEL32.OutputDebugStringA(01936c00 "Vertex shader compilation failed:\n") ret=005261c0 ... --- snip ---
Obviously still present.
I've extracted the vertex shader source in question from the binary:
--- snip --- ;Irrlicht Engine 0.10 D3D9 render path parallax mapping vertex shader ; c0-3: Transposed world matrix ; c4: Eye position ; c8-11: Transposed worldViewProj matrix (Projection * View * World) ; c12: Light01 position ; c13: x,y,z: Light01 color; .w: 1/LightRadius² ; c14: Light02 position ; c15: x,y,z: Light02 color; .w: 1/LightRadius² vs.1.1 dcl_position v0 ; position dcl_normal v1 ; normal dcl_color v2 ; color dcl_texcoord0 v3 ; texture coord dcl_texcoord1 v4 ; tangent dcl_texcoord2 v5 ; binormal
def c95, 0.5, 0.5, 0.5, 0.5 ; used for moving light vector to ps def c96, -1, 1, 1, 1 ; somewhere I've got a bug. flipping the vectors with this fixes it.
m4x4 oPos, v0, c8 ; transform position to clip space with worldViewProj matrix
m3x3 r5, v4, c0 ; transform tangent U m3x3 r7, v1, c0 ; transform normal W m3x3 r6, v5, c0 ; transform binormal V
m4x4 r4, v0, c0 ; vertex into world position add r2, c12, -r4 ; vtxpos - light1 pos add r3, c14, -r4 ; vtxpos - light2 pos add r1, -c4, r4 ; eye - vtxpos
dp3 r8.x, r5, r2 ; transform the light1 vector with U, V, W dp3 r8.y, r6, r2 dp3 r8.z, r7, r2 dp3 r9.x, r5, r3 ; transform the light2 vector with U, V, W dp3 r9.y, r6, r3 dp3 r9.z, r7, r3 dp3 r10.x, r5, r1 ; transform the eye vector with U, V, W dp3 r10.y, r6, r1 dp3 r10.z, r7, r1
dp3 r8.w, r8, r8 ; normalize light vector 1 (r8) rsq r8.w, r8.w mul r8, r8, r8.w ;mul r8, r8, c96 dp3 r9.w, r9, r9 ; normalize light vector 2 (r9) rsq r9.w, r9.w mul r9, r9, r9.w ;mul r9, r9, c96 dp3 r10.w, r10, r10 ; normalize eye vector (r10) rsq r10.w, r10.w mul r10, r10, r10.w mul r10, r10, c96
mad oT2.xyz, r8.xyz, c95, c95 ; move light vector 1 from -1..1 into 0..1 mad oT3.xyz, r9.xyz, c95, c95 ; move light vector 2 from -1..1 into 0..1 mad oT4.xyz, r10.xyz, c95, c95 ; move eye vector from -1..1 into 0..1
; calculate attenuation of light 1 dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x² + r2.y² + r2.z² mul r2.x, r2.x, c13.w ; r2.x * attenutation rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation) mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation
; calculate attenuation of light 2 dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x² + r3.y² + r3.z² mul r3.x, r3.x, c15.w ; r2.x * attenutation rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation) mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation
mov oT0.xy, v3.xy ; move out texture coordinates 1 mov oT1.xy, v3.xy ; move out texture coordinates 2 mov oD0.a, v2.a ; move out original alpha value --- snip ---
Relevant comment line "; somewhere I've got a bug. "
$ wine --version wine-6.6-196-g749f8c25e26
Regards
https://bugs.winehq.org/show_bug.cgi?id=24614
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #19 from Gijs Vermeulen gijsvrm@gmail.com --- This works for me with wine-8.12, all d3dcompiler & d3dx9 dlls set to builtin, at least with the Yu-Gi-Oh! ONLINE 3 client.
Not sure about the exact commit (maybe with the switch to vkd3d?).
https://bugs.winehq.org/show_bug.cgi?id=24614
--- Comment #20 from Matteo Bruni matteo.mystral@gmail.com --- (In reply to Gijs Vermeulen from comment #19)
This works for me with wine-8.12, all d3dcompiler & d3dx9 dlls set to builtin, at least with the Yu-Gi-Oh! ONLINE 3 client.
Not sure about the exact commit (maybe with the switch to vkd3d?).
Yes, that's likely to be it. I guess the vkd3d-shader preprocessor doesn't trip on semicolon comments. The d3dcompiler assembler always handled those comments correctly.
https://bugs.winehq.org/show_bug.cgi?id=24614
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com Fixed by SHA1| |9400874e3c64036700804a99af0 | |e2940bc4d6622
--- Comment #21 from Zeb Figura z.figura12@gmail.com --- (In reply to Matteo Bruni from comment #20)
Yes, that's likely to be it. I guess the vkd3d-shader preprocessor doesn't trip on semicolon comments. The d3dcompiler assembler always handled those comments correctly.
The rub is that I think the vkd3d-shader preprocessor still is going to trip on a semicolon comment, say if it has something like /* in it. What fixed this bug is that it doesn't try to parse single-quote strings, which simply aren't a thing in HLSL.
https://bugs.winehq.org/show_bug.cgi?id=24614
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #22 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.13.