amber icon indicating copy to clipboard operation
amber copied to clipboard

Add RenderPass support?

Open dj2 opened this issue 5 years ago • 5 comments

Currently a pipeline in amber stores a VkRenderPass and then creates a Pipeline in that pass when we execute the draw call. Effectively, each pipeline has an individual renderpass.

It is possible for multiple pipelines to be in a given renderpass. Should we expose this feature through Amber or have it tested in other ways?

Sketch of Amberscript:

RENDERPASS pass
  BIND BUFFER framebuffer AS color LOCATION 0
END

BUFFER framebuffer FORMAT B8G8R8A8_UNORM

PIPELINE graphics my_pipeline
  ATTACH vert_shader
  ATTACH frag_shader

  RENDERPASS pass
END

PIPELINE graphics my_pipeline2
  ATTACH vert_shader
  ATTACH frag_shader

  RENDERPASS pass
END

dj2 avatar Nov 20 '19 14:11 dj2

@paulthomson @dneto0 @jaebaek

dj2 avatar Nov 20 '19 14:11 dj2

I would maybe picture something like (pseudo-code):

start renderpass P
   RUN pipeline X
   RUN pipeline Y
end renderpass P

...at the point when you run the pipelines.

paulthomson avatar Nov 20 '19 14:11 paulthomson

In that case, could I do something like:

RUN pipeline X
RUN pipeline Y

start rnederpass P
  RUN pipeline X
  RUN pipeline Y
end

dj2 avatar Nov 20 '19 14:11 dj2

I'm not sure what that would mean, what color buffers would get written into, heh.

dj2 avatar Nov 20 '19 14:11 dj2

Need to verify that Amber is how I think it is. Does the AmberScript Pipeline each get a GraphicsPipeline in the Vulkan engine? If they do then it's 1:1 with renderpass, if they don't then we have many pipelines in a single render pass. Need to verify which we have as that changes how we define this feature.

dj2 avatar Nov 20 '19 19:11 dj2