Commit Graph

46 Commits

Author SHA1 Message Date
Philip Rebohle fb288d8713
[d3d11] Disable VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT for typed formats
Yields over 10% performance improvement on RADV in GPU-bound scenarios.
2018-05-05 00:49:43 +02:00
Philip Rebohle 41fca78d27 [dxgi] Add GetDevice method to IDXGIVkInteropSurface
Convenient way of getting the IDXGIVkInteropDevice from the surface
without having to go through several D3D interface queries.
2018-05-01 23:30:39 +02:00
Philip Rebohle d5041337f5 [d3d11] Use linar tiling for textures if optimal tiling is not supported
Fixes texture creation issues in various Batman games.
2018-04-29 14:43:24 +02:00
Philip Rebohle 1ed1c43431
[d3d11] Wire up D3D11VkInteropSurface to D3D11Texture*D classes 2018-04-20 11:12:54 +02:00
Philip Rebohle 81a0fa4805
[d3d11] Implemented IDXGIVkInteropSurface for common textures 2018-04-20 10:38:39 +02:00
Philip Rebohle 4a0c9dbaba
[d3d11] Validate texture sample count
Fixes incorrect return values in case a game tries to create
a texture with an unsupported number of samples.
2018-04-13 13:46:45 +02:00
Philip Rebohle 8508994a63
[d3d11] Cap mip level count for textures and views
Some games do not compute the number of mip levels of
a texture or texture view correctly, so we should work
around this by capping it to the highest possible value.
2018-04-12 23:42:11 +02:00
Philip Rebohle db541d188f
[dxgi] Added static format mapping table 2018-04-12 17:49:14 +02:00
Philip Rebohle 2973c18055 [dxgi/d3d11] Remove COM_QUERY_INTERFACE macro, reset pointers
May fix some crashes in applications that rely on the returned
pointer being set to nullptr before returning.
2018-04-02 12:52:02 +02:00
Philip Rebohle a8eecfbfe5
[d3d11] Enable direct image mapping by default 2018-03-18 00:36:53 +01:00
Philip Rebohle eb8ae5cc82
[d3d11] Allow 2D array view creation for 3D textures
Fixes a regression that was introduced with the texture
class refactor. Fixes validation issues in Hellblade.
2018-03-14 20:40:11 +01:00
Philip Rebohle 0e0ee61d9b
[d3d11] Always use VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
We need to investigate why not doing this breaks shadows in Heaven.
2018-03-14 17:40:26 +01:00
Philip Rebohle 3b20c71894
[d3d11] Re-implement direct image mapping (disabled by default)
We cannot enable this by default yet because it may break some games.
2018-03-14 16:40:28 +01:00
Philip Rebohle 155bd32e22
[d3d11] Check if a textue can be created before making the attempt
This may prevent driver crashes and give more useful debugging info
in case a given combination of image parameters is not supported by
a device. May also improve compatibility with direct image mapping.
2018-03-14 16:03:48 +01:00
Philip Rebohle 7a6d61d943
[d3d11] Create mapped image buffer only when needed
Also adds some documentation to D3D11CommonTexture.
2018-03-14 14:49:45 +01:00
Philip Rebohle 0ba3337289
[d3d11] Refactored Map/Unmap methods 2018-03-14 14:40:09 +01:00
Philip Rebohle 91b82c05b2
[d3d11] Refactoring texture classes: Move static methods into D3D11CommonTexture 2018-03-14 01:16:31 +01:00
Philip Rebohle 56df0bcccb
[d3d11] Refactoring texture classes: Remove D3D11TextureInfo 2018-03-14 00:45:07 +01:00
Philip Rebohle 16d66c8a1d
[d3d11] Refactoring texture classes: Introduce D3D11CommonTexture 2018-03-13 23:51:30 +01:00
Philip Rebohle e6814332e7
Revert "[d3d11] Re-enable image mapping"
Still breaks games for unknown reasons.
2018-03-13 17:40:12 +01:00
Philip Rebohle 72f954088b
[d3d11] Use only one mip level for multisampled textures 2018-03-13 11:29:25 +01:00
Philip Rebohle 3e60c8f316
[d3d11] Re-enable image mapping
After more extensive testing, it looks like commit 4eacff21
actually fixed the issue in most (all?) cases.
2018-03-12 12:54:05 +01:00
Mikhail Paulyshka b17568deba [dxgi,d3d11] log unknown interfaces GUID (#154)
* [d3d11] log unknown interfaces GUID in QueryInterface()

* [dxgi] log unknown interfaces GUID in QueryInterface()
2018-03-12 12:05:43 +01:00
Philip Rebohle bbbc552868
[d3d11] Disabled image mapping
Effectively reverts d3e89b20dd as it
breaks games for some reason.
2018-03-11 19:02:02 +01:00
Philip Rebohle 5b9e4c1faa
[d3d11] Fix image tiling
Fixes bug introduced in d3e89b20dd, which
applies linear tiling to the wrong kind of images.
2018-03-11 00:06:44 +01:00
Philip Rebohle d3e89b20dd
[d3d11] Allocate host-readable images on host-visible memory
Not having to wait for an image->buffer copy to finish on the
GPU allows for more efficient synchronization. Significantly
improves performance in The Witcher 3.
2018-03-10 23:32:15 +01:00
Philip Rebohle 2b9ab6626a
[d3d11] Do not create views if the resource bind flags are invalid 2018-02-22 21:38:45 +01:00
Philip Rebohle 0bb991a1fa
[d3d11] Using proper layout for depth textures read by shaders
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL works took, but
this may or may not improve performance.
2018-01-15 13:08:34 +01:00
Philip Rebohle 4e06f498dd [d3d11] Fixed several mip level-related bugs
- When a D3D11 texture was created with a mip level count of zero,
  DXVK would compute the correct number of mip levels, but not write
  them back to the description field.
- Framebuffers would always use the size of the top level, not the
  mip levels that were actually attached to the framebuffer.
- Several image copy operations did not handle mip levels other
  than the top mip level correctly.
2018-01-06 02:09:07 +01:00
Philip Rebohle e7bf76f5ef [d3d11] Re-implemented image mapping
Image mapping now returns the map pointer of a separate
buffer, rather than the the image itself. This fixes
issues with applications that ignore the RowPitch
and/or DepthPitch fields of the MappedSubresource struct.
2018-01-05 03:01:19 +01:00
Philip Rebohle 93a5cf093c [d3d11] Refactored texture interfaces
All texture classes now use the common info structure
internally as well so that it can be queried efficiently.
2018-01-05 01:15:56 +01:00
Philip Rebohle 5ceb041a49 [d3d11] Optimized texture image layouts 2018-01-01 19:03:05 +01:00
Philip Rebohle 0d3a1b25a1 [d3d11] Initial support for image updates + mapping 2017-12-25 20:40:48 +01:00
Philip Rebohle a3f9fa7547 [d3d11] Implemented 1D and 3D texture creation 2017-12-23 17:05:07 +01:00
Philip Rebohle 659ec7b59d [d3d11] Added DXGI format properties 2017-12-20 14:54:24 +01:00
Philip Rebohle 2c5b1c151f [d3d11] Refactored texture creation 2017-12-19 16:01:50 +01:00
Philip Rebohle f2587ab1b6 [dxgi] Implemented separate color/depth format tables
This is required because in D3D11, typeless formats can be used
to create both depth and stencil images, and color formats can
be used to view depth images. In Vulkan, images and views that
are used as depth-stencil attachments will have to be created
with a depth-stencil format, so we have to take the image's
bind flags into account when picking a format.
2017-12-19 14:47:35 +01:00
Philip Rebohle 2a266eaad4 [general] Added 32-bit support 2017-12-12 12:50:52 +01:00
Philip Rebohle f484454854 [d3d11] Device children actually do hold a reference to the device 2017-12-09 15:57:05 +01:00
Philip Rebohle ddb1627985 [d3d11] D3D11DeviceChild subclasses must not store strong references to their parent device 2017-12-07 00:55:21 +01:00
Philip Rebohle cf33315c0c [d3d11] Some cleanup work 2017-12-04 13:39:37 +01:00
Philip Rebohle b389c9ea1f [d3d11] Experimental implementation of OMSetRenderTargets and ClearRenderTargetView 2017-11-29 20:19:40 +01:00
Philip Rebohle b35f0c64b4 [dxgi] Refactored swap chain <-> device communication 2017-11-29 16:23:33 +01:00
Philip Rebohle a956c1b8ac [dxgi] Added DxgiResource for image and buffer creation 2017-11-29 15:16:07 +01:00
Philip Rebohle ad9f71fa02 [dxgi] Implemented DxgiSwapChain::GetBuffer and more of Present 2017-11-29 07:55:44 +01:00
Philip Rebohle 0c3a68c519 [d3d11] D3D11Texture2D stub 2017-11-27 15:52:24 +01:00