On 26/09/06, Stefan Dösinger stefan@codeweavers.com wrote:
To verify that the 32 bit alignment is true for 1x1 textures too.
/* test is deactivated until out np2 support doesn't report
the full power of 2 pitch to the app */
todo_wine ok(lockedRect.Pitch == 4, "Got pitch %d, expected
4\n", lockedRect.Pitch); Shouldn't the test be about alignment, rather than the exact size? I that case the power-of-two stuff shouldn't matter either, as long as it's properly aligned. I do have an initial patch for native NPOT support, but it will (of course) only work on cards that support the relevant extension.
Shouldn't the test be about alignment, rather than the exact size? I that case the power-of-two stuff shouldn't matter either, as long as it's properly aligned. I do have an initial patch for native NPOT support, but it will (of course) only work on cards that support the relevant extension.
In theory yes, but there are games which depend on the exact pitch :-( (Warhammer 40k is one of them I think. This is what the registry key is there for)
I think we should switch to NP2 repacking by default(and fix it if it is broken), with that we can offer the correct pitch without the NPOT extension too.
Just as a sidenode, ddraw seems to work different. I suspect it has 64 bit alignment and a special case for 1x1 surfaces, I need to track that down too.
On 26/09/06, Stefan Dösinger stefan@codeweavers.com wrote:
I think we should switch to NP2 repacking by default(and fix it if it is broken), with that we can offer the correct pitch without the NPOT extension too.
Hmm. Personally I consider repacking a hack for broken games. I'm not sure if those exact sizes are in any way guaranteed by d3d either... to me it would appear as something that might be different between drivers. At least for the test case I think we should just check the alignment.
Am Dienstag 26 September 2006 18:03 schrieb H. Verbeet:
On 26/09/06, Stefan Dösinger stefan@codeweavers.com wrote:
I think we should switch to NP2 repacking by default(and fix it if it is broken), with that we can offer the correct pitch without the NPOT extension too.
Hmm. Personally I consider repacking a hack for broken games. I'm not sure if those exact sizes are in any way guaranteed by d3d either... to me it would appear as something that might be different between drivers. At least for the test case I think we should just check the alignment.
It is really easy to do, and I think just repacking is less a hack than offering 2 methods. To get proper performance with repacking we can just count how often a surface is locked and stop releasing the copy in local memory if the app locks it too often, simmilar to converted surfaces.
Related to the driver dependence: That is why I am testing system memory surfaces. I don't think they depend on the driver, and if they do the test case will catch that on windows and it is interesting to get notified about it.
One other thing I suspect is that there are some corner cases, like 1x1 surfaces in ddraw. I noticed that Anarchy Online goes crazy if I report a pitch of 4 on a 1x1 D3DFMT_A4R4G4B4 surface. It seems it overwrites loads of memory, even if I allocate 256 bytes for the surface it overflows.