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

Clarify VS/FS fragment shader matching with anonymous struct varying #3656

Open
kkinnunen-apple opened this issue May 14, 2024 · 0 comments
Open

Comments

@kkinnunen-apple
Copy link
Contributor

Clarify how are the output or input variables variables matched when the variable declaration contains possibly anonymous struct.

The type of vertex outputs and fragment inputs with the same name must match, otherwise the link
command will fail. The precision does not need to match. Only those fragment inputs statically used (i.e.
read) in the fragment shader must be declared as outputs in the vertex shader; declaring superfluous vertex
shader outputs is permissible.

https://registry.khronos.org/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf

Two unnamed structs

// VS
out struct { float field; } s0;

// FS
in struct { float field; } s0;

Two named structs with the same name

// VS
out struct T { float field; } s0;

// FS
in struct T { float field; } s0;

One unnamed struct and one named struct

// VS
out struct T { float field; } s0;

// FS
in struct { float field; } s0;

Two named structs with different struct names

// VS
out struct T { float field; } s0;

// FS
in struct Q { float field; } s0;

Anonymous struct matched to two distinct anonymous structs at the other side

// VS
out struct { float field; } s0, s1;

// FS
in struct { float field; } s0;
in struct { float field; } s1;
@kdashg kdashg assigned kdashg and unassigned kdashg May 30, 2024
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