You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/ktx/command_create.cpp
+29-15Lines changed: 29 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -778,6 +778,9 @@ struct OptionsCreate {
778
778
}
779
779
}
780
780
781
+
if (isFormatSRGB(vkFormat) && normalize)
782
+
report.fatal_usage("Option --{} cannot be used with sRGB formats.", kNormalize);
783
+
781
784
if (isFormatNotSRGBButHasSRGBVariant(vkFormat)) {
782
785
constauto error_message = "Invalid value \"{}\" to --{} for format \"{}\". Transfer function must not be sRGB for a non-sRGB VkFormat with sRGB variant.";
783
786
if (!convertTF.has_value() && assignTF.has_value() && assignTF == KHR_DF_TRANSFER_SRGB) {
if (target.format().transfer() != KHR_DF_TRANSFER_UNSPECIFIED && target.format().transfer() != KHR_DF_TRANSFER_LINEAR) {
1769
-
constauto input_error_message = "Input file \"{}\" The transfer function to be applied to the created texture is neither linear nor none. Normalize is only available for these transfer functions.";
1770
-
constauto assign_error_message = "Input file \"{}\" Use \"{}\" to assign the linear transfer function to the input image, if required.";
1771
-
constauto convert_error_message = "Input file \"{}\" Modify \"{}\" settings to convert the input image to linear transfer function, if required.";
// - a fatal usage error will already have been thrown so nothing to do.
1776
+
// If --format is non-SRGB format
1777
+
// - absent TF options, an implicit conversion to LINEAR takes place if the file
1778
+
// TF is not LINEAR or UNSPECIFIED. If it can't be converted a fatal
1779
+
// unsupported conversion error will already have been thrown. Therefore
1780
+
// nothing to do. But if `create` is changed to set the TF for non-SRGB
1781
+
// formats from the file's TF then this error handling will need updating.
1782
+
// - --assign-tf has many other possible values so that is a possible source.
1783
+
// - --convert-tf can only be linear or srgb. If it's srgb and the format does
1784
+
// not have an equivalent SRGB format, that is another possible source.
1785
+
1786
+
//const auto input_error_message = "Input file \"{}\" The transfer function to be applied to the created texture is neither linear nor none. Normalize is only available for these transfer functions.";
1787
+
//const auto inputTransfer = inputImageFile->spec().format().transfer();
0 commit comments