Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a bool (unsupported) variable to a Hydra Shader crashes Hydra (usdview) #104

Closed
sirpalee opened this issue Nov 8, 2016 · 3 comments
Assignees

Comments

@sirpalee
Copy link
Contributor

sirpalee commented Nov 8, 2016

System Information (OS, Hardware, etc.)

Quadro K4200, Driver Version 370.28

Package Versions

USD: Dev, with the isnan fix applied

Steps to Reproduce

  1. Bring in any kind of geometry, and assign a hydra shader to it.
  2. Add a bool to the shader
  3. Try to view the usd file using usdview

Example usd file

#usda 1.0

over "dragon" (
    add references = @./dragon.usda@
)
{
    rel look:binding = </Test>
}

def Look "Test"
{
    rel displayLook:bxdf = </Test/TestShader>

    def Shader "TestShader"
    {
        uniform asset info:filename = @./alSurface.glslfx@
        float3 diffuseColor = (1.0, 1.0, 1.0)
        float diffuseStrength = 1.0
        bool myCrazyBool = 1
    }
}

The following is the output from usdview.

palm@ws-098:~/data/usd$ usdview ./test.usda 
Floating point exception (core dumped)

I didn't do too much testing yet, my guess is, this happens because booleans are not supported for glslfx shaders, and codeGen creates an invalid shader code. For example, the struct accessor function generators don't check if the type is empty or not. So for instance in this case the generated accessor function will look like this (note the extra space before HdGet...)

 HdGet_myCrazyBool()
{
...
}

Also, from what I saw, this creates a float value on the ShaderData struct, probably that's leading to the floating point exception (it's trying to read the boolean value into a float or something?). I assume the same thing happens with any kind of variable, that's not explicitly supported by Hydra.

@jtran56
Copy link

jtran56 commented Nov 10, 2016

Filed as internal issue #139911.

@sunyab
Copy link
Contributor

sunyab commented Dec 10, 2016

Reopening for now, as this commit has not been merged into master.

@sunyab
Copy link
Contributor

sunyab commented Feb 9, 2017

This change has been merged into release 0.7.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants