10 Commits

Author SHA1 Message Date
Corentin Wallez
6f7749cce9 Change render passes from multi to single pass.
This as an API change to get closer to the direction in which WebGPU is
headed. The API change in next.json caused a ton of files to be changed
in the same commit to keep things compiling.

API: the Framebuffer and RenderPass objects are now merged in a single
RenderPassInfo that contains the attachments, loadOps and clear values
for a BeginRenderPass command. The concept of subpass is removed.
The RenderPass creation argument to RenderPipelines is replaced by
explicitly setting the format of attachments for RenderPipeline.

Validation: SetPipeline checks are changed to check that the attachments
info set on a RenderPipeline matches the attachments of the render pass.

Backends: Most changes are simplifications of the backends that no
longer require and indirection to query the current subpass out of the
render pass in BeginSubpass, and don't need to get the attachment info
from a RenderPass when creating RenderPipelines. In the Vulkan backend,
a VkRenderPass cache is added to reuse VkRenderPasses between
RenderPassInfos and RenderPipelines.

Tests and examples: they are updated with the simplified API. Tests
specific to the Framebuffer and RenderPass objects were removed and
validation tests for RenderPassInfo were added.

Tested by running CppHelloTriangle on all backends, end2end tests on all
platforms and all examples on the GL backend.
2018-05-16 11:18:14 -04:00
Corentin Wallez
c7807abf04 Format: src/backend/opengl 2017-11-28 16:18:39 -05:00
Corentin Wallez
7ee1610f38 Member rename: src/backend/opengl 2017-11-23 17:04:10 -05:00
Corentin Wallez
33f7bfe322 OpenGL: Apply vertex/index buffers just before draw.
Previously we would modify the GL state as soon as we saw
SetIndex/VertexBuffers. This GL state is owned by the VAOs in the
InputState and was disappearing on a Pipeline change. Fix this by
applying the index / vertex buffers lazily.
2017-11-21 17:34:16 -05:00
Corentin Wallez
a214b7f12d OpenGL: Fix push constants disappearing on pipeline change 2017-08-23 09:49:35 -04:00
Kai Ninomiya
b985431c82 Load operations (#105)
* load ops: design + implementation (all backends)

* Animometer/glTFViewer: use just one subpass per frame
2017-08-11 14:36:20 -07:00
Austin Eng
8dc3bd1808 opengl: Implement blend state 2017-08-07 18:51:48 -04:00
Austin Eng
439d963ccd Point,Line,Triangle -> PointList,LineList,TriangleList 2017-07-27 10:19:30 -04:00
Austin Eng
d81fd82bde Implement primitive topology in OpenGL, Metal, and D3D12 backends 2017-07-27 10:19:30 -04:00
Corentin Wallez
b085eecb31 Split Pipeline in Render and Compute, OpenGL part 2017-07-17 15:25:16 -04:00