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

Segmentation Fault from declaration of a const using values from chromaticities data type #23

Closed
aforsythe opened this issue Oct 9, 2012 · 0 comments

Comments

@aforsythe
Copy link
Member

The follow examples cause a segmentation fault


/* ============ CONSTANTS ============ */

const Chromaticities ACESChromaticities =
{
    { 0.73470,  0.26530},
    { 0.00000,  1.00000},
    { 0.00010, -0.07700},
    { 0.32168,  0.33767}
};

// Declare a const - No Seg Fault
// const float WHITE[3] = {0.32168, 0.33767, 1.0};

// Declare a const using values from Chromaticities data type and a float - Seg Fault
const float WHITE[3] = {ACESChromaticities.white[0], ACESChromaticities.white[1], 1.0};

// Declare a const using values pulled from Chromaticities data type without an additional float - Seg Fault
// const float WHITE[2] = {ACESChromaticities.white[0], ACESChromaticities.white[1]};

// Declare a const from floats pulled from Chromaticities placed into a float before the creation of the final array - Seg Fault
// const float WHITE_x = ACESChromaticities.white[0];
// const float WHITE_y = ACESChromaticities.white[1];
// const float WHITE[2] = {WHITE_x, WHITE_y};


/* ============ ODT - Main Algorithm ============ */
void main
(  
    input varying float rIn,
    input varying float gIn,
    input varying float bIn,
    input varying float aIn,
    output varying float rOut,
    output varying float gOut,
    output varying float bOut,
    output varying float aOut)

{
    // Do the same things here and no seg fault
    // float WHITE[3] = {0.32168, 0.33767, 1.0};

    // float WHITE[3] = {ACESChromaticities.white[0], ACESChromaticities.white[1], 1.0};

    // float WHITE[2] = {ACESChromaticities.white[0], ACESChromaticities.white[1]};

    // float WHITE_x = ACESChromaticities.white[0];
    // float WHITE_y = ACESChromaticities.white[1];
    // float WHITE[2] = {WHITE_x, WHITE_y};

    print(WHITE[0], WHITE[1]);

}

@kgboreham kgboreham mentioned this issue Nov 2, 2012
scottdyer added a commit to scottdyer/aces-dev that referenced this issue Nov 2, 2012
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

2 participants