Skip to content

Add options for Hlsl shader generator to allow register selection. #2145

@mrvux

Description

@mrvux

Hello,

in the current state OCIO does not allow generated code to manually specify register slots (d3d11/12):

Example of generated code :

Texture2D ocio_lut1d_0; SamplerState ocio_lut1d_0Sampler;

This makes reflecting compiled shader (Nearly) mandatory to find the binding location, which is not desirable in many cases.

It would be nice to have an option to be able to set first register slot by hand, then get them generated in a fixed way, for example :

`shaderDesc->setLanguage(GPU_LANGUAGE_HLSL_DX11);
shaderDesc->setFunctionName(functionName);
shaderDesc->setResourceStartSlot(1);
shaderDesc->setSamplerStartSlot(4);

Generated code would become:

Texture2D ocio_lut1d_0 : register(t1); SamplerState ocio_lut1d_0Sampler : register(s4)

On a later stage, supporting bindless for latest d3d12/vulkan implementations would also be nice.

Thanks
Julien

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions