http://bugs.winehq.org/show_bug.cgi?id=25298
Summary: Divinity2 crashes Product: Wine Version: 1.3.7 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: mcflow-forum@gmx.net
Created an attachment (id=32138) --> (http://bugs.winehq.org/attachment.cgi?id=32138) wine Divinity2.exe
In some situations the game will crash. For example at the initiation city near the mage trainer there are a few boxes. If you destroy them, the game will crash. Next is when you go back to the airship there will be a sequence and after the dialog you can move where you want. If you turn around after that dialog the game will also crash. I tried various times and those crashes are 100% reproducable with version 1.03 of the game (original dvd, no crack!). I attached the output from terminal to this post.
The last lines are:
err:heap:validate_block_pointer Heap 0x2b32000: bad flags 00000003 for in-use arena 0x69fc9840 err:seh:setup_exception_record stack overflow 888 bytes in thread 000d eip 7bc73326 esp 09c50fb8 stack 0x9c50000-0x9c51000-0xa150000 err:seh:setup_exception_record stack overflow 976 bytes in thread 0009 eip 7bc3e61a esp 021c0f60 stack 0x21c0000-0x21c1000-0x26c0000
It reminds me to this bug which is marked as fixed though... http://bugs.winehq.org/show_bug.cgi?id=10778
ArchLinux 64Bit AMD II x3 435 @ 2,9 Ghz 4 GB Ram Nvidia GTS 250 (260.19.21) wine-1.3.7
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #1 from Florian mcflow-forum@gmx.net 2010-11-26 04:54:55 CST --- It also happens in the Demo of Divinity2.
http://bugs.winehq.org/show_bug.cgi?id=25298
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal
--- Comment #2 from Jeff Zaroyko jeffz@jeffz.name 2010-11-26 05:09:33 CST --- not major: http://bugs.winehq.org/page.cgi?id=fields.html#bug_severity
http://bugs.winehq.org/show_bug.cgi?id=25298
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #3 from Dan Kegel dank@kegel.com 2010-11-26 05:57:33 CST --- Please run with WINEDEBUG=+heap, reproduce the crash quickly, and save the log to a file. Then compress it until it's smaller that 1MB (probably need rzip and a miracle), and attach it to this bug. Running winemine in the background before starting the run will make the log smaller. If you have to, send only the last N lines to get it under 1MB compressed.
Alternately, can you give exact instructions for how to reproduce, for people who are willing to install the demo but suck at games?? :-)
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #4 from Florian mcflow-forum@gmx.net 2010-11-26 08:49:49 CST --- Created an attachment (id=32140) --> (http://bugs.winehq.org/attachment.cgi?id=32140) screenshot that shows the box you have to destroy to make the game crash
(In reply to comment #3)
Please run with WINEDEBUG=+heap, reproduce the crash quickly, and save the log to a file. Then compress it until it's smaller that 1MB (probably need rzip and a miracle), and attach it to this bug. Running winemine in the background before starting the run will make the log smaller. If you have to, send only the last N lines to get it under 1MB compressed.
Alternately, can you give exact instructions for how to reproduce, for people who are willing to install the demo but suck at games?? :-)
I will choose alternate method, sorry. :p I tried the first method but the log was already at 30mb and the game did not even start and 5 minutes already passed since i executed the command. I attached an image which shows how to do it. When you entered that small citiy in the beginning you can see a target and a font in the distance. You walk towards them and then you will notice some boxes. Run towards them and press left mouse button to destroy them. I hope that's clear enough :S
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #5 from Florian mcflow-forum@gmx.net 2010-11-27 04:56:14 CST --- Is there a possibility to start the debugger with a delay? It seems quite a tough task with WINEDEBUG=+heap to get the game started at all. After 5 minutes it did not even start on my system. (see initial post) I can imagine having not even 1 FPS in the menu... For the game it would not be too hard as I already have a savegame where I stand exactly infront of that box.
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #6 from Florian mcflow-forum@gmx.net 2010-11-27 08:00:26 CST --- Hmmmm, sorry for the "spam" first of all. I gave it another try. With WINEDEBUG=+heap the game starts up after ~20 minutes on my system. The Demo is a bit faster. The mouse can be moved more or less smooth. But the fields where it points don't get highlighted, so clicking them has no effect. I already waited several minutes but nothing happened. About the delay... I found a delay-patch with applied and compiled fine with wine. But when I press F12 it will just write that tracing is disabled but it will still give output. For now I have no clue how to get the output.
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #7 from Shannon VanWagner shannon.vanwagner@gmail.com 2010-11-27 14:32:51 CST --- Created an attachment (id=32181) --> (http://bugs.winehq.org/attachment.cgi?id=32181) Terminal output from part where it crashes
http://bugs.winehq.org/show_bug.cgi?id=25298
Shannon VanWagner shannon.vanwagner@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |shannon.vanwagner@gmail.com
--- Comment #8 from Shannon VanWagner shannon.vanwagner@gmail.com 2010-11-27 14:33:42 CST --- Crashed after talking with the woman before going into the forest. See Terminal output.
http://bugs.winehq.org/show_bug.cgi?id=25298
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #32181|application/octet-stream |text/plain mime type| | Attachment #32181|divinity_crash |divinity_crash.txt filename| |
--- Comment #9 from Austin English austinenglish@gmail.com 2010-11-27 14:34:55 CST --- (From update of attachment 32181) Please use .txt in the future.
http://bugs.winehq.org/show_bug.cgi?id=25298
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #32138|application/octet-stream |text/plain mime type| | Attachment #32138|error.log |error.txt filename| |
--- Comment #10 from Austin English austinenglish@gmail.com 2010-11-27 14:35:07 CST --- (From update of attachment 32138) Please use .txt in the future.
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #11 from Austin English austinenglish@gmail.com 2010-11-27 14:35:59 CST --- Does native quartz/devenum help (may have to disable winegstreamer as well).
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #12 from Florian mcflow-forum@gmx.net 2010-11-27 15:11:09 CST --- (In reply to comment #11)
Does native quartz/devenum help (may have to disable winegstreamer as well).
No. I copied native quartz.dll and devenum.dll to system32 folder and it did not help. In winecfg i set winegstreamer to disabled and the two dlls mentioned above to native. The crashes are still present.
By the way: The fastest way to force such a crash is to destroy one of the boxes or barrels you see immediately after you finished the first dialog. It seems that the game crashes on every box that you destroy.
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #13 from Shannon VanWagner shannon.vanwagner@gmail.com 2010-11-27 21:55:39 CST --- Created an attachment (id=32197) --> (http://bugs.winehq.org/attachment.cgi?id=32197) crash after breaking barrels
http://bugs.winehq.org/show_bug.cgi?id=25298
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #14 from Dan Kegel dank@kegel.com 2010-11-27 22:02:19 CST --- Good, there are no heap warnings in that log.
(It does look kind of gstreamer related, but why? Is gstreamer involved in playing back some part of the exploding box effects?)
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #15 from Florian mcflow-forum@gmx.net 2010-11-28 03:40:23 CST --- It seems like there are two different reasons for crashes here. My attachment "wine Divinity.exe" was also created by breaking a barrel. It shows nothing related to gstreamer or quartz while the log from Shannon include it.
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #16 from blaise mgavl69@juno.com 2010-12-18 15:02:32 CST --- Created an attachment (id=32541) --> (http://bugs.winehq.org/attachment.cgi?id=32541) crash with backtrace wine v1.3.9-git
http://bugs.winehq.org/show_bug.cgi?id=25298
dj--alex@ya.ru dj--alex@ya.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dj--alex@ya.ru
--- Comment #17 from dj--alex@ya.ru dj--alex@ya.ru 2011-01-09 02:28:19 CST --- 4 segfaults detected - i here for question it new bug or this data related to this bug? crashes detected - game unplayable all tested on english version game and english language
1) skeleton gets a fireball ( on 2nd location in underground near goblin camp) 2) portals area , on 2nd location near city 3) any box or barrel, try destroy it by weapon or fireball (bug 25298) 4) turning into dragon in cut scene ( on linux can see only first b\w screen with location and next step game is closed)
Segmentation fault error where i do any of 1-4 action
Error short: xme:dsalsa:IDsDriverBufferImpl_SetVolumePan (0x20f568,0x20fd10): stub fixme:thread:SetThreadIdealProcessor (0xfffffffe): stub fixme:thread:SetThreadIdealProcessor (0xfffffffe): stub fixme:thread:SetThreadIdealProcessor(0xfffffffe): stub fixme:thread:SetThreadIdealProcessor (0xfffffffe): stub ====>>> THERE IS PROBLEM I THInK===>>>fixme:d3d:state_vertexblend_w Vertex blend flags 0x3 not supported. wine: Unhandled page fault on write access to 0x3ebe4fa7 at address 0x7bc48b11 (thread 0038), starting debugger... Unhandled exception: page fault on write access to 0x3ebe4fa7 in 32-bit code (0x7bc48b11).
Divine Divinity 2 1.x (DKS) wine 1.3.9 64bit Ubuntu Linux 10.04 AMD Phenom X955\8Gb\Nvidia 280
rechecked wine 1.3.10 64bit ubuntu linux 10.04 64bit wine 1.3.10 64bit ubuntu linux 10.10 64bit Nvidia 9800
Screenshot wow.chg.su/inside/filemgr.php?c=9e37
Pastebin pastebin.ubuntu.com/547626/
here is quicksave - just try go to map marker exit and game will crash (save only for divinity 2 DKS! ) http://wow.chg.su/inside/filemgr.php?c=8c85
p.s. lots of useless stuff removed and it not helped me. 00000018 DevSvc.exe 00000046 RubarUpdateService.exe 00000029 ULCDRSvr.exe
http://bugs.winehq.org/show_bug.cgi?id=25298
Vadim vadim.home@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |vadim.home@gmail.com
--- Comment #18 from Vadim vadim.home@gmail.com 2011-01-21 15:34:15 CST --- http://bugs2.winehq.org/attachment.cgi?id=28205
This patch can be used as workaround. No crashes in Divinity2 anymore with this patch applied.
http://bugs.winehq.org/show_bug.cgi?id=25298
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Component|-unknown |directx-d3d
--- Comment #19 from Dan Kegel dank@kegel.com 2011-01-21 15:39:51 CST --- It crashes without software vertex blending? OK, setting component to d3d, adding keyword download.
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #20 from dj--alex@ya.ru dj--alex@ya.ru 2011-02-04 10:27:30 CST --- (In reply to comment #18)
http://bugs2.winehq.org/attachment.cgi?id=28205
This patch can be used as workaround. No crashes in Divinity2 anymore with this patch applied.
NO WORK!!!!!!!!!! please tell me your version on wine and Os?
i found patch report and try to use it http://bugs2.winehq.org/attachment.cgi?id=28205
console^ al@al-desktop:~/winecompile$ patch -p1 < div2p.p patching file dlls/wined3d/directx.c Hunk #1 succeeded at 4505 (offset 15 lines). patching file dlls/wined3d/drawprim.c Hunk #1 succeeded at 50 (offset -6 lines). Hunk #2 succeeded at 138 with fuzz 1 (offset -6 lines). Hunk #3 succeeded at 231 (offset -6 lines). Hunk #4 FAILED at 379. Hunk #5 succeeded at 768 (offset -3 lines). 1 out of 5 hunks FAILED -- saving rejects to file dlls/wined3d/drawprim.c.rej patching file dlls/wined3d/state.c Hunk #1 succeeded at 3771 (offset 110 lines). Hunk #2 succeeded at 3785 with fuzz 1 (offset 110 lines). Hunk #3 FAILED at 3763. 1 out of 3 hunks FAILED -- saving rejects to file dlls/wined3d/state.c.rej patching file dlls/wined3d/vertexdeclaration.c Hunk #1 succeeded at 123 (offset -2 lines). patching file dlls/wined3d/wined3d_private.h Hunk #1 succeeded at 1680 (offset 62 lines). al@al-desktop:~/winecompile$
i don't know how to create +- diff files but i paste here patched manually rejected files
http://wow.chg.su/inside/filemgr.php?c=8681
wine 1.3.12
ohh no... no works !!!! (((((((((((((((((((((((
when compiling i get this ^^^ -D_FORTIFY_SOURCE=0 -o device.o device.c gcc -m32 -c -I. -I. -I../../include -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -o directx.o directx.c gcc -m32 -c -I. -I. -I../../include -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -o drawprim.o drawprim.c drawprim.c: In function ‘emitBlendedVertex’: drawprim.c:66: error: ‘IWineD3DStateBlockImpl’ has no member named ‘transforms’ drawprim.c:73: error: ‘IWineD3DStateBlockImpl’ has no member named ‘transforms’ drawprim.c:82: error: ‘IWineD3DStateBlockImpl’ has no member named ‘transforms’ drawprim.c: In function ‘drawStridedSlow’: drawprim.c:235: error: ‘This’ undeclared (first use in this function) drawprim.c:235: error: (Each undeclared identifier is reported only once drawprim.c:235: error: for each function it appears in.) drawprim.c:238: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:239: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:240: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:241: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:242: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:243: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:246: error: ‘streamOffset’ undeclared (first use in this function) drawprim.c:247: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:251: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:252: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:386: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:392: error: ‘const struct wined3d_stream_info_element’ has no member named ‘format_desc’ drawprim.c:406: error: invalid storage class for function ‘send_attribute’ drawprim.c:404: warning: ISO C90 forbids mixed declarations and code drawprim.c:517: error: invalid storage class for function ‘drawStridedSlowVs’ drawprim.c:574: error: invalid storage class for function ‘drawStridedInstanced’ drawprim.c:642: error: invalid storage class for function ‘remove_vbos’ drawprim.c:847: error: invalid storage class for function ‘normalize_normal’ drawprim.c:1229: error: expected declaration or statement at end of input make[1]: *** [drawprim.o] Ошибка 1 make[1]: Выход из каталога `/home/al/winecompile/dlls/wined3d' make: *** [dlls/wined3d] Ошибка 2 al@al-desktop:~/winecompile$
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #21 from Vadim vadim.home@gmail.com 2011-02-04 12:17:45 CST --- (In reply to comment #20)
(In reply to comment #18)
http://bugs2.winehq.org/attachment.cgi?id=28205
This patch can be used as workaround. No crashes in Divinity2 anymore with this patch applied.
NO WORK!!!!!!!!!! please tell me your version on wine and Os?
This patch, according to its name, can be applied only on wine-1.2 (maybe 1.2.2 - I haven't checked that) Structure definitions in wined3d_private.h have been changed in wine-1.3.12, so patching attempt will fail. If you want to use this patch with unstable branch you need to rewrite appropriate lines in drawprim.c and state.c
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #22 from James McKenzie jjmckenzie51@earthlink.net 2011-02-04 20:06:08 CST --- Created an attachment (id=33142) --> (http://bugs.winehq.org/attachment.cgi?id=33142) Vadim's Patch rebased to Wine 1.3.13
Note: This patch has NOT been tested and may crash your system. You have been warned.
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #23 from Vadim vadim.home@gmail.com 2011-02-05 06:48:41 CST --- (In reply to comment #22)
Created an attachment (id=33142)
--> (http://bugs.winehq.org/attachment.cgi?id=33142) [details]
Vadim's Patch rebased to Wine 1.3.13
Note: This patch has NOT been tested and may crash your system. You have been warned.
I'm apologize, but wine with this patch shouldn't even be compiled. As I mentioned, structure members were renamed several versions ago and instead of "This" there should be "device" in the patch. And "format" instead of "format_desc" (I'm writing this by memory, so I could be wrong).
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #24 from Vadim vadim.home@gmail.com 2011-02-05 09:34:52 CST --- Created an attachment (id=33150) --> (http://bugs.winehq.org/attachment.cgi?id=33150) Software blending patch for 1.3.13
Patch written by Claudio C for bug http://bugs.winehq.org/show_bug.cgi?id=6955 ported to 1.3.13
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #25 from Vadim vadim.home@gmail.com 2011-02-05 09:39:46 CST --- BTW, it seems to me, this bug (25298) duplicates bug http://bugs.winehq.org/show_bug.cgi?id=6955
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #26 from Vadim vadim.home@gmail.com 2011-02-05 13:30:39 CST --- (From update of attachment 33150) diff -Naur a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c --- a/dlls/wined3d/directx.c 2011-02-03 14:37:38.000000000 +0300 +++ b/dlls/wined3d/directx.c 2011-02-05 22:04:50.000000000 +0300 @@ -4489,8 +4489,13 @@ caps->MaxUserClipPlanes = gl_info->limits.clipplanes; caps->MaxActiveLights = gl_info->limits.lights;
- caps->MaxVertexBlendMatrices = gl_info->limits.blends; - caps->MaxVertexBlendMatrixIndex = 0; + if (gl_info->supported[ARB_VERTEX_BLEND]) { + caps->MaxVertexBlendMatrices = gl_info->limits.blends; + caps->MaxVertexBlendMatrixIndex = 0; + } else { + caps->MaxVertexBlendMatrices = 4; + caps->MaxVertexBlendMatrixIndex = 255; + }
caps->MaxAnisotropy = gl_info->limits.anisotropy; caps->MaxPointSize = gl_info->limits.pointsize_max; diff -Naur a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c --- a/dlls/wined3d/drawprim.c 2011-01-29 03:46:55.000000000 +0300 +++ b/dlls/wined3d/drawprim.c 2011-02-05 22:04:50.000000000 +0300 @@ -50,6 +50,75 @@ }
/* + * Emit a vertex using swoftware vertex blending + */ +static void emitBlendedVertex(struct wined3d_stateblock *stateBlock, + const float *weights, int nweights, const BYTE *indices, + const float *pos, const float *norm) +{ + const float *m; + float vec[4]; + float mat[4*4]; + float last = 1.f; + int i, j; + + /* compute the weighted sum of the matrices */ + m = &stateBlock->state.transforms[WINED3DTS_WORLDMATRIX((indices ? indices[0] : 0))].u.m[0][0]; + for (j = 0; j < 16; j++) + mat[j] = m[j] * weights[0]; + last -= weights[0]; + + for (i = 1; i < nweights; i++) { + if (weights[i]) { + m = &stateBlock->state.transforms[WINED3DTS_WORLDMATRIX((indices ? indices[i] : i))].u.m[0][0]; + for (j = 0; j < 16; j++) + mat[j] += m[j] * weights[i]; + last -= weights[i]; + } + } + + /* do the last */ + if (last) { + m = &stateBlock->state.transforms[WINED3DTS_WORLDMATRIX((indices ? indices[i] : i))].u.m[0][0]; + for (j = 0; j < 16; j++) + mat[j] += m[j] * last; + } + + if (norm) { + /* compute the resulting normal */ + vec[0] = norm[0] * mat[0] + norm[1] * mat[4] + norm[2] * mat[8]; + vec[1] = norm[0] * mat[1] + norm[1] * mat[5] + norm[2] * mat[9]; + vec[2] = norm[0] * mat[2] + norm[1] * mat[6] + norm[2] * mat[10]; + /* normalize */ + vec[3] = vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]; + if (vec[3]) { + vec[3] = 1.f / sqrtf(vec[3]); + vec[0] *= vec[3]; + vec[1] *= vec[3]; + vec[2] *= vec[3]; + } + + glNormal3fv(vec); + } + + if (pos) { + /* compute the resulting position */ + vec[0] = pos[0] * mat[0] + pos[1] * mat[4] + pos[2] * mat[8] + mat[12]; + vec[1] = pos[0] * mat[1] + pos[1] * mat[5] + pos[2] * mat[9] + mat[13]; + vec[2] = pos[0] * mat[2] + pos[1] * mat[6] + pos[2] * mat[10] + mat[14]; + vec[3] = pos[0] * mat[3] + pos[1] * mat[7] + pos[2] * mat[11] + mat[15]; + /* normalize */ + if (vec[3]) { + vec[0] /= vec[3]; + vec[1] /= vec[3]; + vec[2] /= vec[3]; + } + + glVertex3fv(vec); + } +} + +/* * Actually draw using the supplied information. * Slower GL version which extracts info about each vertex in turn */ @@ -69,7 +138,8 @@ BOOL pixelShader = use_ps(state); BOOL specular_fog = FALSE; const BYTE *texCoords[WINED3DDP_MAXTEXCOORD]; - const BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL; + const BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL, *weights = NULL, *indices = NULL; + int nweights = 0; const struct wined3d_gl_info *gl_info = context->gl_info; UINT texture_stages = gl_info->limits.texture_stages; const struct wined3d_stream_info_element *element; @@ -161,6 +231,31 @@ { GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0); } + + if (device->vertexBlendSW) { + if (!si->elements[WINED3D_FFP_BLENDWEIGHT].data) { + WARN("vertex blending enabled but blendWeights.data=NULL\n"); + } else if (si->elements[WINED3D_FFP_BLENDWEIGHT].format->gl_vtx_type != GL_FLOAT) { + FIXME("unsupported blend weights datatype (%d)\n", si->elements[WINED3D_FFP_BLENDWEIGHT].format->id); + } else if (position && si->elements[WINED3D_FFP_POSITION].format->emit_idx != WINED3D_FFP_EMIT_FLOAT3) { + FIXME("unsupported postion datatype (%d)\n", si->elements[WINED3D_FFP_POSITION].format->id); + } else if (normal && si->elements[WINED3D_FFP_NORMAL].format->emit_idx != WINED3D_FFP_EMIT_FLOAT3) { + FIXME("unsupported normal datatype (%d)\n", si->elements[WINED3D_FFP_NORMAL].format->id); + } else { + element = &si->elements[WINED3D_FFP_BLENDWEIGHT]; + weights = element->data + streams[element->stream_idx].offset; + nweights = element->format->gl_vtx_format; + } + + if (si->elements[WINED3D_FFP_BLENDINDICES].data) { + if (si->elements[WINED3D_FFP_BLENDINDICES].format->emit_idx != WINED3D_FFP_EMIT_UBYTE4) { + FIXME("unsupported blend indices datatype (%d)\n", si->elements[WINED3D_FFP_BLENDINDICES].format->id); + } else { + element = &si->elements[WINED3D_FFP_BLENDINDICES]; + indices = element->data + streams[element->stream_idx].offset; + } + } + }
for (textureNo = 0; textureNo < texture_stages; ++textureNo) { @@ -278,17 +373,24 @@ } }
- /* Normal -------------------------------- */ - if (normal) - { - const void *ptrToCoords = normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride; - normal_funcs[si->elements[WINED3D_FFP_NORMAL].format->emit_idx](ptrToCoords); - } - - /* Position -------------------------------- */ - if (position) { - const void *ptrToCoords = position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride; - position_funcs[si->elements[WINED3D_FFP_POSITION].format->emit_idx](ptrToCoords); + if (weights) { + emitBlendedVertex(device->stateBlock, + (const float*)(weights + SkipnStrides * si->elements[WINED3D_FFP_BLENDWEIGHT].stride), nweights, + indices ? (indices + SkipnStrides * si->elements[WINED3D_FFP_BLENDINDICES].stride) : NULL, + (const float*)(position ? (position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride) : NULL), + (const float*)(normal ? (normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride) : NULL)); + } else { + /* Normal -------------------------------- */ + if (normal != NULL) { + const void *ptrToCoords = normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride; + normal_funcs[si->elements[WINED3D_FFP_NORMAL].format->emit_idx](ptrToCoords); + } + + /* Position -------------------------------- */ + if (position) { + const void *ptrToCoords = position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride; + position_funcs[si->elements[WINED3D_FFP_POSITION].format->emit_idx](ptrToCoords); + } }
/* For non indexed mode, step onto next parts */ @@ -678,6 +780,17 @@ } emulation = TRUE; } + else if (device->vertexBlendSW) + { + static BOOL warned; + if (!warned) { + FIXME("Using software emulation because vertex blending is enabled\n"); + warned = TRUE; + } else { + TRACE("Using software emulation because vertex blending is enabled\n"); + } + emulation = TRUE; + }
if(emulation) { stream_info = &stridedlcl; diff -Naur a/dlls/wined3d/state.c b/dlls/wined3d/state.c --- a/dlls/wined3d/state.c 2011-02-01 16:17:23.000000000 +0300 +++ b/dlls/wined3d/state.c 2011-02-05 22:18:26.000000000 +0300 @@ -3771,7 +3771,7 @@ if(context->last_was_rhw) { glLoadIdentity(); checkGLcall("glLoadIdentity()"); - } else { + } else if (!stateblock->device->vertexBlendSW) { /* In the general case, the view matrix is the identity matrix */ if (stateblock->device->view_ident) { @@ -3785,6 +3785,9 @@
glMultMatrixf(&stateblock->state.transforms[WINED3DTS_WORLDMATRIX(0)].u.m[0][0]); checkGLcall("glMultMatrixf"); } + } else { + glLoadMatrixf(&stateblock->state.transforms[WINED3DTS_VIEW].u.m[0][0]); + checkGLcall("glLoadMatrixf"); } }
@@ -3874,13 +3877,33 @@
static void state_vertexblend_w(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context) { - WINED3DVERTEXBLENDFLAGS f = stateblock->state.render_states[WINED3DRS_VERTEXBLEND]; + WINED3DVERTEXBLENDFLAGS val = stateblock->state.render_states[WINED3DRS_VERTEXBLEND]; static unsigned int once;
- if (f == WINED3DVBF_DISABLE) return; - - if (!once++) FIXME("Vertex blend flags %#x not supported.\n", f); - else WARN("Vertex blend flags %#x not supported.\n", f); + switch (val) { + case WINED3DVBF_0WEIGHTS: + case WINED3DVBF_1WEIGHTS: + case WINED3DVBF_2WEIGHTS: + case WINED3DVBF_3WEIGHTS: + if(!once) { + once = TRUE; + FIXME("Vertex blending enabled, but not supported by hardware. Using software emulation.\n"); + } + if (!stateblock->device->vertexBlendSW) { + stateblock->device->vertexBlendSW = TRUE; + transform_world(state, stateblock, context); + } + break; + case WINED3DVBF_TWEENING: + WARN("Vertex blend flags %#x not supported.\n", val); + /* fall through */ + default: + if (stateblock->device->vertexBlendSW) { + stateblock->device->vertexBlendSW = FALSE; + transform_world(state, stateblock, context); + } + break; + } }
static void state_vertexblend(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context) diff -Naur a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c --- a/dlls/wined3d/vertexdeclaration.c 2011-02-05 15:14:05.000000000 +0300 +++ b/dlls/wined3d/vertexdeclaration.c 2011-02-05 22:04:50.000000000 +0300 @@ -106,6 +106,15 @@ default: return FALSE; } + + case WINED3DDECLUSAGE_BLENDINDICES: + switch(element->format) + { + case WINED3DFMT_R8G8B8A8_UINT: + return TRUE; + default: + return FALSE; + }
case WINED3DDECLUSAGE_NORMAL: switch(element->format) diff -Naur a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h --- a/dlls/wined3d/wined3d_private.h 2011-02-05 15:14:05.000000000 +0300 +++ b/dlls/wined3d/wined3d_private.h 2011-02-05 22:04:50.000000000 +0300 @@ -1670,6 +1670,7 @@ WORD view_ident : 1; /* true iff view matrix is identity */ WORD untransformed : 1; WORD vertexBlendUsed : 1; /* To avoid needless setting of the blend matrices */ + WORD vertexBlendSW : 1; /* vertexBlend software fallback used */ WORD isRecordingState : 1; WORD isInDraw : 1; WORD bCursorVisible : 1;
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #27 from Vadim vadim.home@gmail.com 2011-02-05 13:36:10 CST --- Sorry, I tried to edit patch which I submitted (I made it from James McKenzie patch http://bugs.winehq.org/attachment.cgi?id=33142, but that path contains an error. I corrected it and tried to edit an attachment. But instead of editing, I paste it as comment. And don't know how to get rid of it. :( I'm apologize...
http://bugs.winehq.org/show_bug.cgi?id=25298
Vadim vadim.home@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #33150|0 |1 is obsolete| |
--- Comment #28 from Vadim vadim.home@gmail.com 2011-02-05 13:47:16 CST --- Created an attachment (id=33156) --> (http://bugs.winehq.org/attachment.cgi?id=33156) Software blending patch for 1.3.13
Previous version of this patch (http://bugs2.winehq.org/attachment.cgi?id=33150) has a bug. Please, remove it.
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #29 from dj--alex@ya.ru dj--alex@ya.ru 2011-02-06 03:41:03 CST --- (In reply to comment #28)
Created an attachment (id=33156)
--> (http://bugs.winehq.org/attachment.cgi?id=33156) [details]
Software blending patch for 1.3.13
Previous version of this patch (http://bugs2.winehq.org/attachment.cgi?id=33150) has a bug. Please, remove it.
Works perfectly !! but blended textures shows as black textures
game are full playable with this patch!
http://bugs.winehq.org/show_bug.cgi?id=25298
DreamSoul dreamsoul14@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dreamsoul14@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=25298
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #30 from joaopa jeremielapuree@yahoo.fr 2011-04-04 00:01:29 CDT --- Duplicate of bug 6955.
http://bugs.winehq.org/show_bug.cgi?id=25298
Xavier Vachon xvachon@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |xvachon@gmail.com
--- Comment #31 from Xavier Vachon xvachon@gmail.com 2011-08-01 14:12:25 CDT --- If this is really a dupe it should be closed.
http://bugs.winehq.org/show_bug.cgi?id=25298
Benoit PIERRE benoit.pierre@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |benoit.pierre@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=25298
--- Comment #32 from joaopa jeremielapuree@yahoo.fr 2011-12-27 02:41:09 CST --- Sure, it is a duplicate of bug 6955
http://bugs.winehq.org/show_bug.cgi?id=25298
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE
--- Comment #33 from Dan Kegel dank@kegel.com 2011-12-27 09:45:29 CST --- Marking dup.
*** This bug has been marked as a duplicate of bug 6955 ***
http://bugs.winehq.org/show_bug.cgi?id=25298
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #34 from Austin English austinenglish@gmail.com 2012-01-23 19:46:05 CST --- Closing DUPLICATE.