New: storage buffer in frag shader when using GraphicsPipelineConfigurator #256
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Alert: This PR is meant to provoke discussion on a specific aspect of VSG design. For changes to VSG, please continue the discussion in the issue linked below. Once VSG has moved forward, this PR can be adjusted to accomodate the design decisions made and provide a working example.
See this issue on VSG: vsg-dev/VulkanSceneGraph#954
This example attempts to use
GraphicsPipelineConfigurator
andShaderSet
along side a storage buffer (descriptor typeVK_DESCRIPTOR_TYPE_STORAGE_BUFFER
). Since storage buffers are bound exactly like uniform buffers, there exists a very small potential change we could make in VSG to add storage buffer support to methods that look likeaddUniformBinding()
andassignUniform()
, however this makes the interface misleading (uniform and storage buffers are quite different in size limitations and purpose).The example included here uses a storage buffer in the fragment shader to color individual triangles using the
gl_PrimitiveID
to index into the buffer. This minimizes the data transfered to the card when the triangle list is large and also minimizes the number of draw commands with a large number of colors when used with an index-draw command.