Skip to content

Python Support for GPUProcessor #2164

@beatreichenbach

Description

@beatreichenbach

Hello,

Following up on this ticket, how is the support for GPUProcessor these days? I'm still unable to instantiate some of the classes which I assume because there's no python bindings yet.

Are there plans to add support for this?
From the code I looked at it looks like a lot of functions are involved in generating the shader code for a transform :(

# Step 1: Get the config
config = OCIO.GetCurrentConfig()

# Step 2: Lookup the display ColorSpace
display = config.getDefaultDisplay()
view = config.getDefaultView(display)

# Step 3: Create a DisplayViewTransform, and set the input, display, and view
# (This example assumes the input is a role. Adapt as needed.)
transform = OCIO.DisplayViewTransform()
transform.setSrc(OCIO.ROLE_SCENE_LINEAR)
transform.setDisplay(display)
transform.setView(view)

# Step 4: Create the processor
processor = config.getProcessor(transform)
gpu = processor.getDefaultGPUProcessor()
shader_desc = OCIO.GpuShaderDesc()
shader_desc.setLanguage(OCIO.GpuLanguage.GPU_LANGUAGE_GLSL_4_0)
shader_desc.setFunctionName('OCIODisplay')
shader_desc.setResourcePrefix('ocio_')

source = gpu.extractGpuShaderInfo(shader_desc)
print(source)

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