amethyst/rendy

Graph image format does not match swapchain image format

StarArawn opened this issue · 2 comments

Expected Behavior

Screen clears red.

Actual Behavior

Screen clears blue.

Example

    let color = graph_builder.create_image(
        surface.kind(),
        1,
        gfx_hal::format::Format::Rgba8Srgb,
        MemoryUsageValue::Data,
        Some(gfx_hal::command::ClearValue::Color(gfx_hal::command::ClearColor::Float([1.0, 0.0, 0.0, 1.0]))),
    );

You also need a device that would choose Bgra8Srgb as the swapchain format or I guess anything other than what is set in create_image.

Specifications

  • Platform: OSX 10.14.1/metal
  • Branch: reinforce

Graph creates image in exactly specified format. The problem is that graph image format and swapchain image format don't match and simple copy operation effectively swaps color components.
Presentation node does copy. But it must do blitting in case of image parameters don't match (format, or dimensions).

This should be fixed now.. Just use factory.get_surface_format?