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

harmless but duplicate functions in glsl. One func for each call to passing ssbo as a struct #218

Open
cbaggers opened this issue Nov 21, 2018 · 3 comments

Comments

@cbaggers
Copy link
Owner

This test exposes the issue

(5am:def-test ssbo-8 (:suite ubo-ssbo-tests)
  (glsl-contains-n-p 1 "BLAH.*();"
    (compile-vert ((vert pos-col)
                  &uniform (the-data some-data :ssbo :std-140))
       :450 nil
     (labels ((blah ((x some-data))
                (with-slots (ints) x
                  (setf (aref ints 1) 10)))
              (ham ((x some-data))
                (blah x)))
       (ham the-data)
       (blah the-data)
       (v! 1 2 3 4)))))

the glsl that results is

"// vertex-stage
#version 450

layout(location = 0)  in vec3 fk_vert_position;
layout(location = 1)  in vec4 fk_vert_color;

layout(std140) buffer _SSBO_THE_DATA
{
    int[1000] INTS;
} THE_DATA;

int HAM0();
int BLAH1();
int BLAH0();

int BLAH0()
{
    return THE_DATA.INTS[1] = 10;
}

int BLAH1()
{
    return THE_DATA.INTS[1] = 10;
}

int HAM0()
{
    return BLAH0();
}

void main()
{
    HAM0();
    BLAH1();
    vec4 g_GEXPR0_1183 = vec4(float(1),float(2),float(3),float(4));
    gl_Position = g_GEXPR0_1183;
    return;
}
"
@cbaggers
Copy link
Owner Author

result from a fix to another issue. will track this there

@cbaggers cbaggers reopened this Nov 21, 2018
@cbaggers
Copy link
Owner Author

Turns out the duplicate func thing is already happening on master so this fine to have as a new ticket

@cbaggers cbaggers changed the title harmless yet spurious additional function to glsl when passing ssbos as values in select case harmless but duplicate functions in glsl. One func for each call to passing ssbo as a struct Nov 21, 2018
@cbaggers
Copy link
Owner Author

See the fix/ssbo-arg-issue branch for tests that fail on this behaviour

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

1 participant