bevyengine / bevyengine/bevy

Image's texture view should be a separate asset

Open
#24,339 0 comments 0 reactions 0 assignees View on GitHub
A-Assets A-Rendering C-Performance
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

Currently Image/GpuImage contains one texture created from image data, and one texture view created with texture view descriptor, therefore you have to clone the Image to create new `Handle`s to use different texture views, such as using different srgb format or view dimension, using a 2d slice from texture array or mipmaps, or swizzling channels (The incoming `texture-component-swizzle` feature).

But the cloning is unnecessary and expensive. The underlying wgpu API allows you create different views from the same texture.

## What solution would you like?

Split Image into two assets: Image, and ImageView which depends on a `Handle`. Then Replace all `Handle` with `Handle` in components that need an image.

## What alternative(s) have you considered?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.