glslang -> SPV: Improvements in swizzles on access chains: Bug 14007 (wrong type), simplications, tests, support mixed swizzle with dynamic component selection.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31277 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
6b3fd19d89
commit
06e1d0b434
9 changed files with 531 additions and 54 deletions
94
Test/spv.accessChain.frag
Normal file
94
Test/spv.accessChain.frag
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
#version 420
|
||||
|
||||
struct S
|
||||
{
|
||||
vec3 color;
|
||||
};
|
||||
|
||||
layout(location = 0) out vec3 OutColor;
|
||||
|
||||
uniform int u;
|
||||
|
||||
void GetColor1(const S i)
|
||||
{
|
||||
OutColor += i.color.x;
|
||||
}
|
||||
|
||||
void GetColor2(const S i, int comp)
|
||||
{
|
||||
OutColor += i.color[comp];
|
||||
}
|
||||
|
||||
void GetColor3(const S i, int comp)
|
||||
{
|
||||
OutColor += i.color[comp].x;
|
||||
}
|
||||
|
||||
void GetColor4(const S i, int comp)
|
||||
{
|
||||
OutColor += i.color[comp].x;
|
||||
}
|
||||
|
||||
void GetColor5(const S i, int comp)
|
||||
{
|
||||
OutColor += i.color;
|
||||
}
|
||||
|
||||
void GetColor6(const S i, int comp)
|
||||
{
|
||||
OutColor += i.color.yx[comp];
|
||||
}
|
||||
|
||||
void GetColor7(const S i, int comp)
|
||||
{
|
||||
OutColor.xy += i.color.yxz.yx;
|
||||
}
|
||||
|
||||
void GetColor8(const S i, int comp)
|
||||
{
|
||||
OutColor += i.color.yzx.yx.x.x;
|
||||
}
|
||||
|
||||
void GetColor9(const S i, int comp)
|
||||
{
|
||||
OutColor.zxy += i.color;
|
||||
}
|
||||
|
||||
void GetColor10(const S i, int comp)
|
||||
{
|
||||
OutColor.zy += i.color.xy;
|
||||
}
|
||||
|
||||
void GetColor11(const S i, int comp)
|
||||
{
|
||||
OutColor.zxy.yx += i.color.xy;
|
||||
}
|
||||
|
||||
void GetColor12(const S i, int comp)
|
||||
{
|
||||
OutColor[comp] += i.color.x;
|
||||
}
|
||||
|
||||
void GetColor13(const S i, int comp)
|
||||
{
|
||||
// OutColor.zy[comp] += i.color.x; // not yet supported
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
S s;
|
||||
OutColor = vec3(0.0);
|
||||
GetColor1(s);
|
||||
GetColor2(s, u);
|
||||
GetColor3(s, u);
|
||||
GetColor4(s, u);
|
||||
GetColor5(s, u);
|
||||
GetColor6(s, u);
|
||||
GetColor7(s, u);
|
||||
GetColor8(s, u);
|
||||
GetColor9(s, u);
|
||||
GetColor10(s, u);
|
||||
GetColor11(s, u);
|
||||
GetColor12(s, u);
|
||||
GetColor13(s, u);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue