Hi, Further to my last post, I can confirm that the pixelformat structure is completely empty. A quick dump of the DDPIXELFORMAT structure shows that:
================================= trace:ddraw:PixelFormat_DD2WineD3D =========dwSize = 32, sizeof(32) trace:ddraw:PixelFormat_DD2WineD3D =========dwFlags = 0 trace:ddraw:PixelFormat_DD2WineD3D =========dwFourCC = 0 trace:ddraw:PixelFormat_DD2WineD3D =========dwRGBBitCount = 0 trace:ddraw:PixelFormat_DD2WineD3D =========dwRBitMask = 0 trace:ddraw:PixelFormat_DD2WineD3D =========dwGBitMask = 0 trace:ddraw:PixelFormat_DD2WineD3D =========dwBBitMask = 0 trace:ddraw:PixelFormat_DD2WineD3D =========dwRGBAlphaBitMask = 0 =================================
I don't know if this is a bug in the Sims that either:
a) DDPIXELFORMAT is improperly filled in relying on some buggy behaviour in DirectDraw b) DDPIXELFORMAT is properly filled in for some default behaviour. c) DDSURFACEDESC2 is improperly defined with dwFlags & DDSD_PIXELFORMAT
If anyone can try this out in (real) DirectDraw and let me know what happens that would be really cool.
Cheers, Ralph
On Friday 13 May 2011 01:36:09 Ralph Little wrote:
Hi, Further to my last post, I can confirm that the pixelformat structure is completely empty. A quick dump of the DDPIXELFORMAT structure shows that:
Can you show us the entire DDSURFACEDESC2 structure?
b) DDPIXELFORMAT is properly filled in for some default behaviour.
That's most likely, although there is no sensible default for this. We don't even know if the app wants a RGB surface, a Paletteindexed surface, a YUV surface etc. Probably Windows creates a surface with the format of the primary surface. I think this is what happens when the app doesn't specify DDSD_PIXELFORMAT in the DDSURFACEDESC2.
If anyone can try this out in (real) DirectDraw and let me know what happens that would be really cool.
See dlls/ddraw/tests/dsurface.c. If you don't have a Windows machine to run tests yourself you can either use winetestbot or ask someone to run it for you on #winehackers. The latter is recommended because winetestbot uses VMs only. There is basic ddraw support in those VMs(VMware), but it may be different from real GPUs.
Hi,
On 11-05-13 03:33 AM, Stefan Dösinger wrote:
On Friday 13 May 2011 01:36:09 Ralph Little wrote:
Hi, Further to my last post, I can confirm that the pixelformat structure is completely empty. A quick dump of the DDPIXELFORMAT structure shows that:
Can you show us the entire DDSURFACEDESC2 structure
OK, here it is:
================================ trace:ddraw:CreateSurface DDSURF==== dwSize(124) sizeof DDSURFACEDESC(108) sizeof DDSURFACEDESC2(124) trace:ddraw:CreateSurface DDSURF==== dwFlags(124) trace:ddraw:CreateSurface DDSURF==== dwHeight(600) trace:ddraw:CreateSurface DDSURF==== dwWidth(800) trace:ddraw:CreateSurface DDSURF==== u1.lPitch(0) trace:ddraw:CreateSurface DDSURF==== u1.dwLinearSize(0) trace:ddraw:CreateSurface DDSURF==== dwBackBufferCount/dwDepth(0) trace:ddraw:CreateSurface DDSURF==== u2.dwMipMapCount/dwRefreshRate/dwSrcVBHandle(0) trace:ddraw:CreateSurface DDSURF==== dwAlphaBitDepth(0) trace:ddraw:CreateSurface DDSURF==== dwReserved(0) trace:ddraw:CreateSurface DDSURF==== lpSurface((nil)) trace:ddraw:CreateSurface DDSURF==== u3.dwEmptyFaceColor(0) trace:ddraw:CreateSurface DDSURF==== u3.ddckCKDestOverlay.dwColorSpaceLowValue(0) trace:ddraw:CreateSurface DDSURF==== u3.ddckCKDestOverlay.dwColorSpaceHighValue(0) trace:ddraw:CreateSurface DDSURF==== ddckCKDestBlt.dwColorSpaceLowValue(0) trace:ddraw:CreateSurface DDSURF==== ddckCKDestBlt.dwColorSpaceHighValue(0) trace:ddraw:CreateSurface DDSURF==== ddckCKSrcOverlay.dwColorSpaceLowValue(0) trace:ddraw:CreateSurface DDSURF==== ddckCKSrcOverlay.dwColorSpaceHighValue(0) trace:ddraw:CreateSurface DDSURF==== ddckCKSrcBlt.dwColorSpaceLowValue(0) trace:ddraw:CreateSurface DDSURF==== ddckCKSrcBlt.dwColorSpaceHighValue(0) trace:ddraw:CreateSurface DDSURF==== u4.dwFVF(32) trace:ddraw:CreateSurface DDSURF==== ddsCaps.dwCaps(133120) trace:ddraw:CreateSurface DDSURF==== ddsCaps.dwCaps2(0) trace:ddraw:CreateSurface DDSURF==== ddsCaps.dwCaps3(0) trace:ddraw:CreateSurface DDSURF==== ddsCaps.dwCaps4(0) trace:ddraw:CreateSurface DDSURF==== dwTextureStage(0) ===============================================
I notice that the Wine definition of DDSURFACEDESC2 does not include the second union shown here:
http://msdn.microsoft.com/en-us/library/ff550340%28VS.85%29.aspx
which is a union of dwBackBufferCount/dwDepth.
I think it likely that it is a whole-screen surface (800x600) so your assertion that it will use the default pixel format for the display is probably right.
Interestingly, the surface pointer is NULL.
Any ideas what this surface is trying to accomplish? Is it merely an attempt to blank the screen with no content?
Cheers, Ralph
On 13 May 2011 19:03, Ralph Little littlesincanada@yahoo.co.uk wrote:
trace:ddraw:CreateSurface DDSURF==== dwFlags(124)
Is that correct? It doesn't have DDSD_PIXELFORMAT set.
Hi,
On 13 May 2011 19:03, Ralph Littlelittlesincanada@yahoo.co.uk wrote:
trace:ddraw:CreateSurface DDSURF==== dwFlags(124)
Is that correct? It doesn't have DDSD_PIXELFORMAT set.
Wait, you're right. I misread what the code was doing.
/* No pixelformat given? Use the current screen format */ if(!(desc2.dwFlags & DDSD_PIXELFORMAT)) { WARN("No pixelformat given\n"); desc2.dwFlags |= DDSD_PIXELFORMAT; desc2.u4.ddpfPixelFormat.dwSize=sizeof(DDPIXELFORMAT);
It sees that there is no pixelformat specified, then tries to fill one in.
Here:
else { WARN("pixformat=default\n"); PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, Mode.Format); }
it calls the function PixelFormat_WineD3DtoDD() to determine the format details, assuming that there is something in ddpfPixelFormat worth looking at. In this case, it is wrong.
With the surface ptr. being NULL, I suspect that all talk of pixelformat is moot in this case. There are no pixels to render. I really do wonder if this is a "trick" to blank the screen.
Cheers, Ralph
Hi,
On 11-05-13 10:15 AM, Henri Verbeet wrote:
On 13 May 2011 19:03, Ralph Littlelittlesincanada@yahoo.co.uk wrote:
trace:ddraw:CreateSurface DDSURF==== dwFlags(124)
Is that correct? It doesn't have DDSD_PIXELFORMAT set.
No scrap that last message, my original trace was incorrect. A typo meant I was outputting the size, not the flags :(
The flags are actually 4103 which includes DDSD_PIXELFORMAT.
Back to the original situation.
So, what is happening is that the caller is specifying DDSD_PIXELFORMAT but there is nothing in the DDPIXELFORMAT structure to indicate how to render. However, the surface pointer is NULL so there is nothing to actually draw.
I added some code to test the PIXELFORMAT structure and if didn't like what it found, it inserted the default. It gets a lot further but crashes later on. I will try and find out what is happening then.
Cheers, Ralph