Now that we're uploading using a staging buffer,
we don't need to wait for non default buffers.
We should also respect READONLY for WRITEONLY buffers
(yes, it sounds dumb) because Nostale relies on that.
This parameter has three different meanings if it's non NULL:
- if Pool is D3DPOOL_SYSTEMMEM it's a host pointer for inital data
- if it points to a nullptr it's a output handle
- if it's a pointer to non NULL pointer it's an import handle
- Fix interleaved locks with evictManagedOnUnlock
We need to make sure there are no other subresources of a texture locked
before clearing the dirty box. Otherwise the data for those other subresources
won't get copied into VRAM.
- Clear dirty box regardless of texture pool
Otherwise we keep repacking and copying the whole texture
for every single lock. This causes performance problems
in Star Wars: The Old Republic.
If the buffer size is less than (vertexCount * stride), the last vertex
may be considered out-of-bounds, even if all attributes are included in
the vertex.
Fixes#2131.
I originally thought the depth clipping region was always [0, 1] when I first implemented this nearly 2 years ago.
The depth clipping region is already in the viewport's depth range, so just don't do anything here if we are z-testing.
( We still need to keep the flattening around for when ztest is disabled though :( )
Fixes: #2056
The stride may not give us the full picture here as the stride
may not encompass the vertex declaration entirely.
Consider a vertex declaration of size 20, and a stride of 12,
we may not have covered the whole range of space the draw wants with
VertexCount * Stride.
Some games such as FF13 Lightning Returns have two float3s in the vertex decl
and draw two triangles with the last float being out of bounds. This causes
the whole vertex element to be set to 0 on NVIDIA which breaks their fullscreen passes.
Instead, take (VertexCount - 1) * Stride + VertexDeclSize for the buffer size
and pad with 0s outside of the VertexCount * Stride range.
Closes: #2046Closes: #1908