mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d11] Use linar tiling for textures if optimal tiling is not supported
Fixes texture creation issues in various Batman games.
This commit is contained in:
parent
9aa73d1148
commit
d5041337f5
@ -65,19 +65,10 @@ namespace dxvk {
|
|||||||
if (Dimension == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
|
if (Dimension == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
|
||||||
imageInfo.flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR;
|
imageInfo.flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR;
|
||||||
|
|
||||||
// Test whether the combination of image parameters is supported
|
// Some image formats (i.e. the R32G32B32 ones) are
|
||||||
if (!CheckImageSupport(&imageInfo, VK_IMAGE_TILING_OPTIMAL)) {
|
// only supported with linear tiling on most GPUs
|
||||||
throw DxvkError(str::format(
|
if (!CheckImageSupport(&imageInfo, VK_IMAGE_TILING_OPTIMAL))
|
||||||
"D3D11: Cannot create texture:",
|
imageInfo.tiling = VK_IMAGE_TILING_LINEAR;
|
||||||
"\n Format: ", imageInfo.format,
|
|
||||||
"\n Extent: ", imageInfo.extent.width,
|
|
||||||
"x", imageInfo.extent.height,
|
|
||||||
"x", imageInfo.extent.depth,
|
|
||||||
"\n Samples: ", imageInfo.sampleCount,
|
|
||||||
"\n Layers: ", imageInfo.numLayers,
|
|
||||||
"\n Levels: ", imageInfo.mipLevels,
|
|
||||||
"\n Usage: ", std::hex, imageInfo.usage));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine map mode based on our findings
|
// Determine map mode based on our findings
|
||||||
m_mapMode = DetermineMapMode(&imageInfo);
|
m_mapMode = DetermineMapMode(&imageInfo);
|
||||||
@ -102,6 +93,20 @@ namespace dxvk {
|
|||||||
if (imageInfo.tiling == VK_IMAGE_TILING_OPTIMAL)
|
if (imageInfo.tiling == VK_IMAGE_TILING_OPTIMAL)
|
||||||
imageInfo.layout = OptimizeLayout(imageInfo.usage);
|
imageInfo.layout = OptimizeLayout(imageInfo.usage);
|
||||||
|
|
||||||
|
// Check if we can actually create the image
|
||||||
|
if (!CheckImageSupport(&imageInfo, imageInfo.tiling)) {
|
||||||
|
throw DxvkError(str::format(
|
||||||
|
"D3D11: Cannot create texture:",
|
||||||
|
"\n Format: ", imageInfo.format,
|
||||||
|
"\n Extent: ", imageInfo.extent.width,
|
||||||
|
"x", imageInfo.extent.height,
|
||||||
|
"x", imageInfo.extent.depth,
|
||||||
|
"\n Samples: ", imageInfo.sampleCount,
|
||||||
|
"\n Layers: ", imageInfo.numLayers,
|
||||||
|
"\n Levels: ", imageInfo.mipLevels,
|
||||||
|
"\n Usage: ", std::hex, imageInfo.usage));
|
||||||
|
}
|
||||||
|
|
||||||
// If necessary, create the mapped linear buffer
|
// If necessary, create the mapped linear buffer
|
||||||
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER)
|
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER)
|
||||||
m_buffer = CreateMappedBuffer();
|
m_buffer = CreateMappedBuffer();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user