Commit Graph

109 Commits

Author SHA1 Message Date
Philip Rebohle 7d76262c52
[d3d11] Use D3D11_COMMON_TEXTURE_MAP_MODE_STAGING if possible 2021-06-24 21:07:48 +02:00
Philip Rebohle 1a6f4456d8
[d3d11] Introduce ComputeMappedOffset for image resources
Modifies GetSubresourceLayout slightly in case only a partial aspect
mask is being passed to the function. This way we can conveniently
compute the offset of a given pixel within the mapped buffer of an
image subresource.
2021-06-24 21:07:48 +02:00
Philip Rebohle 7160b85924
[d3d11] Add texel buffer usage flags to mapped subresource buffers 2021-06-24 21:07:48 +02:00
Philip Rebohle 731e88b196
[d3d11] Handle MAP_MODE_STAGING in initializer
Otherwise, we'll crash if no real image is present.
2021-06-24 21:07:48 +02:00
Philip Rebohle 9e15831a2d
[d3d11] Store packed format info in D3D11CommonTexture 2021-06-24 21:07:48 +02:00
Philip Rebohle f155b8a8b9
[d3d11] Introduce DiscardSlice and GetMappedSlice for image resources
These do the same as they do for buffer resources, but for a mapped
image subresource instead.
2021-06-24 21:07:48 +02:00
Philip Rebohle 11aa2a703a
[d3d11] Introduce D3D11_COMMON_TEXTURE_MAP_MODE_STAGING
This map mode can be used when no Vulkan image is needed to back a
staging resource, which can save a significant amount of memory.
2021-06-24 21:07:48 +02:00
Philip Rebohle 6d72bc94f4
[d3d11] Allow creation of shader resource views for planar images 2021-05-30 19:42:44 +02:00
Philip Rebohle 6d9da5a8d7
[d3d11] Don't use MAP_MODE_DIRECT for multi-plane images 2021-05-30 19:42:44 +02:00
Philip Rebohle 1b296f8338
[d3d11] Introduce GetSubresourceLayout 2021-05-30 19:42:44 +02:00
Philip Rebohle e988895e51
[d3d11] Set mutable and extended usage bits for multi-plane images 2021-05-30 19:42:43 +02:00
Philip Rebohle bce80b523f [d3d11] Mark images as shared if necessary 2021-02-14 04:00:02 +01:00
Philip Rebohle 2787ba8450
[d3d11] Fix D3D11 bind flags and DXGI usage for swap chain images 2021-02-12 03:12:48 +01:00
Philip Rebohle c98c5f5d17
[d3d11] Add internal DXGI usage flags to textures
We need this for swap chain images.
2021-02-12 03:12:48 +01:00
Joshua Ashton 742b52bbb5 [d3d11] Fix device child refs properly 2021-01-15 23:47:48 +01:00
Andrew Eikum a3065fca8e [d3d11] Extend interop interfaces for OpenXR support 2021-01-07 23:54:02 +01:00
Philip Rebohle 2291484696
[d3d11] Fix texture view compatibility check 2020-03-08 01:28:51 +01:00
Philip Rebohle 073669b7e7 [dxvk] Don't enable VK_KHR_maintenance1, VK_KHR_maintenance2
Core in Vulkan 1.1.
2020-01-17 17:46:59 +01:00
Philip Rebohle f9c2e43ffc
[d3d11] Don't set HOST pipeline stage and access flags for resources
The backend does not and will not use that information at all.
2019-10-24 16:57:06 +02:00
Philip Rebohle 127e037627
[d3d11] Validate texture array size
Fixes a wine test failure and possibly prevents invalid Vulkan API usage.
2019-10-11 17:11:01 +02:00
Joshua Ashton 19fa1c405c [d3d10] Remove unused copies of device ptr in D3D10 wrappers
Silences a warning when building with Clang, and removes duplicate unused data.
2019-10-06 00:28:19 +02:00
Philip Rebohle 7e7609cac0
Revert "[d3d11] Don't create linearly tiled compressed images"
This reverts commit b8888ffe6a.

This is no longer beneficial since initialization of a
linear image does not stall Map anymore.
2019-09-20 05:59:54 +02:00
Philip Rebohle e82c87dc52
[d3d11] Implement GetDC / ReleaseDC 2019-09-20 01:44:18 +02:00
Philip Rebohle ae4a5232aa
[d3d11] Use VK_IMAGE_LAYOUT_PREINITIALIZED for mapped images
This way we can directly write image data directly to the image
without having to do it on the GPU.
2019-09-20 01:44:01 +02:00
Philip Rebohle bc853d0e48
[d3d11] Only use mapped buffer for images if bind flags are non-zero
We really shouldn't use the intermediate buffer for DYNAMIC images
that can only ever be used for copy commands, since the copies will
be redundant.
2019-09-18 13:15:22 +02:00
Philip Rebohle 0758f14a35
[d3d11] Implement ID3D11Texture2D1 and ID3D11Texture3D1 2019-09-16 14:27:44 +02:00
Philip Rebohle 7ba7178d14
[d3d11] Implement ID3D11Device2
Adds some extra validation to resource creation so that
apps cannot accidentally create tiled resources.
2019-09-16 12:42:14 +02:00
Philip Rebohle b8888ffe6a
[d3d11] Don't create linearly tiled compressed images
Quantum Break uses this for texture uploads, which causes unnecessary
GPU synchronization and queue submissions when doing texture uploads.
2019-09-07 20:16:16 +02:00
Philip Rebohle 92d6f26130
[d3d11] Always enable depth-stencil attachment usage for depth-stencil images
Allows us to use framebuffer copies even if the game itself does not
intend to render to the image.

Improves performance in Final Fantasy XIV on RADV.
2019-07-18 17:26:02 +02:00
Philip Rebohle 1bc0b51262
[d3d11] Implement IDXGISurface2 for ID3D11Texture1D 2019-06-13 04:37:35 +02:00
Philip Rebohle ce03384ba9
[d3d11] Validate bind flags for D3D11_RESOURCE_MISC_GENERATE_MIPS 2019-06-13 03:31:31 +02:00
Philip Rebohle 3168626f4b
[d3d11] Support mapping multiple image subresources at the same time
Fixes #1066.
2019-05-20 19:27:11 +02:00
Philip Rebohle a340b3101c
[d3d11] Add missing interface queries for IDXGIObject and IDXGIDeviceSubObject 2019-05-01 01:54:00 +02:00
Philip Rebohle 2c61303976 [d3d11] Implement IDXGIResource1 for textures and buffers 2019-04-27 20:21:54 +02:00
Philip Rebohle ac79f69a10 [d3d11] Pass texture as D3D11Resource to DXGI interop objects 2019-04-27 16:25:55 +02:00
Philip Rebohle d1a019a043 [d3d11] Implement Map / Unmap for IDXGISurface2 2019-04-27 16:17:50 +02:00
Philip Rebohle af15aa0c32 [d3d11] Implement IDXGISurface2 for compatible 2D textures
Required by SpellForce 3. Fixes #1031.
2019-04-27 15:35:20 +02:00
Philip Rebohle 56300ff9b7
[d3d11] Allocate mapped buffers for staging images on cached memory
These will most likely be used for reading, so we should put them
on a memory type which allows reading.
2019-04-07 14:47:43 +02:00
Philip Rebohle 51f229530b
Revert "[d3d11] Select memory type based on CPU access flags"
This reverts commit 6c8042033e.

Batman: Arkham City doesn't set the CPU access flags correctly
for some images it maps for reading, and breaks on Nvidia as a
result.
2019-04-07 14:42:01 +02:00
Philip Rebohle 6c8042033e
[d3d11] Select memory type based on CPU access flags 2019-03-26 21:17:52 +01:00
Philip Rebohle 97d77fa508
[d3d11] Implement depth-stencil mapping on the immediate context 2019-03-26 18:04:56 +01:00
Philip Rebohle 8194bec1bf
[d3d11] Fix image format mapping when creating mapped buffer 2019-03-26 17:54:43 +01:00
Joshua Ashton 5ea8648cd9 [d3d11, d3d10, dxgi] Handle null ppvObject in QueryInterface. (#909)
When a null ppvObject is passed into a QueryInterface on any IUnknown, a E_POINTER should be returned as the result (and it should not crash.)

This matches native d3d11/d3d10/dxgi behaviour and the documentation found here https://docs.microsoft.com/en-us/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q_) for IUnknown.
2019-02-10 08:01:01 +01:00
Philip Rebohle a79409ad02
Revert "[dxvk] Don't put rendering stage/access masks into image info"
This reverts commit ce3642edd0.

We're actually going to need these when optimizing render pass barriers.
2019-01-22 14:52:35 +01:00
Philip Rebohle c804d99db7
[d3d11] Fix log spam in SetEvictionPriority stubs 2019-01-12 15:22:34 +01:00
Philip Rebohle 214891ffc6
[d3d11] Improve error logging when texture creation fails 2019-01-08 10:34:48 +01:00
Chip Davis 6feeb4bbba Only set 2D_ARRAY_COMPATIBLE on 3D textures that will be rendered to.
It is impossible to create a 2D or 2D array SRV or UAV from a 3D
texture. Nor is it possible to create a DSV from a 3D texture.
Therefore, the only time we ever need to create a 2D array view from a
3D texture is when we're going to render to it.
2019-01-02 19:15:23 +01:00
Philip Rebohle ce3642edd0
[dxvk] Don't put rendering stage/access masks into image info
Not needed since these stages and access flags are handled by render
pass transitions.
2018-11-24 00:40:59 +01:00
Philip Rebohle f483bc9633
[d3d11] Add usage flag for meta-pack operations if necessary
- Fix depth-stencil format list
2018-11-08 18:51:43 +01:00
Philip Rebohle 6d18efdfc7
[d3d10] Lock device on context operations
May fix thread safety issues in some games. Apparently, the
D3D10Device is supposed to be thread safe by default.
2018-10-12 18:31:55 +02:00