[d3d11] CreateRenderTargetView now uses proper format

This commit is contained in:
Philip Rebohle 2017-12-04 13:47:18 +01:00
parent cf33315c0c
commit 365f992a97
2 changed files with 18 additions and 10 deletions

View File

@ -19,6 +19,14 @@ namespace dxvk {
m_featureFlags (featureFlags),
m_dxvkDevice (m_dxgiDevice->GetDXVKDevice()),
m_dxvkAdapter (m_dxvkDevice->adapter()) {
Com<IDXGIAdapter> adapter;
if (FAILED(m_dxgiDevice->GetAdapter(&adapter))
|| FAILED(adapter->QueryInterface(__uuidof(IDXGIAdapterPrivate),
reinterpret_cast<void**>(&m_dxgiAdapter))))
throw DxvkError("D3D11Device: Failed to query adapter");
m_dxgiDevice->SetDeviceLayer(this);
m_presentDevice->SetDeviceLayer(this);
@ -179,9 +187,8 @@ namespace dxvk {
// Fill in Vulkan image view info
DxvkImageViewCreateInfo viewInfo;
// FIXME look up Vulkan format for DXGI format
viewInfo.format = image->info().format;
viewInfo.aspect = VK_IMAGE_ASPECT_COLOR_BIT;
viewInfo.format = m_dxgiAdapter->LookupFormat(desc.Format).actual;
viewInfo.aspect = VK_IMAGE_ASPECT_COLOR_BIT;
switch (desc.ViewDimension) {
case D3D11_RTV_DIMENSION_TEXTURE2D:

View File

@ -230,16 +230,17 @@ namespace dxvk {
private:
const Com<IDXGIDevicePrivate> m_dxgiDevice;
const Com<D3D11PresentDevice> m_presentDevice;
const Com<IDXGIDevicePrivate> m_dxgiDevice;
Com<IDXGIAdapterPrivate> m_dxgiAdapter;
const Com<D3D11PresentDevice> m_presentDevice;
const D3D_FEATURE_LEVEL m_featureLevel;
const UINT m_featureFlags;
const D3D_FEATURE_LEVEL m_featureLevel;
const UINT m_featureFlags;
const Rc<DxvkDevice> m_dxvkDevice;
const Rc<DxvkAdapter> m_dxvkAdapter;
const Rc<DxvkDevice> m_dxvkDevice;
const Rc<DxvkAdapter> m_dxvkAdapter;
Com<ID3D11DeviceContext> m_context;
Com<ID3D11DeviceContext> m_context;
};