WinterSnowfall

Results 410 comments of WinterSnowfall

I've added some general robustness to d3d8 device calls - although highly unlikely, there was some potential null pointer dereference going on. Also added additional validations where applicable, especially around...

Looks good after a quick round of random game tests - on the added validation part it now (mostly) mirrors d9vk anyway, so no surprise there.

The ghost of Managed Buffer Placement still haunts us to this day. I've also now removed some remaining sleight of hand (on buffer GetDesc) we were doing to facilitate it.

I've tested this PR with the entire battery of ~140 d3d8 games I have and they're all fine. Should be good to mainline.

> I generally prefer the `if (FAILED(hr)) return hr;` kind of pattern over what's done here since it makes the intended code path easier to follow in some cases Hmmm,...

Turns out this isn't exactly free (performance-wise), so I've hidden it behind a config option and enabled it only for Rayman 3. I have yet to see another game relying...

> The docs only mention DYNAMIC. Does WRITEONLY make a difference for DISCARD? For this game in particular, yes. For what it's worth d3d8to9 [is already doing this globally](https://github.com/crosire/d3d8to9/blob/2b25f270c4119437e80e52f41d0dc30236c62865/source/d3d8to9_vertex_buffer.cpp#L88), however...

> It makes a difference because Rayman 3 is doing undefined behaviour, namely writing to buffers after unlocking them (off by one error in reference counting I believe). Handling that...

> as of course there will be weird things since it is leaking. Not releasing objects doesn't generally cause graphical artifacting, so I'm not sure what you mean here. The...

> that's why I'm trying to use some wrapping to try to solve this issue on my nVidia based PCs We'll probably end up applying `d3d9.allowDirectBufferMapping = False` to address...