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

TextureCompression: Error+Crash when transcoding KTX_TFF_PVRCT1_4_RGBA #1251

Open
jeroenbakker-atmind opened this issue Dec 18, 2024 · 2 comments · May be fixed by #1264
Open

TextureCompression: Error+Crash when transcoding KTX_TFF_PVRCT1_4_RGBA #1251

jeroenbakker-atmind opened this issue Dec 18, 2024 · 2 comments · May be fixed by #1264
Assignees

Comments

@jeroenbakker-atmind
Copy link
Collaborator

jeroenbakker-atmind commented Dec 18, 2024

When running texture_compression_basisu transcoding to KTX_TFF_PVRCT1_4_RGBA will print an error that the input images cannot be transcoded to this format. This results in not allocated resources. validation errors and eventually crashes.

Code trows an error when KTX doesn't succeed. Would be better not allowing images that will fail to not select this format. (Print error or remove failing options). Most likely the input images are not a power of 2 that is a requirement for PVRCT1. As none of the input images are a power of 2, we might just want to remove PVRCT1

Detected on: Apple M2+SDK 1.3.296

[error] Error Message: Could not transcode the input texture to the selected target format.
[error] Failed when running application Basis Universal texture compression
VUID-vkDestroyImageView-imageView-parameter(ERROR / SPEC): msgNum: -534740842 - Validation Error: [ VUID-vkDestroyImageView-imageView-parameter ] Object 0: handle = 0x152020a00, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xe0208096 | vkDestroyImageView(): imageView Invalid VkImageView Object 0x9f9b41000000003c.
The Vulkan spec states: If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView handle (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-vkDestroyImageView-imageView-parameter)
    Objects: 1
        [0] 0x152020a00, type: 1, name: NULL
[error] -534740842 - VUID-vkDestroyImageView-imageView-parameter: Validation Error: [ VUID-vkDestroyImageView-imageView-parameter ] Object 0: handle = 0x152020a00, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xe0208096 | vkDestroyImageView(): imageView Invalid VkImageView Object 0x9f9b41000000003c.
The Vulkan spec states: If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView handle (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-vkDestroyImageView-imageView-parameter)
UNASSIGNED-Threading-Info(ERROR / SPEC): msgNum: 1567320034 - Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x9f9b41000000003c, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x5d6b67e2 | vkDestroyImageView():  Couldn't find VkImageView Object 0x9f9b41000000003c. This should not happen and may indicate a bug in the application.
    Objects: 1
        [0] 0x9f9b41000000003c, type: 14, name: NULL
[error] 1567320034 - UNASSIGNED-Threading-Info: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x9f9b41000000003c, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x5d6b67e2 | vkDestroyImageView():  Couldn't find VkImageView Object 0x9f9b41000000003c. This should not happen and may indicate a bug in the application.
UNASSIGNED-Threading-Info(ERROR / SPEC): msgNum: 1567320034 - Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x9f9b41000000003c, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x5d6b67e2 | vkDestroyImageView():  Couldn't find VkImageView Object 0x9f9b41000000003c. This should not happen and may indicate a bug in the application.
    Objects: 1
        [0] 0x9f9b41000000003c, type: 14, name: NULL
[error] 1567320034 - UNASSIGNED-Threading-Info: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x9f9b41000000003c, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x5d6b67e2 | vkDestroyImageView():  Couldn't find VkImageView Object 0x9f9b41000000003c. This should not happen and may indicate a bug in the application.
VUID-vkDestroyImage-image-parameter(ERROR / SPEC): msgNum: 415590263 - Validation Error: [ VUID-vkDestroyImage-image-parameter ] Object 0: handle = 0x152020a00, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x18c56777 | vkDestroyImage(): image Invalid VkImage Object 0x59f7450000000038.
The Vulkan spec states: If image is not VK_NULL_HANDLE, image must be a valid VkImage handle (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-vkDestroyImage-image-parameter)
    Objects: 1
        [0] 0x152020a00, type: 1, name: NULL
[error] 415590263 - VUID-vkDestroyImage-image-parameter: Validation Error: [ VUID-vkDestroyImage-image-parameter ] Object 0: handle = 0x152020a00, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x18c56777 | vkDestroyImage(): image Invalid VkImage Object 0x59f7450000000038.
The Vulkan spec states: If image is not VK_NULL_HANDLE, image must be a valid VkImage handle (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-vkDestroyImage-image-parameter)
UNASSIGNED-Threading-Info(ERROR / SPEC): msgNum: 1567320034 - Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x59f7450000000038, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x5d6b67e2 | vkDestroyImage():  Couldn't find VkImage Object 0x59f7450000000038. This should not happen and may indicate a bug in the application.
    Objects: 1
        [0] 0x59f7450000000038, type: 10, name: NULL
[error] 1567320034 - UNASSIGNED-Threading-Info: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x59f7450000000038, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x5d6b67e2 | vkDestroyImage():  Couldn't find VkImage Object 0x59f7450000000038. This should not happen and may indicate a bug in the application.
UNASSIGNED-Threading-Info(ERROR / SPEC): msgNum: 1567320034 - Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x59f7450000000038, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x5d6b67e2 | vkDestroyImage():  Couldn't find VkImage Object 0x59f7450000000038. This should not happen and may indicate a bug in the application.
    Objects: 1
        [0] 0x59f7450000000038, type: 10, name: NULL
[error] 1567320034 - UNASSIGNED-Threading-Info: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x59f7450000000038, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x5d6b67e2 | vkDestroyImage():  Couldn't find VkImage Object 0x59f7450000000038. This should not happen and may indicate a bug in the application.
VUID-vkDestroySampler-sampler-parameter(ERROR / SPEC): msgNum: -576740016 - Validation Error: [ VUID-vkDestroySampler-sampler-parameter ] Object 0: handle = 0x152020a00, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xdd9fa550 | vkDestroySampler(): sampler Invalid VkSampler Object 0x5eb05e000000003b.
The Vulkan spec states: If sampler is not VK_NULL_HANDLE, sampler must be a valid VkSampler handle (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-vkDestroySampler-sampler-parameter)
    Objects: 1
        [0] 0x152020a00, type: 1, name: NULL
[error] -576740016 - VUID-vkDestroySampler-sampler-parameter: Validation Error: [ VUID-vkDestroySampler-sampler-parameter ] Object 0: handle = 0x152020a00, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xdd9fa550 | vkDestroySampler(): sampler Invalid VkSampler Object 0x5eb05e000000003b.
The Vulkan spec states: If sampler is not VK_NULL_HANDLE, sampler must be a valid VkSampler handle (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-vkDestroySampler-sampler-parameter)
UNASSIGNED-Threading-Info(ERROR / SPEC): msgNum: 1567320034 - Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x5eb05e000000003b, type = VK_OBJECT_TYPE_SAMPLER; | MessageID = 0x5d6b67e2 | vkDestroySampler():  Couldn't find VkSampler Object 0x5eb05e000000003b. This should not happen and may indicate a bug in the application.
    Objects: 1
        [0] 0x5eb05e000000003b, type: 21, name: NULL
[error] 1567320034 - UNASSIGNED-Threading-Info: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x5eb05e000000003b, type = VK_OBJECT_TYPE_SAMPLER; | MessageID = 0x5d6b67e2 | vkDestroySampler():  Couldn't find VkSampler Object 0x5eb05e000000003b. This should not happen and may indicate a bug in the application.
UNASSIGNED-Threading-Info(ERROR / SPEC): msgNum: 1567320034 - Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x5eb05e000000003b, type = VK_OBJECT_TYPE_SAMPLER; | MessageID = 0x5d6b67e2 | vkDestroySampler():  Couldn't find VkSampler Object 0x5eb05e000000003b. This should not happen and may indicate a bug in the application.
    Objects: 1
        [0] 0x5eb05e000000003b, type: 21, name: NULL
[error] 1567320034 - UNASSIGNED-Threading-Info: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x5eb05e000000003b, type = VK_OBJECT_TYPE_SAMPLER; | MessageID = 0x5d6b67e2 | vkDestroySampler():  Couldn't find VkSampler Object 0x5eb05e000000003b. This should not happen and may indicate a bug in the application.
VUID-vkFreeMemory-memory-parameter(ERROR / SPEC): msgNum: 1271686503 - Validation Error: [ VUID-vkFreeMemory-memory-parameter ] Object 0: handle = 0x152020a00, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x4bcc6567 | vkFreeMemory(): memory Invalid VkDeviceMemory Object 0x944a2c0000000039.
The Vulkan spec states: If memory is not VK_NULL_HANDLE, memory must be a valid VkDeviceMemory handle (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-vkFreeMemory-memory-parameter)
    Objects: 1
        [0] 0x152020a00, type: 1, name: NULL
[error] 1271686503 - VUID-vkFreeMemory-memory-parameter: Validation Error: [ VUID-vkFreeMemory-memory-parameter ] Object 0: handle = 0x152020a00, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x4bcc6567 | vkFreeMemory(): memory Invalid VkDeviceMemory Object 0x944a2c0000000039.
The Vulkan spec states: If memory is not VK_NULL_HANDLE, memory must be a valid VkDeviceMemory handle (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-vkFreeMemory-memory-parameter)
UNASSIGNED-Threading-Info(ERROR / SPEC): msgNum: 1567320034 - Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x944a2c0000000039, type = VK_OBJECT_TYPE_DEVICE_MEMORY; | MessageID = 0x5d6b67e2 | vkFreeMemory():  Couldn't find VkDeviceMemory Object 0x944a2c0000000039. This should not happen and may indicate a bug in the application.
    Objects: 1
        [0] 0x944a2c0000000039, type: 8, name: NULL
@jeroenbakker-atmind jeroenbakker-atmind self-assigned this Jan 13, 2025
@jeroenbakker-atmind
Copy link
Collaborator Author

Discussed during the meeting, and the solution is to resize the input files to a better resolution (512x512)

jeroenbakker-atmind added a commit to jeroenbakker-atmind/Vulkan-Samples-Assets that referenced this issue Jan 22, 2025
@jeroenbakker-atmind
Copy link
Collaborator Author

jeroenbakker-atmind commented Jan 22, 2025

The files are located in assets/textures/basisu

  • kodim03_ETC1S.ktx2
  • kodim03_UASTC.ktx2
  • kodim05_ETC1S.ktx2
  • kodim05_UASTC.ktx2
  • kodim20_ETC1S.ktx2
  • kodim20_UASTC.ktx2
  • kodim23_ETC1S.ktx2
  • kodim23_UASTC.ktx2

The original files are located at third_party/ktx/external/basisu/test_files

Commands done to generate the textures.

toktx --t2 --bcmp --resize 1024x1024 assets/textures/basisu/kodim03_ETC1S.ktx2 third_party/ktx/external/basisu/test_files/kodim03.png 
toktx --t2 --uastc --resize 1024x1024 assets/textures/basisu/kodim03_UASTC.ktx2 third_party/ktx/external/basisu/test_files/kodim03.png 
toktx --t2 --bcmp --resize 1024x1024 assets/textures/basisu/kodim05_ETC1S.ktx2 third_party/ktx/external/basisu/test_files/kodim05.png 
toktx --t2 --uastc --resize 1024x1024 assets/textures/basisu/kodim05_UASTC.ktx2 third_party/ktx/external/basisu/test_files/kodim05.png 
toktx --t2 --bcmp --resize 1024x1024 assets/textures/basisu/kodim20_ETC1S.ktx2 third_party/ktx/external/basisu/test_files/kodim20.png 
toktx --t2 --uastc --resize 1024x1024 assets/textures/basisu/kodim20_UASTC.ktx2 third_party/ktx/external/basisu/test_files/kodim20.png 
toktx --t2 --bcmp --resize 1024x1024 assets/textures/basisu/kodim23_ETC1S.ktx2 third_party/ktx/external/basisu/test_files/kodim23.png 
toktx --t2 --uastc --resize 1024x1024 assets/textures/basisu/kodim23_UASTC.ktx2 third_party/ktx/external/basisu/test_files/kodim23.png 

After resizing it seems like the VK_IMG_format_pvrtc extension is required.

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 a pull request may close this issue.

1 participant