Skip to content

Howto write shader input uniform value #127

@TristanCacqueray

Description

@TristanCacqueray

Would it be possible to add some documentations and/or a function to update an uniform value? If I understand correctly the code in resize/Main.hs, the Julia shader Frame uniform is updated using:

          allocaBytes constantBytes $ \p -> do
            liftIO $ poke (p `plusPtr` 0) frameScale
            liftIO $ poke (p `plusPtr` 8) frameOffset
            liftIO $ poke (p `plusPtr` 16) c
            liftIO $ poke (p `plusPtr` 24) escapeRadius
            cmdPushConstants' fJuliaPipelineLayout
                              SHADER_STAGE_COMPUTE_BIT
                              0
                              constantBytes
                              p

I'm looking for replacing opengl (example here), and I am not sure what is the vulkan equivalent of Graphics.GL.Core31.glUniform2f.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions