amber icon indicating copy to clipboard operation
amber copied to clipboard

Image dumps only support limited formats

Open alan-baker opened this issue 5 years ago • 0 comments

#!amber

SHADER vertex vs PASSTHROUGH

SHADER fragment test GLSL
#version 450 core

layout(location=0) out vec4 color_out;

void main()
{
  color_out = vec4(1.0, 0.0, 0.0, 1.0);
}
END

BUFFER color_buffer FORMAT R8G8B8A8_UNORM

PIPELINE graphics test_pipe
  ATTACH vs
  ATTACH test

  FRAMEBUFFER_SIZE 8 8
  BIND BUFFER color_buffer AS color LOCATION 0
END

RUN test_pipe DRAW_RECT POS 0 0 SIZE 8 8

Running the above as test.amber:

amber test.amber -I color_buffer -i out.png

Produces an assertion:

Framebuffer (color_buffer) size (0) != width * height (64)

This assertion goes away if the format is changed to B8G8R8A8_UNORM.

At very least the error message should be improved.

alan-baker avatar Feb 27 '20 20:02 alan-baker