Skip to content

Commit

Permalink
color_space_helper: Split out 10bpc format in unorm and srgb
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Jan 26, 2024
1 parent 5ddd6e9 commit 03b1852
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
16 changes: 11 additions & 5 deletions icd/api/color_space_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ const LookupDefines colorspaceLookup[] =
{ Pal::ScreenColorSpace::CsSrgb, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, FmtSupport::Fmt_KnownSRGB },
{ Pal::ScreenColorSpace::CsBt709, VK_COLOR_SPACE_BT709_NONLINEAR_EXT, FmtSupport::Fmt_All },
{ Pal::ScreenColorSpace::TfHlg, VK_COLOR_SPACE_HDR10_HLG_EXT, FmtSupport::Fmt_KnownHDR },
{ Pal::ScreenColorSpace::TfPq2084, VK_COLOR_SPACE_HDR10_ST2084_EXT, FmtSupport::Fmt_10bpc },
{ Pal::ScreenColorSpace::TfPq2084, VK_COLOR_SPACE_HDR10_ST2084_EXT, FmtSupport::Fmt_10bpc_unorm },
{ Pal::ScreenColorSpace::TfDolbyVision, VK_COLOR_SPACE_DOLBYVISION_EXT, FmtSupport::Fmt_8bpc_unorm },
{ Pal::ScreenColorSpace::CsBt2020, VK_COLOR_SPACE_BT2020_LINEAR_EXT, FmtSupport::Fmt_10bpc },
{ Pal::ScreenColorSpace::CsBt2020, VK_COLOR_SPACE_BT2020_LINEAR_EXT, FmtSupport::Fmt_10bpc_unorm },
{ Pal::ScreenColorSpace::CsAdobe, VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT, FmtSupport::Fmt_All },
{ Pal::ScreenColorSpace::CsDciP3, VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT, FmtSupport::Fmt_All },
{ Pal::ScreenColorSpace::CsScrgb, VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT, FmtSupport::Fmt_16bpc_sfloat },
Expand Down Expand Up @@ -140,10 +140,16 @@ ColorSpaceHelper::FmtSupport ColorSpaceHelper::GetBitFormat(Pal::ChNumFormat pal
fmt = Fmt_9bpc;
break;
case 10:
fmt = Fmt_10bpc;
break;
case 11:
fmt = Fmt_10bpc;
if (Pal::Formats::IsSrgb(palFormat))
{
fmt = Fmt_10bpc_srgb;
}
else
{
VK_ASSERT(Pal::Formats::IsUnorm(palFormat));
fmt = Fmt_10bpc_unorm;
}
break;
case 12:
fmt = Fmt_12bpc;
Expand Down
18 changes: 10 additions & 8 deletions icd/api/include/color_space_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,20 @@ class ColorSpaceHelper
Fmt_8bpc_srgb = 0x0008,
Fmt_8bpc_unorm = 0x0010,
Fmt_9bpc = 0x0020,
Fmt_10bpc = 0x0040,
Fmt_11bpc = 0x0080,
Fmt_12bpc = 0x0100,
Fmt_16bpc_unorm = 0x0200,
Fmt_16bpc_sfloat = 0x0400,
Fmt_32bpc = 0x0800,
Fmt_10bpc_srgb = 0x0040,
Fmt_10bpc_unorm = 0x0080,
Fmt_11bpc = 0x0100,
Fmt_12bpc = 0x0200,
Fmt_16bpc_unorm = 0x0400,
Fmt_16bpc_sfloat = 0x0800,
Fmt_32bpc = 0x1000,

Fmt_8bpc = Fmt_8bpc_srgb | Fmt_8bpc_unorm,
Fmt_10bpc = Fmt_10bpc_srgb | Fmt_10bpc_unorm,
Fmt_16bpc = Fmt_16bpc_unorm | Fmt_16bpc_sfloat,
Fmt_KnownHDR = Fmt_10bpc | Fmt_11bpc | Fmt_12bpc | Fmt_16bpc,
Fmt_KnownHDR = Fmt_10bpc_unorm | Fmt_11bpc | Fmt_12bpc | Fmt_16bpc,
Fmt_KnownSRGB = Fmt_8bpc | Fmt_10bpc,
Fmt_All = Fmt_4bpc | Fmt_5bpc | Fmt_6bpc | Fmt_8bpc | Fmt_KnownHDR | Fmt_32bpc,
Fmt_All = Fmt_4bpc | Fmt_5bpc | Fmt_6bpc | Fmt_8bpc | Fmt_10bpc_srgb | Fmt_KnownHDR | Fmt_32bpc,

Fmt_FreeSync2 = Fmt_10bpc | Fmt_16bpc,
};
Expand Down

0 comments on commit 03b1852

Please sign in to comment.