mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[d3d11] Implement copy flags for CopySubresourceRegion1 / UpdateSubresource1
This commit is contained in:
parent
3fee20dfec
commit
fb88070888
@ -68,7 +68,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
// We don't support the Discard API for images
|
// We don't support the Discard API for images
|
||||||
if (resType == D3D11_RESOURCE_DIMENSION_BUFFER)
|
if (resType == D3D11_RESOURCE_DIMENSION_BUFFER)
|
||||||
DiscardBuffer(reinterpret_cast<D3D11Buffer*>(pResource));
|
DiscardBuffer(static_cast<D3D11Buffer*>(pResource));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -273,6 +273,22 @@ namespace dxvk {
|
|||||||
ID3D11Resource* pSrcResource,
|
ID3D11Resource* pSrcResource,
|
||||||
UINT SrcSubresource,
|
UINT SrcSubresource,
|
||||||
const D3D11_BOX* pSrcBox) {
|
const D3D11_BOX* pSrcBox) {
|
||||||
|
CopySubresourceRegion1(
|
||||||
|
pDstResource, DstSubresource, DstX, DstY, DstZ,
|
||||||
|
pSrcResource, SrcSubresource, pSrcBox, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void STDMETHODCALLTYPE D3D11DeviceContext::CopySubresourceRegion1(
|
||||||
|
ID3D11Resource* pDstResource,
|
||||||
|
UINT DstSubresource,
|
||||||
|
UINT DstX,
|
||||||
|
UINT DstY,
|
||||||
|
UINT DstZ,
|
||||||
|
ID3D11Resource* pSrcResource,
|
||||||
|
UINT SrcSubresource,
|
||||||
|
const D3D11_BOX* pSrcBox,
|
||||||
|
UINT CopyFlags) {
|
||||||
D3D11_RESOURCE_DIMENSION dstResourceDim = D3D11_RESOURCE_DIMENSION_UNKNOWN;
|
D3D11_RESOURCE_DIMENSION dstResourceDim = D3D11_RESOURCE_DIMENSION_UNKNOWN;
|
||||||
D3D11_RESOURCE_DIMENSION srcResourceDim = D3D11_RESOURCE_DIMENSION_UNKNOWN;
|
D3D11_RESOURCE_DIMENSION srcResourceDim = D3D11_RESOURCE_DIMENSION_UNKNOWN;
|
||||||
|
|
||||||
@ -297,6 +313,9 @@ namespace dxvk {
|
|||||||
auto dstBuffer = static_cast<D3D11Buffer*>(pDstResource)->GetBufferSlice();
|
auto dstBuffer = static_cast<D3D11Buffer*>(pDstResource)->GetBufferSlice();
|
||||||
auto srcBuffer = static_cast<D3D11Buffer*>(pSrcResource)->GetBufferSlice();
|
auto srcBuffer = static_cast<D3D11Buffer*>(pSrcResource)->GetBufferSlice();
|
||||||
|
|
||||||
|
if (CopyFlags & D3D11_COPY_DISCARD)
|
||||||
|
DiscardBuffer(static_cast<D3D11Buffer*>(pDstResource));
|
||||||
|
|
||||||
VkDeviceSize dstOffset = DstX;
|
VkDeviceSize dstOffset = DstX;
|
||||||
VkDeviceSize srcOffset = 0;
|
VkDeviceSize srcOffset = 0;
|
||||||
VkDeviceSize regLength = srcBuffer.length();
|
VkDeviceSize regLength = srcBuffer.length();
|
||||||
@ -466,20 +485,6 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11DeviceContext::CopySubresourceRegion1(
|
|
||||||
ID3D11Resource* pDstResource,
|
|
||||||
UINT DstSubresource,
|
|
||||||
UINT DstX,
|
|
||||||
UINT DstY,
|
|
||||||
UINT DstZ,
|
|
||||||
ID3D11Resource* pSrcResource,
|
|
||||||
UINT SrcSubresource,
|
|
||||||
const D3D11_BOX* pSrcBox,
|
|
||||||
UINT CopyFlags) {
|
|
||||||
CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ, pSrcResource, SrcSubresource, pSrcBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11DeviceContext::CopyResource(
|
void STDMETHODCALLTYPE D3D11DeviceContext::CopyResource(
|
||||||
ID3D11Resource* pDstResource,
|
ID3D11Resource* pDstResource,
|
||||||
ID3D11Resource* pSrcResource) {
|
ID3D11Resource* pSrcResource) {
|
||||||
@ -823,6 +828,20 @@ namespace dxvk {
|
|||||||
const void* pSrcData,
|
const void* pSrcData,
|
||||||
UINT SrcRowPitch,
|
UINT SrcRowPitch,
|
||||||
UINT SrcDepthPitch) {
|
UINT SrcDepthPitch) {
|
||||||
|
UpdateSubresource1(pDstResource,
|
||||||
|
DstSubresource, pDstBox, pSrcData,
|
||||||
|
SrcRowPitch, SrcDepthPitch, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void STDMETHODCALLTYPE D3D11DeviceContext::UpdateSubresource1(
|
||||||
|
ID3D11Resource* pDstResource,
|
||||||
|
UINT DstSubresource,
|
||||||
|
const D3D11_BOX* pDstBox,
|
||||||
|
const void* pSrcData,
|
||||||
|
UINT SrcRowPitch,
|
||||||
|
UINT SrcDepthPitch,
|
||||||
|
UINT CopyFlags) {
|
||||||
// We need a different code path for buffers
|
// We need a different code path for buffers
|
||||||
D3D11_RESOURCE_DIMENSION resourceType;
|
D3D11_RESOURCE_DIMENSION resourceType;
|
||||||
pDstResource->GetType(&resourceType);
|
pDstResource->GetType(&resourceType);
|
||||||
@ -831,6 +850,9 @@ namespace dxvk {
|
|||||||
const auto bufferResource = static_cast<D3D11Buffer*>(pDstResource);
|
const auto bufferResource = static_cast<D3D11Buffer*>(pDstResource);
|
||||||
const auto bufferSlice = bufferResource->GetBufferSlice();
|
const auto bufferSlice = bufferResource->GetBufferSlice();
|
||||||
|
|
||||||
|
if (CopyFlags & D3D11_COPY_DISCARD)
|
||||||
|
DiscardBuffer(bufferResource);
|
||||||
|
|
||||||
VkDeviceSize offset = bufferSlice.offset();
|
VkDeviceSize offset = bufferSlice.offset();
|
||||||
VkDeviceSize size = bufferSlice.length();
|
VkDeviceSize size = bufferSlice.length();
|
||||||
|
|
||||||
@ -937,18 +959,6 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11DeviceContext::UpdateSubresource1(
|
|
||||||
ID3D11Resource* pDstResource,
|
|
||||||
UINT DstSubresource,
|
|
||||||
const D3D11_BOX* pDstBox,
|
|
||||||
const void* pSrcData,
|
|
||||||
UINT SrcRowPitch,
|
|
||||||
UINT SrcDepthPitch,
|
|
||||||
UINT CopyFlags) {
|
|
||||||
UpdateSubresource(pDstResource, DstSubresource, pDstBox, pSrcData, SrcRowPitch, SrcDepthPitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11DeviceContext::SetResourceMinLOD(
|
void STDMETHODCALLTYPE D3D11DeviceContext::SetResourceMinLOD(
|
||||||
ID3D11Resource* pResource,
|
ID3D11Resource* pResource,
|
||||||
FLOAT MinLOD) {
|
FLOAT MinLOD) {
|
||||||
|
@ -1604,7 +1604,7 @@ namespace dxvk {
|
|||||||
info->OutputMergerLogicOp = features.core.features.logicOp;
|
info->OutputMergerLogicOp = features.core.features.logicOp;
|
||||||
info->UAVOnlyRenderingForcedSampleCount = FALSE;
|
info->UAVOnlyRenderingForcedSampleCount = FALSE;
|
||||||
info->DiscardAPIsSeenByDriver = TRUE;
|
info->DiscardAPIsSeenByDriver = TRUE;
|
||||||
info->FlagsForUpdateAndCopySeenByDriver = FALSE;
|
info->FlagsForUpdateAndCopySeenByDriver = TRUE;
|
||||||
info->ClearView = FALSE;
|
info->ClearView = FALSE;
|
||||||
info->CopyWithOverlap = FALSE;
|
info->CopyWithOverlap = FALSE;
|
||||||
info->ConstantBufferPartialUpdate = TRUE;
|
info->ConstantBufferPartialUpdate = TRUE;
|
||||||
|
@ -40,6 +40,10 @@ typedef enum D3D11_FORMAT_SUPPORT2 {
|
|||||||
D3D11_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000
|
D3D11_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000
|
||||||
} D3D11_FORMAT_SUPPORT2;
|
} D3D11_FORMAT_SUPPORT2;
|
||||||
#ifndef __WINE__
|
#ifndef __WINE__
|
||||||
|
typedef enum D3D11_COPY_FLAGS {
|
||||||
|
D3D11_COPY_NO_OVERWRITE = 0x1,
|
||||||
|
D3D11_COPY_DISCARD = 0x2,
|
||||||
|
} D3D11_COPY_FLAGS;
|
||||||
typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT2 {
|
typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT2 {
|
||||||
DXGI_FORMAT InFormat;
|
DXGI_FORMAT InFormat;
|
||||||
UINT OutFormatSupport2;
|
UINT OutFormatSupport2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user