OpenColorIO icon indicating copy to clipboard operation
OpenColorIO copied to clipboard

Add options for Hlsl shader generator to allow register selection.

Open mrvux opened this issue 8 months ago • 1 comments

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

mrvux avatar Apr 09 '25 15:04 mrvux

@mrvux , we would be interested in your feedback on PR #2176 that adds Vulkan support.

doug-walker avatar Jul 25 '25 20:07 doug-walker