KTX-Software icon indicating copy to clipboard operation
KTX-Software copied to clipboard

`ktx create` should warn about images that exceed common GPU maximum texture dimensions

Open MarkCallow opened this issue 3 years ago • 6 comments

This stems from issue #373. Two things needs to be done:

  1. Remove the artificial size limits in the JPEG decoder.
  2. Due to GPU texture size limits, ktx should exit with an error if no --resize or --scale option is specified and the size is greater than 16,384 and it should issue a warning if the size is > 16,384 after a --resize or --scale. It should not automatically resize. Some users may want to resize to a different size having not been aware until warned that the image was so large.

Question: should toktx allow texture sizes > 32768. I doubt any GPU supports texture sizes larger than that.

MarkCallow avatar Mar 24 '21 11:03 MarkCallow

NVIDIA GeForce 10xx and newer supports 32,768 1D and 32,768x32,768 2D textures, so why is the proposed limit 16,384?

lexaknyazev avatar Mar 24 '21 11:03 lexaknyazev

Available VRAM gets bigger with each new GPU generation, so max texture dimensions would follow. toktx should issue a warning on dimensions above 16,384 as it's likely the most popular limitation atm.

lexaknyazev avatar Mar 24 '21 12:03 lexaknyazev

why is the proposed limit 16,834?

Because that is the limit on the majority of GPUs atm. The error is intended to be a hard warning that hey you need to look at this. If you've explicitly indicated the size you want then it turns into a warning. It needs an additional way to override other than resize or scale for use in the case of keeping the size as is.

MarkCallow avatar Mar 24 '21 12:03 MarkCallow

@lexaknyazev does ktx create have size limits or size warnings? Its reference page does not indicate anything.

MarkCallow avatar Nov 29 '23 03:11 MarkCallow

The original spec for ktx create does not have the warning. Seems reasonable to add it.

lexaknyazev avatar Nov 29 '23 07:11 lexaknyazev

Thanks @lexaknyazev.

MarkCallow avatar Nov 29 '23 07:11 MarkCallow