amethyst / amethyst/rendy

[BUG] texture::image::load_from_image creates invalid TextureBuilder

Open
#80 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
812
Forks
94
PR merge metrics
No merged PRs in 30d

Description

## Description
`texture::image::load_from_image` returns a `TextureBuilder` which according to the vulkan validation has unsupported parameters for some source images.

## Reproduction Steps
1. Clone https://github.com/valkum/learn-rendy/tree/image_load_bug
2. Run instanced_cube example with vulkan
3. Change Filename in https://github.com/valkum/learn-rendy/blob/image_load_bug/examples/instanced_cube.rs#L278-L287

## What You Expected to Happen
See textured cubes for alle 3 textures in resources.

## What Actually Happened
Both not_working pngs are black in rendy.

## Screenshots and Logs
using not_working.png:
```
ERROR 2019-03-20T20:47:02Z: gfx_backend_vulkan: [Validation] [ VUID_Undefined ] Object: VK_NULL_HANDLE (Type = 0) | vkCreateIm
age(): Format VK_FORMAT_R8G8B8_SRGB is not supported for this combination of parameters.
ERROR 2019-03-20T20:47:02Z: gfx_backend_vulkan: [Validation] [ VUID-VkImageViewCreateInfo-None-02273 ] Object: 0x1d (Type = 10
) | vkCreateImageView(): pCreateInfo->format VK_FORMAT_R8G8B8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL has no supported format
features on this physical device. The Vulkan spec states: The format features of the resultant image view must contain at least
one bit. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-None-02273)
```

![image](https://user-images.githubusercontent.com/169155/54717856-6f1f3700-4b59-11e9-8324-d8ce4d55b00a.png)

## Your Environment
Windows 10 64bit
AMD R9 390 Driver 19.2.3

## Additional Context

For reproduction purpose I added amethyst-like image loading code to an updated version of learn-rendy.

The working original learn-rendy code uses `image::load_from_memory` and `to_rgba` but is not optimal for all texture assets.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.