Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion source/d3d10/d3d10_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,13 +567,18 @@ void STDMETHODCALLTYPE D3D10Device::UpdateSubresource(ID3D10Resource *pDstRes
if (type == D3D10_RESOURCE_DIMENSION_BUFFER)
{
assert(DstSubresource == 0);

com_ptr<ID3D10Buffer> pDstBuffer;
pDstResource->QueryInterface(&pDstBuffer);
D3D10_BUFFER_DESC desc;
pDstBuffer->GetDesc(&desc);

if (reshade::invoke_addon_event<reshade::addon_event::update_buffer_region>(
this,
pSrcData,
to_handle(pDstResource),
pDstBox != nullptr ? pDstBox->left : 0,
pDstBox != nullptr ? pDstBox->right - pDstBox->left : SrcRowPitch))
pDstBox != nullptr ? pDstBox->right - pDstBox->left : desc.ByteWidth))
return;
}
else
Expand Down
28 changes: 24 additions & 4 deletions source/d3d11/d3d11_device_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,12 +713,17 @@ void STDMETHODCALLTYPE D3D11DeviceContext::UpdateSubresource(ID3D11Resource *
{
assert(DstSubresource == 0);

com_ptr<ID3D11Buffer> pDstBuffer;
pDstResource->QueryInterface(&pDstBuffer);
D3D11_BUFFER_DESC desc;
pDstBuffer->GetDesc(&desc);

if (reshade::invoke_addon_event<reshade::addon_event::update_buffer_region>(
_device,
pSrcData,
to_handle(pDstResource),
pDstBox != nullptr ? pDstBox->left : 0,
pDstBox != nullptr ? pDstBox->right - pDstBox->left : SrcRowPitch))
pDstBox != nullptr ? pDstBox->right - pDstBox->left : desc.ByteWidth))
return;
}
else
Expand All @@ -745,12 +750,17 @@ void STDMETHODCALLTYPE D3D11DeviceContext::UpdateSubresource(ID3D11Resource *
{
assert(DstSubresource == 0);

com_ptr<ID3D11Buffer> pDstBuffer;
pDstResource->QueryInterface(&pDstBuffer);
D3D11_BUFFER_DESC desc;
pDstBuffer->GetDesc(&desc);

if (reshade::invoke_addon_event<reshade::addon_event::update_buffer_region_command>(
this,
pSrcData,
to_handle(pDstResource),
pDstBox != nullptr ? pDstBox->left : 0,
pDstBox != nullptr ? pDstBox->right - pDstBox->left : SrcRowPitch))
pDstBox != nullptr ? pDstBox->right - pDstBox->left : desc.ByteWidth))
return;
}
else
Expand Down Expand Up @@ -1281,12 +1291,17 @@ void STDMETHODCALLTYPE D3D11DeviceContext::UpdateSubresource1(ID3D11Resource
{
assert(DstSubresource == 0);

com_ptr<ID3D11Buffer> pDstBuffer;
pDstResource->QueryInterface(&pDstBuffer);
D3D11_BUFFER_DESC desc;
pDstBuffer->GetDesc(&desc);

if (reshade::invoke_addon_event<reshade::addon_event::update_buffer_region>(
_device,
pSrcData,
to_handle(pDstResource),
pDstBox != nullptr ? pDstBox->left : 0,
pDstBox != nullptr ? pDstBox->right - pDstBox->left : SrcRowPitch))
pDstBox != nullptr ? pDstBox->right - pDstBox->left : desc.ByteWidth))
return;
}
else
Expand All @@ -1313,12 +1328,17 @@ void STDMETHODCALLTYPE D3D11DeviceContext::UpdateSubresource1(ID3D11Resource
{
assert(DstSubresource == 0);

com_ptr<ID3D11Buffer> pDstBuffer;
pDstResource->QueryInterface(&pDstBuffer);
D3D11_BUFFER_DESC desc;
pDstBuffer->GetDesc(&desc);

if (reshade::invoke_addon_event<reshade::addon_event::update_buffer_region_command>(
this,
pSrcData,
to_handle(pDstResource),
pDstBox != nullptr ? pDstBox->left : 0,
pDstBox != nullptr ? pDstBox->right - pDstBox->left : SrcRowPitch))
pDstBox != nullptr ? pDstBox->right - pDstBox->left : desc.ByteWidth))
return;
}
else
Expand Down