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

RenderTarget::Image doesn't support Rgba8Unorm and Bgra8Unorm texture formats (non-srgb formats) #15201

Open
MatrixDev opened this issue Sep 14, 2024 · 0 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Design This issue requires design work to think about how it would best be accomplished

Comments

@MatrixDev
Copy link

Bevy version

0.14.2

[Optional] Relevant system information

If you cannot get Bevy to build or run on your machine, please include:

  • the Rust version you're using (you can get this by running cargo --version)
    cargo 1.81.0 (2dbb1af80 2024-08-20)
  • the operating system or browser used, including its version
    SystemInfo { os: "MacOS 14.1.1 ", kernel: "23.1.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }

If your bug is rendering-related, copy the adapter info that appears when you run Bevy.

AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }

What you did

Change image format from Bgra8UnormSrgb to Rgba8Unorm or Bgra8Unorm and run the render_to_texture example:

cargo run --example render_to_texture

What went wrong

Example doesn't work.

2024-09-14T19:08:34.923526Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread '<unnamed>' panicked at /Users/matrixdev/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-22.1.0/src/backend/wgpu_core.rs:3411:5:
wgpu error: Validation Error

Caused by:
  In RenderPass::end
    In a set_pipeline command
      Render pipeline targets are incompatible with render pass
        Incompatible color attachments at indices [0]: the RenderPass uses textures with formats [Some(Bgra8Unorm)] but the RenderPipeline with 'blit pipeline' label uses attachments with formats [Some(Bgra8UnormSrgb)]

Additional information

I saw PR #6380 that should fix this problem and it partially does fix it - I can set R32Float or Rg32Float and it works.

Why do I want non-srgb texture format? Because I want to feed output image to a compute shader but those don't support srgb texture storages.

@MatrixDev MatrixDev added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Sep 14, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen S-Needs-Design This issue requires design work to think about how it would best be accomplished D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes and removed S-Needs-Triage This issue needs to be labelled labels Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Design This issue requires design work to think about how it would best be accomplished
Projects
None yet
Development

No branches or pull requests

2 participants