GPUOpen-Tools / compressonator

Tool suite for Texture and 3D Model Compression, Optimization and Analysis using CPUs, GPUs and APUs
1.29k stars 193 forks source link

Add BC7_SRGB format support #287

Closed w23 closed 6 months ago

w23 commented 8 months ago

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

w23 commented 8 months ago

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

NPCompress commented 7 months ago

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

NavNTCMP commented 6 months ago

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

w23 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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: https://github.com/GPUOpen-Tools/compressonator/compare/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 commented 6 months ago

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.