I have some questions regarding porting HLSL to GLSL :
1. Regarding the HLSL shader framework I have , I have large structs
with member variables which use semantics such as Color Color1 Vpos Vface Texcoord[N] and Texcoord[N]_centroid...
As I understand , there are no semantics in GLSL , but built-in variables such gl_fragColor and so on.
So my question is that what woud you suggest to port those structs with variables using semantics ?
Shall I make member variables with semantics global or are there any other ways you could suggest ?
2. I can`t use `location` qualifier and `centroid in/out` qualifier at the same time
I can have a struct like :
out struct test
{
centroid in float red;
layout(location = 1) float green;
layout(location = 2) float blue;
} ;
but I cant have :
out struct test
{
layout(location = 0) centroid in float red;
layout(location = 1) float green;
layout(location = 2) float blue;
} ;
The compiler says : `Location can be set only once `
On the other hand I can use `centroid in/out` qualifier together with location qualifier for a variable :
layout(location = 0) centroid out float t1;
So how can I use the centroid in/out qualifier at the same time with a location qualifier
for a struct member ?
3. I am trying to understand the difference between a struct and an interface block( in/out/uniform ).
I guess you can just create one instance of an interface so they will be just a set of global variables ?