mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[dxvk] Rename imageFormatInfo -> lookupFormatInfo
This commit is contained in:
parent
5c4b44c97c
commit
cdf22a4086
@ -355,8 +355,8 @@ namespace dxvk {
|
|||||||
|| SrcSubresource >= srcTexture->CountSubresources())
|
|| SrcSubresource >= srcTexture->CountSubresources())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto dstFormatInfo = imageFormatInfo(dstTexture->GetPackedFormat());
|
auto dstFormatInfo = lookupFormatInfo(dstTexture->GetPackedFormat());
|
||||||
auto srcFormatInfo = imageFormatInfo(srcTexture->GetPackedFormat());
|
auto srcFormatInfo = lookupFormatInfo(srcTexture->GetPackedFormat());
|
||||||
|
|
||||||
auto dstLayers = vk::makeSubresourceLayers(dstTexture->GetSubresourceFromIndex(dstFormatInfo->aspectMask, DstSubresource));
|
auto dstLayers = vk::makeSubresourceLayers(dstTexture->GetSubresourceFromIndex(dstFormatInfo->aspectMask, DstSubresource));
|
||||||
auto srcLayers = vk::makeSubresourceLayers(srcTexture->GetSubresourceFromIndex(srcFormatInfo->aspectMask, SrcSubresource));
|
auto srcLayers = vk::makeSubresourceLayers(srcTexture->GetSubresourceFromIndex(srcFormatInfo->aspectMask, SrcSubresource));
|
||||||
@ -433,8 +433,8 @@ namespace dxvk {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto dstFormatInfo = imageFormatInfo(dstTexture->GetPackedFormat());
|
auto dstFormatInfo = lookupFormatInfo(dstTexture->GetPackedFormat());
|
||||||
auto srcFormatInfo = imageFormatInfo(srcTexture->GetPackedFormat());
|
auto srcFormatInfo = lookupFormatInfo(srcTexture->GetPackedFormat());
|
||||||
|
|
||||||
for (uint32_t i = 0; i < dstDesc->MipLevels; i++) {
|
for (uint32_t i = 0; i < dstDesc->MipLevels; i++) {
|
||||||
VkImageSubresourceLayers dstLayers = { dstFormatInfo->aspectMask, i, 0, dstDesc->ArraySize };
|
VkImageSubresourceLayers dstLayers = { dstFormatInfo->aspectMask, i, 0, dstDesc->ArraySize };
|
||||||
@ -870,7 +870,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
// We'll need the format info to determine the buffer
|
// We'll need the format info to determine the buffer
|
||||||
// element size, and we also need it for depth images.
|
// element size, and we also need it for depth images.
|
||||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(format);
|
const DxvkFormatInfo* formatInfo = lookupFormatInfo(format);
|
||||||
|
|
||||||
// Convert the clear color format. ClearView takes
|
// Convert the clear color format. ClearView takes
|
||||||
// the clear value for integer formats as a set of
|
// the clear value for integer formats as a set of
|
||||||
@ -1077,8 +1077,8 @@ namespace dxvk {
|
|||||||
const DXGI_VK_FORMAT_INFO dstFormatInfo = m_parent->LookupFormat(dstDesc.Format, DXGI_VK_FORMAT_MODE_ANY);
|
const DXGI_VK_FORMAT_INFO dstFormatInfo = m_parent->LookupFormat(dstDesc.Format, DXGI_VK_FORMAT_MODE_ANY);
|
||||||
const DXGI_VK_FORMAT_INFO srcFormatInfo = m_parent->LookupFormat(srcDesc.Format, DXGI_VK_FORMAT_MODE_ANY);
|
const DXGI_VK_FORMAT_INFO srcFormatInfo = m_parent->LookupFormat(srcDesc.Format, DXGI_VK_FORMAT_MODE_ANY);
|
||||||
|
|
||||||
auto dstVulkanFormatInfo = imageFormatInfo(dstFormatInfo.Format);
|
auto dstVulkanFormatInfo = lookupFormatInfo(dstFormatInfo.Format);
|
||||||
auto srcVulkanFormatInfo = imageFormatInfo(srcFormatInfo.Format);
|
auto srcVulkanFormatInfo = lookupFormatInfo(srcFormatInfo.Format);
|
||||||
|
|
||||||
if (DstSubresource >= dstTextureInfo->CountSubresources()
|
if (DstSubresource >= dstTextureInfo->CountSubresources()
|
||||||
|| SrcSubresource >= srcTextureInfo->CountSubresources())
|
|| SrcSubresource >= srcTextureInfo->CountSubresources())
|
||||||
@ -3428,8 +3428,8 @@ namespace dxvk {
|
|||||||
VkOffset3D SrcOffset,
|
VkOffset3D SrcOffset,
|
||||||
VkExtent3D SrcExtent) {
|
VkExtent3D SrcExtent) {
|
||||||
// Image formats must be size-compatible
|
// Image formats must be size-compatible
|
||||||
auto dstFormatInfo = imageFormatInfo(pDstTexture->GetPackedFormat());
|
auto dstFormatInfo = lookupFormatInfo(pDstTexture->GetPackedFormat());
|
||||||
auto srcFormatInfo = imageFormatInfo(pSrcTexture->GetPackedFormat());
|
auto srcFormatInfo = lookupFormatInfo(pSrcTexture->GetPackedFormat());
|
||||||
|
|
||||||
if (dstFormatInfo->elementSize != srcFormatInfo->elementSize) {
|
if (dstFormatInfo->elementSize != srcFormatInfo->elementSize) {
|
||||||
Logger::err("D3D11: CopyImage: Incompatible texel size");
|
Logger::err("D3D11: CopyImage: Incompatible texel size");
|
||||||
@ -3753,7 +3753,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
VkFormat packedFormat = pDstTexture->GetPackedFormat();
|
VkFormat packedFormat = pDstTexture->GetPackedFormat();
|
||||||
|
|
||||||
auto formatInfo = imageFormatInfo(packedFormat);
|
auto formatInfo = lookupFormatInfo(packedFormat);
|
||||||
auto subresource = pDstTexture->GetSubresourceFromIndex(
|
auto subresource = pDstTexture->GetSubresourceFromIndex(
|
||||||
formatInfo->aspectMask, DstSubresource);
|
formatInfo->aspectMask, DstSubresource);
|
||||||
|
|
||||||
@ -3837,7 +3837,7 @@ namespace dxvk {
|
|||||||
VkExtent3D dstMipExtent = pDstTexture->MipLevelExtent(pDstSubresource->mipLevel);
|
VkExtent3D dstMipExtent = pDstTexture->MipLevelExtent(pDstSubresource->mipLevel);
|
||||||
|
|
||||||
auto dstFormat = pDstTexture->GetPackedFormat();
|
auto dstFormat = pDstTexture->GetPackedFormat();
|
||||||
auto dstFormatInfo = imageFormatInfo(dstFormat);
|
auto dstFormatInfo = lookupFormatInfo(dstFormat);
|
||||||
|
|
||||||
uint32_t planeCount = 1;
|
uint32_t planeCount = 1;
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
VkFormat packedFormat = pTexture->GetPackedFormat();
|
VkFormat packedFormat = pTexture->GetPackedFormat();
|
||||||
|
|
||||||
auto formatInfo = imageFormatInfo(packedFormat);
|
auto formatInfo = lookupFormatInfo(packedFormat);
|
||||||
auto subresource = pTexture->GetSubresourceFromIndex(
|
auto subresource = pTexture->GetSubresourceFromIndex(
|
||||||
formatInfo->aspectMask, Subresource);
|
formatInfo->aspectMask, Subresource);
|
||||||
|
|
||||||
|
@ -477,7 +477,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
uint64_t sequenceNumber = pResource->GetSequenceNumber(Subresource);
|
uint64_t sequenceNumber = pResource->GetSequenceNumber(Subresource);
|
||||||
|
|
||||||
auto formatInfo = imageFormatInfo(packedFormat);
|
auto formatInfo = lookupFormatInfo(packedFormat);
|
||||||
void* mapPtr;
|
void* mapPtr;
|
||||||
|
|
||||||
if (mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DIRECT) {
|
if (mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DIRECT) {
|
||||||
@ -609,7 +609,7 @@ namespace dxvk {
|
|||||||
(pResource->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER)) {
|
(pResource->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER)) {
|
||||||
// Now that data has been written into the buffer,
|
// Now that data has been written into the buffer,
|
||||||
// we need to copy its contents into the image
|
// we need to copy its contents into the image
|
||||||
VkImageAspectFlags aspectMask = imageFormatInfo(pResource->GetPackedFormat())->aspectMask;
|
VkImageAspectFlags aspectMask = lookupFormatInfo(pResource->GetPackedFormat())->aspectMask;
|
||||||
VkImageSubresource subresource = pResource->GetSubresourceFromIndex(aspectMask, Subresource);
|
VkImageSubresource subresource = pResource->GetSubresourceFromIndex(aspectMask, Subresource);
|
||||||
|
|
||||||
UpdateImage(pResource, &subresource, VkOffset3D { 0, 0, 0 },
|
UpdateImage(pResource, &subresource, VkOffset3D { 0, 0, 0 },
|
||||||
|
@ -629,7 +629,7 @@ namespace dxvk {
|
|||||||
// generate the exact vertex layout. In that case we'll
|
// generate the exact vertex layout. In that case we'll
|
||||||
// pack attributes on the same binding in the order they
|
// pack attributes on the same binding in the order they
|
||||||
// are declared, aligning each attribute to four bytes.
|
// are declared, aligning each attribute to four bytes.
|
||||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(attrib.format);
|
const DxvkFormatInfo* formatInfo = lookupFormatInfo(attrib.format);
|
||||||
VkDeviceSize alignment = std::min<VkDeviceSize>(formatInfo->elementSize, 4);
|
VkDeviceSize alignment = std::min<VkDeviceSize>(formatInfo->elementSize, 4);
|
||||||
|
|
||||||
if (attrib.offset == D3D11_APPEND_ALIGNED_ELEMENT) {
|
if (attrib.offset == D3D11_APPEND_ALIGNED_ELEMENT) {
|
||||||
@ -639,7 +639,7 @@ namespace dxvk {
|
|||||||
const DxvkVertexAttribute& prev = attrList.at(i - j);
|
const DxvkVertexAttribute& prev = attrList.at(i - j);
|
||||||
|
|
||||||
if (prev.binding == attrib.binding) {
|
if (prev.binding == attrib.binding) {
|
||||||
attrib.offset = align(prev.offset + imageFormatInfo(prev.format)->elementSize, alignment);
|
attrib.offset = align(prev.offset + lookupFormatInfo(prev.format)->elementSize, alignment);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2046,7 +2046,7 @@ namespace dxvk {
|
|||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
// Query Vulkan format properties and supported features for it
|
// Query Vulkan format properties and supported features for it
|
||||||
const DxvkFormatInfo* fmtProperties = imageFormatInfo(fmtMapping.Format);
|
const DxvkFormatInfo* fmtProperties = lookupFormatInfo(fmtMapping.Format);
|
||||||
|
|
||||||
VkFormatProperties fmtSupport = fmtMapping.Format != VK_FORMAT_UNDEFINED
|
VkFormatProperties fmtSupport = fmtMapping.Format != VK_FORMAT_UNDEFINED
|
||||||
? m_dxvkAdapter->formatProperties(fmtMapping.Format)
|
? m_dxvkAdapter->formatProperties(fmtMapping.Format)
|
||||||
@ -2338,7 +2338,7 @@ namespace dxvk {
|
|||||||
texture->Desc()->Format,
|
texture->Desc()->Format,
|
||||||
texture->GetFormatMode()).Format;
|
texture->GetFormatMode()).Format;
|
||||||
|
|
||||||
auto formatInfo = imageFormatInfo(packedFormat);
|
auto formatInfo = lookupFormatInfo(packedFormat);
|
||||||
|
|
||||||
// Validate box against subresource dimensions
|
// Validate box against subresource dimensions
|
||||||
Rc<DxvkImage> image = texture->GetImage();
|
Rc<DxvkImage> image = texture->GetImage();
|
||||||
|
@ -123,7 +123,7 @@ namespace dxvk {
|
|||||||
auto desc = pTexture->Desc();
|
auto desc = pTexture->Desc();
|
||||||
|
|
||||||
VkFormat packedFormat = m_parent->LookupPackedFormat(desc->Format, pTexture->GetFormatMode()).Format;
|
VkFormat packedFormat = m_parent->LookupPackedFormat(desc->Format, pTexture->GetFormatMode()).Format;
|
||||||
auto formatInfo = imageFormatInfo(packedFormat);
|
auto formatInfo = lookupFormatInfo(packedFormat);
|
||||||
|
|
||||||
if (pInitialData != nullptr && pInitialData->pSysMem != nullptr) {
|
if (pInitialData != nullptr && pInitialData->pSysMem != nullptr) {
|
||||||
// pInitialData is an array that stores an entry for
|
// pInitialData is an array that stores an entry for
|
||||||
|
@ -70,7 +70,7 @@ namespace dxvk {
|
|||||||
// The image must be marked as mutable if it can be reinterpreted
|
// The image must be marked as mutable if it can be reinterpreted
|
||||||
// by a view with a different format. Depth-stencil formats cannot
|
// by a view with a different format. Depth-stencil formats cannot
|
||||||
// be reinterpreted in Vulkan, so we'll ignore those.
|
// be reinterpreted in Vulkan, so we'll ignore those.
|
||||||
auto formatProperties = imageFormatInfo(formatInfo.Format);
|
auto formatProperties = lookupFormatInfo(formatInfo.Format);
|
||||||
|
|
||||||
bool isMutable = formatFamily.FormatCount > 1;
|
bool isMutable = formatFamily.FormatCount > 1;
|
||||||
bool isMultiPlane = (formatProperties->aspectMask & VK_IMAGE_ASPECT_PLANE_0_BIT) != 0;
|
bool isMultiPlane = (formatProperties->aspectMask & VK_IMAGE_ASPECT_PLANE_0_BIT) != 0;
|
||||||
@ -229,7 +229,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
VkDeviceSize D3D11CommonTexture::ComputeMappedOffset(UINT Subresource, UINT Plane, VkOffset3D Offset) const {
|
VkDeviceSize D3D11CommonTexture::ComputeMappedOffset(UINT Subresource, UINT Plane, VkOffset3D Offset) const {
|
||||||
auto packedFormatInfo = imageFormatInfo(m_packedFormat);
|
auto packedFormatInfo = lookupFormatInfo(m_packedFormat);
|
||||||
|
|
||||||
VkImageAspectFlags aspectMask = packedFormatInfo->aspectMask;
|
VkImageAspectFlags aspectMask = packedFormatInfo->aspectMask;
|
||||||
VkDeviceSize elementSize = packedFormatInfo->elementSize;
|
VkDeviceSize elementSize = packedFormatInfo->elementSize;
|
||||||
@ -281,7 +281,7 @@ namespace dxvk {
|
|||||||
case D3D11_COMMON_TEXTURE_MAP_MODE_NONE:
|
case D3D11_COMMON_TEXTURE_MAP_MODE_NONE:
|
||||||
case D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER:
|
case D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER:
|
||||||
case D3D11_COMMON_TEXTURE_MAP_MODE_STAGING: {
|
case D3D11_COMMON_TEXTURE_MAP_MODE_STAGING: {
|
||||||
auto packedFormatInfo = imageFormatInfo(m_packedFormat);
|
auto packedFormatInfo = lookupFormatInfo(m_packedFormat);
|
||||||
|
|
||||||
VkImageAspectFlags aspects = packedFormatInfo->aspectMask;
|
VkImageAspectFlags aspects = packedFormatInfo->aspectMask;
|
||||||
VkExtent3D mipExtent = MipLevelExtent(subresource.mipLevel);
|
VkExtent3D mipExtent = MipLevelExtent(subresource.mipLevel);
|
||||||
@ -379,8 +379,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Otherwise, all bit-compatible formats can be used.
|
// Otherwise, all bit-compatible formats can be used.
|
||||||
if (imageInfo.viewFormatCount == 0 && planeCount == 1) {
|
if (imageInfo.viewFormatCount == 0 && planeCount == 1) {
|
||||||
auto baseFormatInfo = imageFormatInfo(baseFormat.Format);
|
auto baseFormatInfo = lookupFormatInfo(baseFormat.Format);
|
||||||
auto viewFormatInfo = imageFormatInfo(viewFormat.Format);
|
auto viewFormatInfo = lookupFormatInfo(viewFormat.Format);
|
||||||
|
|
||||||
return baseFormatInfo->aspectMask == viewFormatInfo->aspectMask
|
return baseFormatInfo->aspectMask == viewFormatInfo->aspectMask
|
||||||
&& baseFormatInfo->elementSize == viewFormatInfo->elementSize;
|
&& baseFormatInfo->elementSize == viewFormatInfo->elementSize;
|
||||||
@ -530,7 +530,7 @@ namespace dxvk {
|
|||||||
const auto dsMask = VK_IMAGE_ASPECT_DEPTH_BIT
|
const auto dsMask = VK_IMAGE_ASPECT_DEPTH_BIT
|
||||||
| VK_IMAGE_ASPECT_STENCIL_BIT;
|
| VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||||
|
|
||||||
auto formatInfo = imageFormatInfo(Format);
|
auto formatInfo = lookupFormatInfo(Format);
|
||||||
|
|
||||||
return formatInfo->aspectMask == dsMask
|
return formatInfo->aspectMask == dsMask
|
||||||
? VK_IMAGE_USAGE_SAMPLED_BIT
|
? VK_IMAGE_USAGE_SAMPLED_BIT
|
||||||
@ -572,7 +572,7 @@ namespace dxvk {
|
|||||||
return D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER;
|
return D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER;
|
||||||
|
|
||||||
// Multi-plane images have a special memory layout in D3D11
|
// Multi-plane images have a special memory layout in D3D11
|
||||||
if (imageFormatInfo(pImageInfo->format)->flags.test(DxvkFormatFlag::MultiPlane))
|
if (lookupFormatInfo(pImageInfo->format)->flags.test(DxvkFormatFlag::MultiPlane))
|
||||||
return D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER;
|
return D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER;
|
||||||
|
|
||||||
// If we can't use linear tiling for this image, we have to use a buffer
|
// If we can't use linear tiling for this image, we have to use a buffer
|
||||||
@ -644,7 +644,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
D3D11CommonTexture::MappedBuffer D3D11CommonTexture::CreateMappedBuffer(UINT MipLevel) const {
|
D3D11CommonTexture::MappedBuffer D3D11CommonTexture::CreateMappedBuffer(UINT MipLevel) const {
|
||||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(
|
const DxvkFormatInfo* formatInfo = lookupFormatInfo(
|
||||||
m_device->LookupPackedFormat(m_desc.Format, GetFormatMode()).Format);
|
m_device->LookupPackedFormat(m_desc.Format, GetFormatMode()).Format);
|
||||||
|
|
||||||
DxvkBufferCreateInfo info;
|
DxvkBufferCreateInfo info;
|
||||||
|
@ -159,7 +159,7 @@ namespace dxvk {
|
|||||||
DXGI_VK_FORMAT_INFO formatInfo = pDevice->LookupFormat(resourceDesc.Format, DXGI_VK_FORMAT_MODE_COLOR);
|
DXGI_VK_FORMAT_INFO formatInfo = pDevice->LookupFormat(resourceDesc.Format, DXGI_VK_FORMAT_MODE_COLOR);
|
||||||
DXGI_VK_FORMAT_FAMILY formatFamily = pDevice->LookupFamily(resourceDesc.Format, DXGI_VK_FORMAT_MODE_COLOR);
|
DXGI_VK_FORMAT_FAMILY formatFamily = pDevice->LookupFamily(resourceDesc.Format, DXGI_VK_FORMAT_MODE_COLOR);
|
||||||
|
|
||||||
VkImageAspectFlags aspectMask = imageFormatInfo(formatInfo.Format)->aspectMask;
|
VkImageAspectFlags aspectMask = lookupFormatInfo(formatInfo.Format)->aspectMask;
|
||||||
|
|
||||||
DxvkImageViewCreateInfo viewInfo;
|
DxvkImageViewCreateInfo viewInfo;
|
||||||
viewInfo.format = formatInfo.Format;
|
viewInfo.format = formatInfo.Format;
|
||||||
@ -257,7 +257,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkImageViewCreateInfo viewInfo;
|
DxvkImageViewCreateInfo viewInfo;
|
||||||
viewInfo.format = formatInfo.Format;
|
viewInfo.format = formatInfo.Format;
|
||||||
viewInfo.aspect = imageFormatInfo(viewInfo.format)->aspectMask;
|
viewInfo.aspect = lookupFormatInfo(viewInfo.format)->aspectMask;
|
||||||
viewInfo.swizzle = formatInfo.Swizzle;
|
viewInfo.swizzle = formatInfo.Swizzle;
|
||||||
viewInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
viewInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkImageViewCreateInfo viewInfo;
|
DxvkImageViewCreateInfo viewInfo;
|
||||||
viewInfo.format = pDevice->LookupFormat(pDesc->Format, DXGI_VK_FORMAT_MODE_DEPTH).Format;
|
viewInfo.format = pDevice->LookupFormat(pDesc->Format, DXGI_VK_FORMAT_MODE_DEPTH).Format;
|
||||||
viewInfo.aspect = imageFormatInfo(viewInfo.format)->aspectMask;
|
viewInfo.aspect = lookupFormatInfo(viewInfo.format)->aspectMask;
|
||||||
viewInfo.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
viewInfo.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||||
|
|
||||||
switch (pDesc->ViewDimension) {
|
switch (pDesc->ViewDimension) {
|
||||||
|
@ -24,7 +24,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkImageViewCreateInfo viewInfo;
|
DxvkImageViewCreateInfo viewInfo;
|
||||||
viewInfo.format = formatInfo.Format;
|
viewInfo.format = formatInfo.Format;
|
||||||
viewInfo.aspect = imageFormatInfo(viewInfo.format)->aspectMask;
|
viewInfo.aspect = lookupFormatInfo(viewInfo.format)->aspectMask;
|
||||||
viewInfo.swizzle = formatInfo.Swizzle;
|
viewInfo.swizzle = formatInfo.Swizzle;
|
||||||
viewInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
viewInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ namespace dxvk {
|
|||||||
} else {
|
} else {
|
||||||
viewInfo.format = pDevice->LookupFormat(pDesc->Format, DXGI_VK_FORMAT_MODE_COLOR).Format;
|
viewInfo.format = pDevice->LookupFormat(pDesc->Format, DXGI_VK_FORMAT_MODE_COLOR).Format;
|
||||||
|
|
||||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(viewInfo.format);
|
const DxvkFormatInfo* formatInfo = lookupFormatInfo(viewInfo.format);
|
||||||
viewInfo.rangeOffset = formatInfo->elementSize * bufInfo.FirstElement;
|
viewInfo.rangeOffset = formatInfo->elementSize * bufInfo.FirstElement;
|
||||||
viewInfo.rangeLength = formatInfo->elementSize * bufInfo.NumElements;
|
viewInfo.rangeLength = formatInfo->elementSize * bufInfo.NumElements;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ namespace dxvk {
|
|||||||
} else {
|
} else {
|
||||||
viewInfo.format = pDevice->LookupFormat(pDesc->Format, DXGI_VK_FORMAT_MODE_COLOR).Format;
|
viewInfo.format = pDevice->LookupFormat(pDesc->Format, DXGI_VK_FORMAT_MODE_COLOR).Format;
|
||||||
|
|
||||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(viewInfo.format);
|
const DxvkFormatInfo* formatInfo = lookupFormatInfo(viewInfo.format);
|
||||||
viewInfo.rangeOffset = formatInfo->elementSize * pDesc->Buffer.FirstElement;
|
viewInfo.rangeOffset = formatInfo->elementSize * pDesc->Buffer.FirstElement;
|
||||||
viewInfo.rangeLength = formatInfo->elementSize * pDesc->Buffer.NumElements;
|
viewInfo.rangeLength = formatInfo->elementSize * pDesc->Buffer.NumElements;
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ namespace dxvk {
|
|||||||
const UINT MipLevel = Subresource % m_desc.MipLevels;
|
const UINT MipLevel = Subresource % m_desc.MipLevels;
|
||||||
|
|
||||||
const DxvkFormatInfo* formatInfo = m_mapping.FormatColor != VK_FORMAT_UNDEFINED
|
const DxvkFormatInfo* formatInfo = m_mapping.FormatColor != VK_FORMAT_UNDEFINED
|
||||||
? imageFormatInfo(m_mapping.FormatColor)
|
? lookupFormatInfo(m_mapping.FormatColor)
|
||||||
: m_device->UnsupportedFormatInfo(m_desc.Format);
|
: m_device->UnsupportedFormatInfo(m_desc.Format);
|
||||||
|
|
||||||
const VkExtent3D mipExtent = util::computeMipLevelExtent(
|
const VkExtent3D mipExtent = util::computeMipLevelExtent(
|
||||||
@ -263,7 +263,7 @@ namespace dxvk {
|
|||||||
// The image must be marked as mutable if it can be reinterpreted
|
// The image must be marked as mutable if it can be reinterpreted
|
||||||
// by a view with a different format. Depth-stencil formats cannot
|
// by a view with a different format. Depth-stencil formats cannot
|
||||||
// be reinterpreted in Vulkan, so we'll ignore those.
|
// be reinterpreted in Vulkan, so we'll ignore those.
|
||||||
auto formatProperties = imageFormatInfo(m_mapping.FormatColor);
|
auto formatProperties = lookupFormatInfo(m_mapping.FormatColor);
|
||||||
|
|
||||||
bool isMutable = m_mapping.FormatSrgb != VK_FORMAT_UNDEFINED;
|
bool isMutable = m_mapping.FormatSrgb != VK_FORMAT_UNDEFINED;
|
||||||
bool isColorFormat = (formatProperties->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) != 0;
|
bool isColorFormat = (formatProperties->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) != 0;
|
||||||
@ -541,7 +541,7 @@ namespace dxvk {
|
|||||||
viewInfo.format = m_mapping.ConversionFormatInfo.FormatColor != VK_FORMAT_UNDEFINED
|
viewInfo.format = m_mapping.ConversionFormatInfo.FormatColor != VK_FORMAT_UNDEFINED
|
||||||
? PickSRGB(m_mapping.ConversionFormatInfo.FormatColor, m_mapping.ConversionFormatInfo.FormatSrgb, Srgb)
|
? PickSRGB(m_mapping.ConversionFormatInfo.FormatColor, m_mapping.ConversionFormatInfo.FormatSrgb, Srgb)
|
||||||
: PickSRGB(m_mapping.FormatColor, m_mapping.FormatSrgb, Srgb);
|
: PickSRGB(m_mapping.FormatColor, m_mapping.FormatSrgb, Srgb);
|
||||||
viewInfo.aspect = imageFormatInfo(viewInfo.format)->aspectMask;
|
viewInfo.aspect = lookupFormatInfo(viewInfo.format)->aspectMask;
|
||||||
viewInfo.swizzle = m_mapping.Swizzle;
|
viewInfo.swizzle = m_mapping.Swizzle;
|
||||||
viewInfo.usage = UsageFlags;
|
viewInfo.usage = UsageFlags;
|
||||||
viewInfo.type = GetImageViewTypeFromResourceType(m_type, Layer);
|
viewInfo.type = GetImageViewTypeFromResourceType(m_type, Layer);
|
||||||
|
@ -735,7 +735,7 @@ namespace dxvk {
|
|||||||
if (unlikely(srcTextureInfo->Desc()->Format != dstTextureInfo->Desc()->Format))
|
if (unlikely(srcTextureInfo->Desc()->Format != dstTextureInfo->Desc()->Format))
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(dstTextureInfo->GetFormatMapping().FormatColor);
|
const DxvkFormatInfo* formatInfo = lookupFormatInfo(dstTextureInfo->GetFormatMapping().FormatColor);
|
||||||
|
|
||||||
VkOffset3D srcOffset = { 0u, 0u, 0u };
|
VkOffset3D srcOffset = { 0u, 0u, 0u };
|
||||||
VkOffset3D dstOffset = { 0u, 0u, 0u };
|
VkOffset3D dstOffset = { 0u, 0u, 0u };
|
||||||
@ -878,7 +878,7 @@ namespace dxvk {
|
|||||||
Rc<DxvkBuffer> dstBuffer = dstTexInfo->GetBuffer(dst->GetSubresource());
|
Rc<DxvkBuffer> dstBuffer = dstTexInfo->GetBuffer(dst->GetSubresource());
|
||||||
|
|
||||||
Rc<DxvkImage> srcImage = srcTexInfo->GetImage();
|
Rc<DxvkImage> srcImage = srcTexInfo->GetImage();
|
||||||
const DxvkFormatInfo* srcFormatInfo = imageFormatInfo(srcImage->info().format);
|
const DxvkFormatInfo* srcFormatInfo = lookupFormatInfo(srcImage->info().format);
|
||||||
|
|
||||||
const VkImageSubresource srcSubresource = srcTexInfo->GetSubresourceFromIndex(srcFormatInfo->aspectMask, src->GetSubresource());
|
const VkImageSubresource srcSubresource = srcTexInfo->GetSubresourceFromIndex(srcFormatInfo->aspectMask, src->GetSubresource());
|
||||||
VkImageSubresourceLayers srcSubresourceLayers = {
|
VkImageSubresourceLayers srcSubresourceLayers = {
|
||||||
@ -953,8 +953,8 @@ namespace dxvk {
|
|||||||
if (dstImage == nullptr || srcImage == nullptr)
|
if (dstImage == nullptr || srcImage == nullptr)
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
const DxvkFormatInfo* dstFormatInfo = imageFormatInfo(dstImage->info().format);
|
const DxvkFormatInfo* dstFormatInfo = lookupFormatInfo(dstImage->info().format);
|
||||||
const DxvkFormatInfo* srcFormatInfo = imageFormatInfo(srcImage->info().format);
|
const DxvkFormatInfo* srcFormatInfo = lookupFormatInfo(srcImage->info().format);
|
||||||
|
|
||||||
const VkImageSubresource dstSubresource = dstTextureInfo->GetSubresourceFromIndex(dstFormatInfo->aspectMask, dst->GetSubresource());
|
const VkImageSubresource dstSubresource = dstTextureInfo->GetSubresourceFromIndex(dstFormatInfo->aspectMask, dst->GetSubresource());
|
||||||
const VkImageSubresource srcSubresource = srcTextureInfo->GetSubresourceFromIndex(srcFormatInfo->aspectMask, src->GetSubresource());
|
const VkImageSubresource srcSubresource = srcTextureInfo->GetSubresourceFromIndex(srcFormatInfo->aspectMask, src->GetSubresource());
|
||||||
@ -1464,7 +1464,7 @@ namespace dxvk {
|
|||||||
if (Flags & D3DCLEAR_STENCIL)
|
if (Flags & D3DCLEAR_STENCIL)
|
||||||
depthAspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
|
depthAspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||||
|
|
||||||
depthAspectMask &= imageFormatInfo(m_state.depthStencil->GetCommonTexture()->GetFormatMapping().FormatColor)->aspectMask;
|
depthAspectMask &= lookupFormatInfo(m_state.depthStencil->GetCommonTexture()->GetFormatMapping().FormatColor)->aspectMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ClearImageView = [this](
|
auto ClearImageView = [this](
|
||||||
@ -4134,7 +4134,7 @@ namespace dxvk {
|
|||||||
auto& formatMapping = pResource->GetFormatMapping();
|
auto& formatMapping = pResource->GetFormatMapping();
|
||||||
|
|
||||||
const DxvkFormatInfo* formatInfo = formatMapping.IsValid()
|
const DxvkFormatInfo* formatInfo = formatMapping.IsValid()
|
||||||
? imageFormatInfo(formatMapping.FormatColor) : UnsupportedFormatInfo(pResource->Desc()->Format);
|
? lookupFormatInfo(formatMapping.FormatColor) : UnsupportedFormatInfo(pResource->Desc()->Format);
|
||||||
|
|
||||||
auto subresource = pResource->GetSubresourceFromIndex(
|
auto subresource = pResource->GetSubresourceFromIndex(
|
||||||
formatInfo->aspectMask, Subresource);
|
formatInfo->aspectMask, Subresource);
|
||||||
@ -4401,7 +4401,7 @@ namespace dxvk {
|
|||||||
UINT Subresource) {
|
UINT Subresource) {
|
||||||
|
|
||||||
const Rc<DxvkImage> image = pResource->GetImage();
|
const Rc<DxvkImage> image = pResource->GetImage();
|
||||||
auto formatInfo = imageFormatInfo(image->info().format);
|
auto formatInfo = lookupFormatInfo(image->info().format);
|
||||||
auto subresource = pResource->GetSubresourceFromIndex(
|
auto subresource = pResource->GetSubresourceFromIndex(
|
||||||
formatInfo->aspectMask, Subresource);
|
formatInfo->aspectMask, Subresource);
|
||||||
|
|
||||||
@ -4435,7 +4435,7 @@ namespace dxvk {
|
|||||||
// we need to copy its contents into the image
|
// we need to copy its contents into the image
|
||||||
const DxvkBufferSliceHandle srcSlice = pSrcTexture->GetMappedSlice(SrcSubresource);
|
const DxvkBufferSliceHandle srcSlice = pSrcTexture->GetMappedSlice(SrcSubresource);
|
||||||
|
|
||||||
auto formatInfo = imageFormatInfo(image->info().format);
|
auto formatInfo = lookupFormatInfo(image->info().format);
|
||||||
auto srcSubresource = pSrcTexture->GetSubresourceFromIndex(
|
auto srcSubresource = pSrcTexture->GetSubresourceFromIndex(
|
||||||
formatInfo->aspectMask, SrcSubresource);
|
formatInfo->aspectMask, SrcSubresource);
|
||||||
|
|
||||||
@ -4513,7 +4513,7 @@ namespace dxvk {
|
|||||||
TrackTextureMappingBufferSequenceNumber(pSrcTexture, SrcSubresource);
|
TrackTextureMappingBufferSequenceNumber(pSrcTexture, SrcSubresource);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(pDestTexture->GetFormatMapping().FormatColor);
|
const DxvkFormatInfo* formatInfo = lookupFormatInfo(pDestTexture->GetFormatMapping().FormatColor);
|
||||||
|
|
||||||
// Add more blocks for the other planes that we might have.
|
// Add more blocks for the other planes that we might have.
|
||||||
// TODO: PLEASE CLEAN ME
|
// TODO: PLEASE CLEAN ME
|
||||||
@ -6830,8 +6830,8 @@ namespace dxvk {
|
|||||||
const D3D9_VK_FORMAT_MAPPING srcFormatInfo = LookupFormat(srcDesc->Format);
|
const D3D9_VK_FORMAT_MAPPING srcFormatInfo = LookupFormat(srcDesc->Format);
|
||||||
const D3D9_VK_FORMAT_MAPPING dstFormatInfo = LookupFormat(dstDesc->Format);
|
const D3D9_VK_FORMAT_MAPPING dstFormatInfo = LookupFormat(dstDesc->Format);
|
||||||
|
|
||||||
auto srcVulkanFormatInfo = imageFormatInfo(srcFormatInfo.FormatColor);
|
auto srcVulkanFormatInfo = lookupFormatInfo(srcFormatInfo.FormatColor);
|
||||||
auto dstVulkanFormatInfo = imageFormatInfo(dstFormatInfo.FormatColor);
|
auto dstVulkanFormatInfo = lookupFormatInfo(dstFormatInfo.FormatColor);
|
||||||
|
|
||||||
const VkImageSubresource dstSubresource =
|
const VkImageSubresource dstSubresource =
|
||||||
dstTextureInfo->GetSubresourceFromIndex(
|
dstTextureInfo->GetSubresourceFromIndex(
|
||||||
|
@ -82,7 +82,7 @@ namespace dxvk {
|
|||||||
if (image == nullptr)
|
if (image == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto formatInfo = imageFormatInfo(image->info().format);
|
auto formatInfo = lookupFormatInfo(image->info().format);
|
||||||
|
|
||||||
m_transferCommands += 1;
|
m_transferCommands += 1;
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (pInitialData != nullptr) {
|
if (pInitialData != nullptr) {
|
||||||
VkExtent3D mipExtent = pTexture->GetExtentMip(m);
|
VkExtent3D mipExtent = pTexture->GetExtentMip(m);
|
||||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(pTexture->GetFormatMapping().FormatColor);
|
const DxvkFormatInfo* formatInfo = lookupFormatInfo(pTexture->GetFormatMapping().FormatColor);
|
||||||
VkExtent3D blockCount = util::computeBlockCount(mipExtent, formatInfo->blockSize);
|
VkExtent3D blockCount = util::computeBlockCount(mipExtent, formatInfo->blockSize);
|
||||||
uint32_t pitch = blockCount.width * formatInfo->elementSize;
|
uint32_t pitch = blockCount.width * formatInfo->elementSize;
|
||||||
uint32_t alignedPitch = align(pitch, 4);
|
uint32_t alignedPitch = align(pitch, 4);
|
||||||
|
@ -424,8 +424,8 @@ namespace dxvk {
|
|||||||
Rc<DxvkImage> blittedSrc = m_device->createImage(
|
Rc<DxvkImage> blittedSrc = m_device->createImage(
|
||||||
blitCreateInfo, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
|
blitCreateInfo, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
|
||||||
|
|
||||||
const DxvkFormatInfo* dstFormatInfo = imageFormatInfo(blittedSrc->info().format);
|
const DxvkFormatInfo* dstFormatInfo = lookupFormatInfo(blittedSrc->info().format);
|
||||||
const DxvkFormatInfo* srcFormatInfo = imageFormatInfo(srcImage->info().format);
|
const DxvkFormatInfo* srcFormatInfo = lookupFormatInfo(srcImage->info().format);
|
||||||
|
|
||||||
const VkImageSubresource dstSubresource = dstTexInfo->GetSubresourceFromIndex(dstFormatInfo->aspectMask, 0);
|
const VkImageSubresource dstSubresource = dstTexInfo->GetSubresourceFromIndex(dstFormatInfo->aspectMask, 0);
|
||||||
const VkImageSubresource srcSubresource = srcTexInfo->GetSubresourceFromIndex(srcFormatInfo->aspectMask, 0);
|
const VkImageSubresource srcSubresource = srcTexInfo->GetSubresourceFromIndex(srcFormatInfo->aspectMask, 0);
|
||||||
@ -467,7 +467,7 @@ namespace dxvk {
|
|||||||
srcImage = std::move(blittedSrc);
|
srcImage = std::move(blittedSrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
const DxvkFormatInfo* srcFormatInfo = imageFormatInfo(srcImage->info().format);
|
const DxvkFormatInfo* srcFormatInfo = lookupFormatInfo(srcImage->info().format);
|
||||||
const VkImageSubresource srcSubresource = srcTexInfo->GetSubresourceFromIndex(srcFormatInfo->aspectMask, 0);
|
const VkImageSubresource srcSubresource = srcTexInfo->GetSubresourceFromIndex(srcFormatInfo->aspectMask, 0);
|
||||||
VkImageSubresourceLayers srcSubresourceLayers = {
|
VkImageSubresourceLayers srcSubresourceLayers = {
|
||||||
srcSubresource.aspectMask,
|
srcSubresource.aspectMask,
|
||||||
|
@ -574,7 +574,7 @@ namespace dxvk {
|
|||||||
* \returns Element count
|
* \returns Element count
|
||||||
*/
|
*/
|
||||||
VkDeviceSize elementCount() const {
|
VkDeviceSize elementCount() const {
|
||||||
auto format = imageFormatInfo(m_info.format);
|
auto format = lookupFormatInfo(m_info.format);
|
||||||
return m_info.rangeLength / format->elementSize;
|
return m_info.rangeLength / format->elementSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -607,7 +607,7 @@ namespace dxvk {
|
|||||||
* \returns View format info
|
* \returns View format info
|
||||||
*/
|
*/
|
||||||
const DxvkFormatInfo* formatInfo() const {
|
const DxvkFormatInfo* formatInfo() const {
|
||||||
return imageFormatInfo(m_info.format);
|
return lookupFormatInfo(m_info.format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -320,7 +320,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Query pipeline objects to use for this clear operation
|
// Query pipeline objects to use for this clear operation
|
||||||
DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearBufferPipeline(
|
DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearBufferPipeline(
|
||||||
imageFormatInfo(bufferView->info().format)->flags);
|
lookupFormatInfo(bufferView->info().format)->flags);
|
||||||
|
|
||||||
// Create a descriptor set pointing to the view
|
// Create a descriptor set pointing to the view
|
||||||
VkBufferView viewObject = bufferView->handle();
|
VkBufferView viewObject = bufferView->handle();
|
||||||
@ -1098,8 +1098,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Create temporary buffer for depth/stencil data
|
// Create temporary buffer for depth/stencil data
|
||||||
VkDeviceSize pixelCount = dstExtent.width * dstExtent.height * dstSubresource.layerCount;
|
VkDeviceSize pixelCount = dstExtent.width * dstExtent.height * dstSubresource.layerCount;
|
||||||
VkDeviceSize dataSizeD = align(pixelCount * imageFormatInfo(dataFormatD)->elementSize, 256);
|
VkDeviceSize dataSizeD = align(pixelCount * lookupFormatInfo(dataFormatD)->elementSize, 256);
|
||||||
VkDeviceSize dataSizeS = align(pixelCount * imageFormatInfo(dataFormatS)->elementSize, 256);
|
VkDeviceSize dataSizeS = align(pixelCount * lookupFormatInfo(dataFormatS)->elementSize, 256);
|
||||||
|
|
||||||
DxvkBufferCreateInfo tmpBufferInfo;
|
DxvkBufferCreateInfo tmpBufferInfo;
|
||||||
tmpBufferInfo.size = dataSizeD + dataSizeS;
|
tmpBufferInfo.size = dataSizeD + dataSizeS;
|
||||||
@ -2189,7 +2189,7 @@ namespace dxvk {
|
|||||||
VkDeviceSize pitchPerRow,
|
VkDeviceSize pitchPerRow,
|
||||||
VkDeviceSize pitchPerLayer,
|
VkDeviceSize pitchPerLayer,
|
||||||
VkFormat format) {
|
VkFormat format) {
|
||||||
auto formatInfo = imageFormatInfo(format);
|
auto formatInfo = lookupFormatInfo(format);
|
||||||
|
|
||||||
VkExtent3D extent3D;
|
VkExtent3D extent3D;
|
||||||
extent3D.width = imageExtent.width;
|
extent3D.width = imageExtent.width;
|
||||||
@ -3144,7 +3144,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Query pipeline objects to use for this clear operation
|
// Query pipeline objects to use for this clear operation
|
||||||
DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearImagePipeline(
|
DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearImagePipeline(
|
||||||
imageView->type(), imageFormatInfo(imageView->info().format)->flags);
|
imageView->type(), lookupFormatInfo(imageView->info().format)->flags);
|
||||||
|
|
||||||
// Create a descriptor set pointing to the view
|
// Create a descriptor set pointing to the view
|
||||||
VkDescriptorSet descriptorSet = m_descriptorPool->alloc(pipeInfo.dsetLayout);
|
VkDescriptorSet descriptorSet = m_descriptorPool->alloc(pipeInfo.dsetLayout);
|
||||||
|
@ -572,7 +572,7 @@ namespace dxvk {
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
const DxvkFormatInfo* imageFormatInfo(VkFormat format) {
|
const DxvkFormatInfo* lookupFormatInfo(VkFormat format) {
|
||||||
uint32_t indexOffset = 0;
|
uint32_t indexOffset = 0;
|
||||||
|
|
||||||
for (const auto& group : g_formatGroups) {
|
for (const auto& group : g_formatGroups) {
|
||||||
|
@ -55,6 +55,6 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const DxvkFormatInfo* imageFormatInfo(VkFormat format);
|
const DxvkFormatInfo* lookupFormatInfo(VkFormat format);
|
||||||
|
|
||||||
}
|
}
|
@ -191,7 +191,7 @@ namespace dxvk {
|
|||||||
if (rtColorFormats[i]) {
|
if (rtColorFormats[i]) {
|
||||||
rtInfo.colorAttachmentCount = i + 1;
|
rtInfo.colorAttachmentCount = i + 1;
|
||||||
|
|
||||||
auto formatInfo = imageFormatInfo(rtColorFormats[i]);
|
auto formatInfo = lookupFormatInfo(rtColorFormats[i]);
|
||||||
cbAttachments[i] = state.omBlend[i].state();
|
cbAttachments[i] = state.omBlend[i].state();
|
||||||
|
|
||||||
if (!(fsOutputMask & (1 << i)) || !formatInfo) {
|
if (!(fsOutputMask & (1 << i)) || !formatInfo) {
|
||||||
@ -222,7 +222,7 @@ namespace dxvk {
|
|||||||
VkFormat rtDepthFormat = state.rt.getDepthStencilFormat();
|
VkFormat rtDepthFormat = state.rt.getDepthStencilFormat();
|
||||||
|
|
||||||
if (rtDepthFormat) {
|
if (rtDepthFormat) {
|
||||||
auto rtDepthFormatInfo = imageFormatInfo(rtDepthFormat);
|
auto rtDepthFormatInfo = lookupFormatInfo(rtDepthFormat);
|
||||||
|
|
||||||
if (rtDepthFormatInfo->aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT)
|
if (rtDepthFormatInfo->aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT)
|
||||||
rtInfo.depthAttachmentFormat = rtDepthFormat;
|
rtInfo.depthAttachmentFormat = rtDepthFormat;
|
||||||
@ -1145,7 +1145,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Log render target and blend state
|
// Log render target and blend state
|
||||||
auto depthFormat = state.rt.getDepthStencilFormat();
|
auto depthFormat = state.rt.getDepthStencilFormat();
|
||||||
auto depthFormatInfo = imageFormatInfo(depthFormat);
|
auto depthFormatInfo = lookupFormatInfo(depthFormat);
|
||||||
|
|
||||||
VkImageAspectFlags writableAspects = depthFormat
|
VkImageAspectFlags writableAspects = depthFormat
|
||||||
? (depthFormatInfo->aspectMask & ~state.rt.getDepthStencilReadOnlyAspects())
|
? (depthFormatInfo->aspectMask & ~state.rt.getDepthStencilReadOnlyAspects())
|
||||||
|
@ -202,7 +202,7 @@ namespace dxvk {
|
|||||||
* \returns Image format info
|
* \returns Image format info
|
||||||
*/
|
*/
|
||||||
const DxvkFormatInfo* formatInfo() const {
|
const DxvkFormatInfo* formatInfo() const {
|
||||||
return imageFormatInfo(m_info.format);
|
return lookupFormatInfo(m_info.format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -428,7 +428,7 @@ namespace dxvk {
|
|||||||
* \returns View format info
|
* \returns View format info
|
||||||
*/
|
*/
|
||||||
const DxvkFormatInfo* formatInfo() const {
|
const DxvkFormatInfo* formatInfo() const {
|
||||||
return imageFormatInfo(m_info.format);
|
return lookupFormatInfo(m_info.format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -299,7 +299,7 @@ namespace dxvk {
|
|||||||
VkPipeline DxvkMetaCopyObjects::createPipelineObject(
|
VkPipeline DxvkMetaCopyObjects::createPipelineObject(
|
||||||
const DxvkMetaCopyPipelineKey& key,
|
const DxvkMetaCopyPipelineKey& key,
|
||||||
VkPipelineLayout pipelineLayout) {
|
VkPipelineLayout pipelineLayout) {
|
||||||
auto aspect = imageFormatInfo(key.format)->aspectMask;
|
auto aspect = lookupFormatInfo(key.format)->aspectMask;
|
||||||
|
|
||||||
std::array<VkPipelineShaderStageCreateInfo, 3> stages;
|
std::array<VkPipelineShaderStageCreateInfo, 3> stages;
|
||||||
uint32_t stageCount = 0;
|
uint32_t stageCount = 0;
|
||||||
|
@ -23,7 +23,7 @@ namespace dxvk {
|
|||||||
VkFormat format)
|
VkFormat format)
|
||||||
: m_vkd(vkd) {
|
: m_vkd(vkd) {
|
||||||
VkImageViewUsageCreateInfo usageInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO };
|
VkImageViewUsageCreateInfo usageInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO };
|
||||||
usageInfo.usage = (imageFormatInfo(format)->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT)
|
usageInfo.usage = (lookupFormatInfo(format)->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT)
|
||||||
? VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
|
? VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
|
||||||
: VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
: VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ namespace dxvk {
|
|||||||
VkPipeline DxvkMetaResolveObjects::createPipelineObject(
|
VkPipeline DxvkMetaResolveObjects::createPipelineObject(
|
||||||
const DxvkMetaResolvePipelineKey& key,
|
const DxvkMetaResolvePipelineKey& key,
|
||||||
VkPipelineLayout pipelineLayout) {
|
VkPipelineLayout pipelineLayout) {
|
||||||
auto formatInfo = imageFormatInfo(key.format);
|
auto formatInfo = lookupFormatInfo(key.format);
|
||||||
|
|
||||||
std::array<VkPipelineShaderStageCreateInfo, 3> stages;
|
std::array<VkPipelineShaderStageCreateInfo, 3> stages;
|
||||||
uint32_t stageCount = 0;
|
uint32_t stageCount = 0;
|
||||||
|
@ -108,7 +108,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkRtInfo convert() const {
|
DxvkRtInfo convert() const {
|
||||||
VkImageAspectFlags readOnlyAspects = 0;
|
VkImageAspectFlags readOnlyAspects = 0;
|
||||||
auto depthFormatInfo = imageFormatInfo(depth.format);
|
auto depthFormatInfo = lookupFormatInfo(depth.format);
|
||||||
|
|
||||||
if (depth.format && depthFormatInfo) {
|
if (depth.format && depthFormatInfo) {
|
||||||
readOnlyAspects = depthFormatInfo->aspectMask
|
readOnlyAspects = depthFormatInfo->aspectMask
|
||||||
|
@ -144,7 +144,7 @@ namespace dxvk::util {
|
|||||||
|
|
||||||
|
|
||||||
VkDeviceSize computeImageDataSize(VkFormat format, VkExtent3D extent) {
|
VkDeviceSize computeImageDataSize(VkFormat format, VkExtent3D extent) {
|
||||||
const DxvkFormatInfo* formatInfo = imageFormatInfo(format);
|
const DxvkFormatInfo* formatInfo = lookupFormatInfo(format);
|
||||||
|
|
||||||
VkDeviceSize size = 0;
|
VkDeviceSize size = 0;
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ namespace dxvk::util {
|
|||||||
*/
|
*/
|
||||||
inline VkExtent3D computeMipLevelExtent(VkExtent3D size, uint32_t level, VkFormat format, VkImageAspectFlags aspect) {
|
inline VkExtent3D computeMipLevelExtent(VkExtent3D size, uint32_t level, VkFormat format, VkImageAspectFlags aspect) {
|
||||||
if (unlikely(!(aspect & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)))) {
|
if (unlikely(!(aspect & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)))) {
|
||||||
auto plane = &imageFormatInfo(format)->planes[vk::getPlaneIndex(aspect)];
|
auto plane = &lookupFormatInfo(format)->planes[vk::getPlaneIndex(aspect)];
|
||||||
size.width /= plane->blockSize.width;
|
size.width /= plane->blockSize.width;
|
||||||
size.height /= plane->blockSize.height;
|
size.height /= plane->blockSize.height;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ namespace dxvk::hud {
|
|||||||
const Rc<DxvkContext>& ctx,
|
const Rc<DxvkContext>& ctx,
|
||||||
VkSurfaceFormatKHR surfaceFormat,
|
VkSurfaceFormatKHR surfaceFormat,
|
||||||
VkExtent2D surfaceSize) {
|
VkExtent2D surfaceSize) {
|
||||||
bool isSrgb = imageFormatInfo(surfaceFormat.format)->flags.test(DxvkFormatFlag::ColorSpaceSrgb);
|
bool isSrgb = lookupFormatInfo(surfaceFormat.format)->flags.test(DxvkFormatFlag::ColorSpaceSrgb);
|
||||||
|
|
||||||
VkViewport viewport;
|
VkViewport viewport;
|
||||||
viewport.x = 0.0f;
|
viewport.x = 0.0f;
|
||||||
|
@ -378,10 +378,10 @@ namespace dxvk::vk {
|
|||||||
|
|
||||||
// If that didn't work, we'll fall back to a format
|
// If that didn't work, we'll fall back to a format
|
||||||
// which has similar properties to the preferred one
|
// which has similar properties to the preferred one
|
||||||
DxvkFormatFlags prefFlags = imageFormatInfo(pDesired[0].format)->flags;
|
DxvkFormatFlags prefFlags = lookupFormatInfo(pDesired[0].format)->flags;
|
||||||
|
|
||||||
for (uint32_t j = 0; j < numSupported; j++) {
|
for (uint32_t j = 0; j < numSupported; j++) {
|
||||||
auto currFlags = imageFormatInfo(pSupported[j].format)->flags;
|
auto currFlags = lookupFormatInfo(pSupported[j].format)->flags;
|
||||||
|
|
||||||
if ((currFlags & DxvkFormatFlag::ColorSpaceSrgb)
|
if ((currFlags & DxvkFormatFlag::ColorSpaceSrgb)
|
||||||
== (prefFlags & DxvkFormatFlag::ColorSpaceSrgb))
|
== (prefFlags & DxvkFormatFlag::ColorSpaceSrgb))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user