1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +01:00

[dxvk] Remove createImageView function

Use the image's method instead, like we already do for buffers.
This commit is contained in:
Philip Rebohle 2024-09-28 00:02:17 +02:00
parent a172cab34f
commit 01a7457a6f
14 changed files with 14 additions and 35 deletions

View File

@ -526,7 +526,7 @@ namespace dxvk {
DxvkImageViewCreateInfo info = imageView->info(); DxvkImageViewCreateInfo info = imageView->info();
info.format = rawFormat; info.format = rawFormat;
imageView = m_device->createImageView(imageView->image(), info); imageView = imageView->image()->createView(info);
} }
EmitCs([ EmitCs([

View File

@ -617,7 +617,7 @@ namespace dxvk {
viewInfo.numLevels = 1; viewInfo.numLevels = 1;
viewInfo.minLayer = 0; viewInfo.minLayer = 0;
viewInfo.numLayers = 1; viewInfo.numLayers = 1;
m_swapImageView = m_device->createImageView(m_swapImage, viewInfo); m_swapImageView = m_swapImage->createView(viewInfo);
// Initialize the image so that we can use it. Clearing // Initialize the image so that we can use it. Clearing
// to black prevents garbled output for the first frame. // to black prevents garbled output for the first frame.

View File

@ -219,7 +219,7 @@ namespace dxvk {
if (viewInfo.aspect != VK_IMAGE_ASPECT_COLOR_BIT) if (viewInfo.aspect != VK_IMAGE_ASPECT_COLOR_BIT)
viewInfo.format = formatFamily.Formats[i]; viewInfo.format = formatFamily.Formats[i];
m_views[i] = pDevice->GetDXVKDevice()->createImageView(dxvkImage, viewInfo); m_views[i] = dxvkImage->createView(viewInfo);
} }
m_isYCbCr = IsYCbCrFormat(resourceDesc.Format); m_isYCbCr = IsYCbCrFormat(resourceDesc.Format);
@ -314,8 +314,7 @@ namespace dxvk {
throw DxvkError("Invalid view dimension"); throw DxvkError("Invalid view dimension");
} }
m_view = pDevice->GetDXVKDevice()->createImageView( m_view = GetCommonTexture(pResource)->GetImage()->createView(viewInfo);
GetCommonTexture(pResource)->GetImage(), viewInfo);
} }

View File

@ -99,8 +99,7 @@ namespace dxvk {
m_info.Image.Aspects &= ~VK_IMAGE_ASPECT_STENCIL_BIT; m_info.Image.Aspects &= ~VK_IMAGE_ASPECT_STENCIL_BIT;
// Create the underlying image view object // Create the underlying image view object
m_view = pDevice->GetDXVKDevice()->createImageView( m_view = GetCommonTexture(pResource)->GetImage()->createView(viewInfo);
GetCommonTexture(pResource)->GetImage(), viewInfo);
} }

View File

@ -110,7 +110,7 @@ namespace dxvk {
m_info.Image.NumLayers = viewInfo.numLayers; m_info.Image.NumLayers = viewInfo.numLayers;
// Create the underlying image view object // Create the underlying image view object
m_view = pDevice->GetDXVKDevice()->createImageView(texture->GetImage(), viewInfo); m_view = texture->GetImage()->createView(viewInfo);
} }

View File

@ -176,7 +176,7 @@ namespace dxvk {
m_info.Image.NumLayers = viewInfo.numLayers; m_info.Image.NumLayers = viewInfo.numLayers;
// Create the underlying image view object // Create the underlying image view object
m_imageView = pDevice->GetDXVKDevice()->createImageView(texture->GetImage(), viewInfo); m_imageView = texture->GetImage()->createView(viewInfo);
} }
} }

View File

@ -121,8 +121,7 @@ namespace dxvk {
m_info.Image.NumLevels = viewInfo.numLevels; m_info.Image.NumLevels = viewInfo.numLevels;
m_info.Image.NumLayers = viewInfo.numLayers; m_info.Image.NumLayers = viewInfo.numLayers;
m_imageView = pDevice->GetDXVKDevice()->createImageView( m_imageView = GetCommonTexture(pResource)->GetImage()->createView(viewInfo);
GetCommonTexture(pResource)->GetImage(), viewInfo);
} }
} }

View File

@ -663,7 +663,7 @@ namespace dxvk {
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY }; VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY };
// Create the underlying image view object // Create the underlying image view object
return m_device->GetDXVKDevice()->createImageView(GetImage(), viewInfo); return GetImage()->createView(viewInfo);
} }

View File

@ -85,7 +85,7 @@ namespace dxvk {
imageViewInfo.numLevels = 1; imageViewInfo.numLevels = 1;
imageViewInfo.minLayer = dstSubresource.baseArrayLayer; imageViewInfo.minLayer = dstSubresource.baseArrayLayer;
imageViewInfo.numLayers = dstSubresource.layerCount; imageViewInfo.numLayers = dstSubresource.layerCount;
auto tmpImageView = m_device->createImageView(dstImage, imageViewInfo); auto tmpImageView = dstImage->createView(imageViewInfo);
VkExtent3D imageExtent = dstImage->mipLevelExtent(dstSubresource.mipLevel); VkExtent3D imageExtent = dstImage->mipLevelExtent(dstSubresource.mipLevel);
imageExtent = VkExtent3D{ imageExtent.width / macroPixelRun.width, imageExtent = VkExtent3D{ imageExtent.width / macroPixelRun.width,

View File

@ -3919,7 +3919,7 @@ namespace dxvk {
if (dstImage->mipLevelExtent(dstSubresource.mipLevel) != dstExtent) if (dstImage->mipLevelExtent(dstSubresource.mipLevel) != dstExtent)
return false; return false;
auto view = m_device->createImageView(dstImage, viewInfo); auto view = dstImage->createView(viewInfo);
this->deferClear(view, srcSubresource.aspectMask, clear->clearValue); this->deferClear(view, srcSubresource.aspectMask, clear->clearValue);
return true; return true;
} }

View File

@ -171,13 +171,6 @@ namespace dxvk {
} }
Rc<DxvkImageView> DxvkDevice::createImageView(
const Rc<DxvkImage>& image,
const DxvkImageViewCreateInfo& createInfo) {
return image->createView(createInfo);
}
Rc<DxvkSampler> DxvkDevice::createSampler( Rc<DxvkSampler> DxvkDevice::createSampler(
const DxvkSamplerCreateInfo& createInfo) { const DxvkSamplerCreateInfo& createInfo) {
return new DxvkSampler(this, createInfo); return new DxvkSampler(this, createInfo);

View File

@ -323,17 +323,6 @@ namespace dxvk {
const DxvkImageCreateInfo& createInfo, const DxvkImageCreateInfo& createInfo,
VkMemoryPropertyFlags memoryType); VkMemoryPropertyFlags memoryType);
/**
* \brief Creates an image view
*
* \param [in] image The image to create a view for
* \param [in] createInfo Image view create info
* \returns The image view
*/
Rc<DxvkImageView> createImageView(
const Rc<DxvkImage>& image,
const DxvkImageViewCreateInfo& createInfo);
/** /**
* \brief Creates a sampler object * \brief Creates a sampler object
* *

View File

@ -267,7 +267,7 @@ namespace dxvk {
viewInfo.minLayer = 0; viewInfo.minLayer = 0;
viewInfo.numLayers = 1; viewInfo.numLayers = 1;
m_gammaView = m_device->createImageView(m_gammaImage, viewInfo); m_gammaView = m_gammaImage->createView(viewInfo);
} }
ctx->invalidateBuffer(m_gammaBuffer, std::move(m_gammaSlice)); ctx->invalidateBuffer(m_gammaBuffer, std::move(m_gammaSlice));
@ -380,7 +380,7 @@ namespace dxvk {
viewInfo.numLevels = 1; viewInfo.numLevels = 1;
viewInfo.minLayer = 0; viewInfo.minLayer = 0;
viewInfo.numLayers = 1; viewInfo.numLayers = 1;
m_resolveView = m_device->createImageView(m_resolveImage, viewInfo); m_resolveView = m_resolveImage->createView(viewInfo);
} }

View File

@ -316,7 +316,7 @@ namespace dxvk::hud {
info.minLayer = 0; info.minLayer = 0;
info.numLayers = 1; info.numLayers = 1;
return m_device->createImageView(m_fontImage, info); return m_fontImage->createView(info);
} }