Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BC7_SRGB format support #287

Merged
merged 2 commits into from
Mar 12, 2024
Merged

Add BC7_SRGB format support #287

merged 2 commits into from
Mar 12, 2024

Conversation

w23
Copy link
Contributor

@w23 w23 commented Dec 21, 2023

Tracked alongside regular BC7 for the most part, with simple conversion from/to external BC7 UNORM/SRGB format enums. No actual sRGB/gamma↔linear colorspace conversion is introduced.

Fixes #277

Tracked alongside regular BC7 for the most part, with simple conversion
from/to external BC7 UNORM/SRGB format enums. No actual SRGB↔linear
colorspace conversion is introduced.

Fixes GPUOpen-Tools#277
@@ -107,6 +107,7 @@ extern "C" {

#define CMP_FOURCC_BC6H CMP_MAKEFOURCC('B', 'C', '6', 'H')
#define CMP_FOURCC_BC7 CMP_MAKEFOURCC('B', 'C', '7', 'x')
#define CMP_FOURCC_BC7_SRGB CMP_MAKEFOURCC('B', 'C', '7', 's')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a reasonable FourCC? Does it have to be congruent to a well-known value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@w23 This seems reasonable, I am not aware of any other open source options that use it.

@w23
Copy link
Contributor Author

w23 commented Dec 21, 2023

#114 mentions that there's supposedly an SRGB flag, but I haven't found one.

@NPCompress
Copy link
Contributor

NPCompress commented Feb 5, 2024

@w23 Please review your latest pull request against v4.5 there are some conflicting files that need resolving. Thx

@NavNTCMP
Copy link
Contributor

@w23 Just a reminder to review your latest pull request against v4.5.52 source code. Thx for your support.

@w23
Copy link
Contributor Author

w23 commented Feb 23, 2024

Master branch has been blindly and mechanically merged.

Note that I haven't tested it yet at all. It's been quite a while since the last time I needed it and had a proper build+test setup. Probably will have to fixup my KTX2-support-for-Linux patchset first.

Also note that this PR doesn't add any BC7_SRGB support neither to GUI, nor to CLI args. It just adds format tracking, which seems to be enough when re-packing images from one container to another.

There are also no tests added -- I haven't yet figured out how to build and run them.

@kaphula
Copy link

kaphula commented Mar 5, 2024

Sorry if this is the wrong place to ask but what is the current status for supporting conversions from png to ktx2 with BC1, BC3, BC5 and BC7 compression formats on Linux? It is seems that currently compressonator does not allow me to convert to any kind of ktx2 files on Linux, but on Windows conversions to ktx2 are possible?

@w23
Copy link
Contributor Author

w23 commented Mar 5, 2024

Sorry if this is the wrong place to ask but what is the current status for supporting conversions from png to ktx2 with BC1, BC3, BC5 and BC7 compression formats on Linux?

Last time I looked at it (in December), KTX2 support was force-disabled for Linux at compile time.
Good news: it is mostly a repository-structure + build-system issue. Basic changes needed to enable KTX2 support on Linux are fairly small: master...w23:compressonator:linux-ktx2
Bad news: it is mostly a repository-structure + build-system issue. Massaging the changes linked above so they conform to (completely opaque) AMD internal CI build pipelines so that a realistically-mergeable PR can be prepared might require much more coordination than I have resources for.

It is seems that currently compressonator does not allow me to convert to any kind of ktx2 files on Linux, but on Windows conversions to ktx2 are possible?

I heard KTX2 just works™ on Windows.

@kaphula
Copy link

kaphula commented Mar 5, 2024

Thanks for the summary. I guess I will try running Compressonator on Linux through Wine and hope for official future ktx2 support on Linux.

Edit:

I heard KTX2 just works™ on Windows.

It sure does, even through Wine.

@NavNTCMP NavNTCMP merged commit 4478a3d into GPUOpen-Tools:master Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BC7 UNORM SRGB support (KTX2)
4 participants