KhronosGroup / KTX-Software

KTX (Khronos Texture) Library and Tools
Other
854 stars 226 forks source link

Neither `create` nor `encode` write the codec choice in KTXwriterScParams #829

Closed MarkCallow closed 5 months ago

MarkCallow commented 7 months ago

My concept is that KTXwriterScParams contains the options needed to recreate the file so I expected to see, e.g.,

KTXwriterScParams: --encode basis-lz --clevel 0 --threads 1

in a file created with ktx create or

KTXwriterScParams: --codec basis-lz --clevel 0 --threads 1

in a file created with encode.

Please add the --encode or --codec options to the captured list.

MarkCallow commented 7 months ago

I've also just noticed that ktx transcode does not write KTXwriterScParams when its --zlib or --zstd options are used. Let's handle it under this issue rather than creating a new one.

aqnuep commented 7 months ago

My concept is that KTXwriterScParams contains the options needed to recreate the file so I expected to see, e.g.

In my interpretation KTXwriterScParams should only contain the parameters of the supercompression but not necessarily the used codec, which would have a few problems:

  1. It would be redundant with other information, as the use of BasisLZ and/or UASTC is available in the file anyway
  2. Because the create and encode command use different argument names to select the codec, writing the --encode / --codec parameters to KTXwriterScParams could cause confusion
MarkCallow commented 7 months ago

Agree with the first bullet. You do though have to look at other fields to find that information. The second is indeed true but KTXwriter tells you the command used. If —codec or —encode is included you can paste the content of KTXwriter followed by the content of KTXwriteScParams to recreate the command. Without code/encode included you have to look at other fields to see what kind of codec and at the help for the tool to find the option name. None of these things is a huge deal though.

MarkCallow commented 5 months ago

Decided to continue to omit the --codec/--encode parameter. The ktx transcode issue has been addressed in a PR.