AggressiveDCE: Retain all bindings#2678
Closed
troughton wants to merge 1 commit intoKhronosGroup:masterfrom
Closed
AggressiveDCE: Retain all bindings#2678troughton wants to merge 1 commit intoKhronosGroup:masterfrom
troughton wants to merge 1 commit intoKhronosGroup:masterfrom
Conversation
Collaborator
|
Sorry, I though I had responded earlier. For the design, I would suggest adding a flag that is passed as a parameter to the constructor for For the public interface, Lastly add a new suboption to eliminate-dead-code-aggressive. See scalar replacement for how to do that. Also, update the documentation for the option in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Some background: my shader render pipeline uses SPIRV-Cross to convert SPIR-V into Metal shaders. For resource binding, argument buffers are used, mapping directly to Vulkan descriptor sets. Crucially, these argument buffers are shared across pipeline stages; each argument buffer may contain resources relevant to both the vertex and fragment stage.
As a result of this, I need all bindings to be visible to all shader stages, even if the binding may be unused in that stage: the argument buffer definition must be complete. To achieve this, the AggressiveDCE pass must not strip instructions with binding decorations. (Additional changes are also needed for SPIRV-Cross to support this; see troughton/SPIRV-Cross@c3daef7)
Note that simply not running the pass isn't an option; my source shaders are in HLSL so need to undergo legalisation.
I don't expect this to be merged as-is (since that would obviously be undesirable for code-size in a number of shaders), but I welcome suggestions for how retaining bindings should be added as an option – should it be added an option to AggressiveDCE, or should a separate pass be used? How should the option be exposed in the driver?