SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant.vk.frag.vk
Hans-Kristian Arntzen 5d4bb687bc Support arrays which have spec constant size.
The size of an array can be a specialization constant or a spec constant
op. This complicates things quite a lot.

Reflection becomes very painful in the presence of expressions instead
of literals so add a new array which expresses this.

It is unlikely that we will need to do accurate reflection of interface
types which have specialization constant size.

SSBOs and UBOs will for now throw exception if a dynamic size is used since it
is very difficult to know the real size.
2016-10-03 17:17:11 +02:00

69 lines
1.9 KiB
Plaintext

#version 310 es
precision mediump float;
precision highp int;
layout(constant_id = 1) const float _9 = 1.0;
layout(constant_id = 2) const float _11 = 2.0;
layout(constant_id = 3) const int _16 = 3;
layout(constant_id = 4) const int _25 = 4;
layout(constant_id = 5) const uint _34 = 5u;
layout(constant_id = 6) const uint _35 = 6u;
layout(constant_id = 7) const bool _56 = false;
layout(constant_id = 8) const bool _57 = true;
struct Foo
{
float elems[(_25 + 2)];
};
layout(location = 0) out vec4 FragColor;
void main()
{
float t0 = _9;
float t1 = _11;
mediump uint c0 = (uint(_16) + 0u);
mediump int c1 = (-_16);
mediump int c2 = (~_16);
mediump int c3 = (_16 + _25);
mediump int c4 = (_16 - _25);
mediump int c5 = (_16 * _25);
mediump int c6 = (_16 / _25);
mediump uint c7 = (_34 / _35);
mediump int c8 = (_16 % _25);
mediump uint c9 = (_34 % _35);
mediump int c10 = (_16 >> _25);
mediump uint c11 = (_34 >> _35);
mediump int c12 = (_16 << _25);
mediump int c13 = (_16 | _25);
mediump int c14 = (_16 ^ _25);
mediump int c15 = (_16 & _25);
bool c16 = (_56 || _57);
bool c17 = (_56 && _57);
bool c18 = (!_56);
bool c19 = (_56 == _57);
bool c20 = (_56 != _57);
bool c21 = (_16 == _25);
bool c22 = (_16 != _25);
bool c23 = (_16 < _25);
bool c24 = (_34 < _35);
bool c25 = (_16 > _25);
bool c26 = (_34 > _35);
bool c27 = (_16 <= _25);
bool c28 = (_34 <= _35);
bool c29 = (_16 >= _25);
bool c30 = (_34 >= _35);
mediump int c31 = (c8 + c3);
mediump int c32 = int(_34 + 0u);
bool c33 = (_16 != int(0u));
bool c34 = (_34 != 0u);
mediump int c35 = int(_56);
mediump uint c36 = uint(_56);
float c37 = float(_56);
float vec0[_25][(_16 + 3)];
float vec1[(_16 + 2)][(_25 + 5)];
Foo foo;
FragColor = (((vec4((t0 + t1)) + vec4(vec0[0][0])) + vec4(vec1[0][0])) + vec4(foo.elems[_16]));
}