Skip to content

(Question): IDxcLinker functionality #3174

Closed

Description

Hi,
Unfortunately I can't seem to find any documentation on the linker, but from what I saw from the command line tool and IDxcLinker class, it seems like there is no tool to optimize & validate multiple shader stage entries with each other. This would be very handy, because right now the ID3D12PipelineState will just report FAILED(hresult) if certain outputs/inputs are read from but not written to. This could be prevented if the linker would support multiple shader stage entrypoints and could output these binaries with an optimized form.
Right now the priority is mainly on just validation between this, but of course it could potentially be used for nice optimizations.
Spirv tools already has this functionality from what I'm told, so it would be nice to see this in DXC. If it's already available, I'd like to hear how this can be invoked.

Activity

  1. tex3d commented on Jan 30, 2021

    @tex3d
    Contributor

    I'm afraid there may be a misunderstanding on the term linker. The terminology from OpenGL and linking shader stages does not apply to the Dxil linker. The dxil linker is meant for linking libraries of functions together into entry points or other libraries, much like a C++ linker. It does not have anything to do with the "linking" between shader stages that you're thinking of.

    Note that when the runtime reports a failure in pipeline state creation, if you enable debug layers (uses D3D12SDKLayers.dll - install Graphics Tools), then it should tell you why it failed.

    If you want a tool to verify shader signatures are compatible between stages in advance, I'm afraid there isn't one I know of at the moment. We can take this as feedback that such a tool may be useful.

  2. Nielsbishere commented on Jan 30, 2021

    @Nielsbishere
    ContributorAuthor

    I believe such a tool may be very useful, since the validation layer isn't available to our users. This would mean that if you write a wrong shader it could crash at runtime and we'd have no idea if the shader was to blame and in what way. Linking them would allow us to make sure things like hull shaders are compatible with our other shaders, which reduces problems in the workflow. It would also potentially increase performance because targets that are unused between stages could be discarded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions