Skip to content

Commit

Permalink
A few minor updates to ETC format detection
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Oct 23, 2024
1 parent d9b0335 commit 6457688
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ class EngineFactoryD3DBase : public EngineFactoryBase<BaseInterface>
Features.DualSourceBlend = DEVICE_FEATURE_STATE_ENABLED;
Features.MultiViewport = DEVICE_FEATURE_STATE_ENABLED;
Features.TextureCompressionBC = DEVICE_FEATURE_STATE_ENABLED;
Features.TextureCompressionETC2 = DEVICE_FEATURE_STATE_DISABLED;
Features.PixelUAVWritesAndAtomics = DEVICE_FEATURE_STATE_ENABLED;
Features.TextureUAVExtendedFormats = DEVICE_FEATURE_STATE_ENABLED;
Features.ShaderResourceStaticArrays = DEVICE_FEATURE_STATE_ENABLED;
Expand Down
3 changes: 2 additions & 1 deletion Graphics/GraphicsEngineD3DBase/src/DXGITypeConversions.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 Diligent Graphics LLC
* Copyright 2019-2024 Diligent Graphics LLC
* Copyright 2015-2019 Egor Yusov
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -414,6 +414,7 @@ DXGI_FORMAT TexFormatToDXGI_Format(TEXTURE_FORMAT TexFormat, Uint32 BindFlags)
if (TexFormat >= TEX_FORMAT_UNKNOWN && TexFormat < TEX_FORMAT_NUM_FORMATS)
{
auto DXGIFormat = FmtToDXGIFmtMap[TexFormat];
VERIFY(TexFormat == TEX_FORMAT_UNKNOWN || TexFormat > TEX_FORMAT_BC7_UNORM_SRGB || DXGIFormat != DXGI_FORMAT_UNKNOWN, "Unsupported texture format");
if (BindFlags != 0)
DXGIFormat = CorrectDXGIFormat(DXGIFormat, BindFlags);
return DXGIFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,9 @@ void RenderDeviceWebGPUImpl::FindSupportedTextureFormats()
const bool RG11B10UfloatRenderableSupported = wgpuDeviceHasFeature(m_wgpuDevice, WGPUFeatureName_RG11B10UfloatRenderable);
const bool Depth32FloatStencil8Supported = wgpuDeviceHasFeature(m_wgpuDevice, WGPUFeatureName_Depth32FloatStencil8);
const bool TextureCompressionBCSupported = wgpuDeviceHasFeature(m_wgpuDevice, WGPUFeatureName_TextureCompressionBC);
const bool TextureCompressionETC2Supported = wgpuDeviceHasFeature(m_wgpuDevice, WGPUFeatureName_TextureCompressionETC2);
const bool R16UnormSupported = wgpuDeviceHasFeature(m_wgpuDevice, WGPUFeatureName_Unorm16TextureFormats);
const bool R16SnormSupported = wgpuDeviceHasFeature(m_wgpuDevice, WGPUFeatureName_Snorm16TextureFormats);
const bool TextureCompressionETC2Supported = wgpuDeviceHasFeature(m_wgpuDevice, WGPUFeatureName_TextureCompressionETC2);

// https://www.w3.org/TR/webgpu/#texture-format-caps

Expand Down

0 comments on commit 6457688

Please sign in to comment.