AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO

Add options for Hlsl shader generator to allow register selection.

Open
#2,145 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.1k
Forks
503
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.