mirror of https://github.com/doitsujin/dxvk
[d3d9] Don't upload buffers before Up draws
This commit is contained in:
parent
f83ba898af
commit
62d64bd63a
|
@ -2615,7 +2615,7 @@ namespace dxvk {
|
||||||
if (unlikely(!PrimitiveCount))
|
if (unlikely(!PrimitiveCount))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
PrepareDraw(PrimitiveType);
|
PrepareDraw(PrimitiveType, true);
|
||||||
|
|
||||||
EmitCs([this,
|
EmitCs([this,
|
||||||
cPrimType = PrimitiveType,
|
cPrimType = PrimitiveType,
|
||||||
|
@ -2652,7 +2652,7 @@ namespace dxvk {
|
||||||
if (unlikely(!PrimitiveCount))
|
if (unlikely(!PrimitiveCount))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
PrepareDraw(PrimitiveType);
|
PrepareDraw(PrimitiveType, true);
|
||||||
|
|
||||||
EmitCs([this,
|
EmitCs([this,
|
||||||
cPrimType = PrimitiveType,
|
cPrimType = PrimitiveType,
|
||||||
|
@ -2688,7 +2688,7 @@ namespace dxvk {
|
||||||
if (unlikely(!PrimitiveCount))
|
if (unlikely(!PrimitiveCount))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
PrepareDraw(PrimitiveType);
|
PrepareDraw(PrimitiveType, false);
|
||||||
|
|
||||||
uint32_t vertexCount = GetVertexCount(PrimitiveType, PrimitiveCount);
|
uint32_t vertexCount = GetVertexCount(PrimitiveType, PrimitiveCount);
|
||||||
|
|
||||||
|
@ -2740,7 +2740,7 @@ namespace dxvk {
|
||||||
if (unlikely(!PrimitiveCount))
|
if (unlikely(!PrimitiveCount))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
PrepareDraw(PrimitiveType);
|
PrepareDraw(PrimitiveType, false);
|
||||||
|
|
||||||
uint32_t vertexCount = GetVertexCount(PrimitiveType, PrimitiveCount);
|
uint32_t vertexCount = GetVertexCount(PrimitiveType, PrimitiveCount);
|
||||||
|
|
||||||
|
@ -2827,7 +2827,7 @@ namespace dxvk {
|
||||||
D3D9CommonBuffer* dst = static_cast<D3D9VertexBuffer*>(pDestBuffer)->GetCommonBuffer();
|
D3D9CommonBuffer* dst = static_cast<D3D9VertexBuffer*>(pDestBuffer)->GetCommonBuffer();
|
||||||
D3D9VertexDecl* decl = static_cast<D3D9VertexDecl*> (pVertexDecl);
|
D3D9VertexDecl* decl = static_cast<D3D9VertexDecl*> (pVertexDecl);
|
||||||
|
|
||||||
PrepareDraw(D3DPT_FORCE_DWORD);
|
PrepareDraw(D3DPT_FORCE_DWORD, true);
|
||||||
|
|
||||||
if (decl == nullptr) {
|
if (decl == nullptr) {
|
||||||
DWORD FVF = dst->Desc()->FVF;
|
DWORD FVF = dst->Desc()->FVF;
|
||||||
|
@ -6454,7 +6454,7 @@ namespace dxvk {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D9DeviceEx::PrepareDraw(D3DPRIMITIVETYPE PrimitiveType) {
|
void D3D9DeviceEx::PrepareDraw(D3DPRIMITIVETYPE PrimitiveType, bool UploadBuffers) {
|
||||||
if (unlikely(m_activeHazardsRT != 0 || m_activeHazardsDS != 0))
|
if (unlikely(m_activeHazardsRT != 0 || m_activeHazardsDS != 0))
|
||||||
MarkRenderHazards();
|
MarkRenderHazards();
|
||||||
|
|
||||||
|
@ -6467,7 +6467,7 @@ namespace dxvk {
|
||||||
|
|
||||||
for (uint32_t i = 0; i < caps::MaxStreams; i++) {
|
for (uint32_t i = 0; i < caps::MaxStreams; i++) {
|
||||||
auto* vbo = GetCommonBuffer(m_state.vertexBuffers[i].vertexBuffer);
|
auto* vbo = GetCommonBuffer(m_state.vertexBuffers[i].vertexBuffer);
|
||||||
if (vbo != nullptr && vbo->NeedsUpload())
|
if (vbo != nullptr && vbo->NeedsUpload() && UploadBuffers)
|
||||||
FlushBuffer(vbo);
|
FlushBuffer(vbo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6483,7 +6483,7 @@ namespace dxvk {
|
||||||
GenerateTextureMips(texturesToGen);
|
GenerateTextureMips(texturesToGen);
|
||||||
|
|
||||||
auto* ibo = GetCommonBuffer(m_state.indices);
|
auto* ibo = GetCommonBuffer(m_state.indices);
|
||||||
if (ibo != nullptr && ibo->NeedsUpload())
|
if (ibo != nullptr && ibo->NeedsUpload() && UploadBuffers)
|
||||||
FlushBuffer(ibo);
|
FlushBuffer(ibo);
|
||||||
|
|
||||||
UpdateFog();
|
UpdateFog();
|
||||||
|
|
|
@ -895,7 +895,7 @@ namespace dxvk {
|
||||||
|
|
||||||
uint32_t GetInstanceCount() const;
|
uint32_t GetInstanceCount() const;
|
||||||
|
|
||||||
void PrepareDraw(D3DPRIMITIVETYPE PrimitiveType);
|
void PrepareDraw(D3DPRIMITIVETYPE PrimitiveType, bool UploadBuffers);
|
||||||
|
|
||||||
template <DxsoProgramType ShaderStage>
|
template <DxsoProgramType ShaderStage>
|
||||||
void BindShader(
|
void BindShader(
|
||||||
|
|
Loading…
Reference in New Issue