Add video texture format YUY2
This commit is contained in:
@@ -273,18 +273,6 @@ ID3D11BlendState* GPUDeviceDX11::GetBlendState(const BlendingMode& blending)
|
||||
return blendState;
|
||||
}
|
||||
|
||||
static MSAALevel GetMaximumMultisampleCount(ID3D11Device* device, DXGI_FORMAT dxgiFormat)
|
||||
{
|
||||
int32 maxCount = 1;
|
||||
UINT numQualityLevels;
|
||||
for (int32 i = 2; i <= 8; i *= 2)
|
||||
{
|
||||
if (SUCCEEDED(device->CheckMultisampleQualityLevels(dxgiFormat, i, &numQualityLevels)) && numQualityLevels > 0)
|
||||
maxCount = i;
|
||||
}
|
||||
return static_cast<MSAALevel>(maxCount);
|
||||
}
|
||||
|
||||
bool GPUDeviceDX11::Init()
|
||||
{
|
||||
HRESULT result;
|
||||
@@ -392,10 +380,16 @@ bool GPUDeviceDX11::Init()
|
||||
{
|
||||
auto format = static_cast<PixelFormat>(i);
|
||||
auto dxgiFormat = RenderToolsDX::ToDxgiFormat(format);
|
||||
auto maximumMultisampleCount = GetMaximumMultisampleCount(_device, dxgiFormat);
|
||||
int32 maxCount = 1;
|
||||
UINT numQualityLevels;
|
||||
for (int32 c = 2; c <= 8; c *= 2)
|
||||
{
|
||||
if (SUCCEEDED(_device->CheckMultisampleQualityLevels(dxgiFormat, c, &numQualityLevels)) && numQualityLevels > 0)
|
||||
maxCount = c;
|
||||
}
|
||||
UINT formatSupport = 0;
|
||||
_device->CheckFormatSupport(dxgiFormat, &formatSupport);
|
||||
FeaturesPerFormat[i] = FormatFeatures(format, maximumMultisampleCount, (FormatSupport)formatSupport);
|
||||
FeaturesPerFormat[i] = FormatFeatures(format, static_cast<MSAALevel>(maxCount), (FormatSupport)formatSupport);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -398,14 +398,10 @@ bool GPUDeviceDX12::Init()
|
||||
{
|
||||
const PixelFormat format = static_cast<PixelFormat>(i);
|
||||
const DXGI_FORMAT dxgiFormat = RenderToolsDX::ToDxgiFormat(format);
|
||||
|
||||
D3D12_FEATURE_DATA_FORMAT_SUPPORT formatInfo = { dxgiFormat };
|
||||
if (FAILED(_device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &formatInfo, sizeof(formatInfo))))
|
||||
{
|
||||
formatInfo.Support1 = D3D12_FORMAT_SUPPORT1_NONE;
|
||||
}
|
||||
const MSAALevel maximumMultisampleCount = GetMaximumMultisampleCount(_device, dxgiFormat);
|
||||
|
||||
FeaturesPerFormat[i] = FormatFeatures(format, maximumMultisampleCount, (FormatSupport)formatInfo.Support1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// @formatter:off
|
||||
|
||||
DXGI_FORMAT PixelFormatToDXGIFormat[108] =
|
||||
DXGI_FORMAT PixelFormatToDXGIFormat[109] =
|
||||
{
|
||||
DXGI_FORMAT_UNKNOWN,
|
||||
DXGI_FORMAT_R32G32B32A32_TYPELESS,
|
||||
@@ -119,6 +119,7 @@ DXGI_FORMAT PixelFormatToDXGIFormat[108] =
|
||||
DXGI_FORMAT_UNKNOWN, // ASTC_8x8_UNorm_sRGB
|
||||
DXGI_FORMAT_UNKNOWN, // ASTC_10x10_UNorm
|
||||
DXGI_FORMAT_UNKNOWN, // ASTC_10x10_UNorm_sRGB
|
||||
DXGI_FORMAT_YUY2,
|
||||
};
|
||||
|
||||
// @formatter:on
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
// @formatter:off
|
||||
|
||||
VkFormat RenderToolsVulkan::PixelFormatToVkFormat[108] =
|
||||
VkFormat RenderToolsVulkan::PixelFormatToVkFormat[109] =
|
||||
{
|
||||
VK_FORMAT_UNDEFINED,
|
||||
VK_FORMAT_R32G32B32A32_SFLOAT,
|
||||
@@ -118,6 +118,7 @@ VkFormat RenderToolsVulkan::PixelFormatToVkFormat[108] =
|
||||
VK_FORMAT_ASTC_8x8_SRGB_BLOCK,
|
||||
VK_FORMAT_ASTC_10x10_UNORM_BLOCK,
|
||||
VK_FORMAT_ASTC_10x10_SRGB_BLOCK,
|
||||
VK_FORMAT_G8B8G8R8_422_UNORM, // YUY2
|
||||
};
|
||||
|
||||
VkBlendFactor RenderToolsVulkan::BlendToVkBlendFactor[20] =
|
||||
|
||||
Reference in New Issue
Block a user