Hello,
I tried the example again for a vertex shader that looks like this:
#version 310 es
precision mediump float;
in vec4 inVertex;
out vec2 textureCoordinate;
layout (std140) uniform ubo
{
vec4 position[255];
} ubo1;
void main()
{
textureCoordinate = vec2(1.0, 1.0);
gl_Position = ubo1.position[254];
}
Disassembly:
--------------------- Disassembled HW Code --------------------
0 : smadd32 ft0, c31, c24, c24,
mov idx0, ft0;
1 : mov ft0, c64
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 5;
2 : mov ft0, c64
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 4;
3 : mov ft0, sh250[idx0]
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 0;
4 : mov ft0, sh251[idx0]
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 1;
5 : mov ft0, sh252[idx0]
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 2;
6 : mov ft0, sh253[idx0]
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 3;
Still register access. Now let’s go over 255:
#version 310 es
precision mediump float;
in vec4 inVertex;
out vec2 textureCoordinate;
layout (std140) uniform ubo
{
vec4 position[301];
} ubo1;
void main()
{
textureCoordinate = vec2(1.0, 1.0);
gl_Position = ubo1.position[300];
}
Yields:
--------------------- Disassembled HW Code --------------------
0 : mov ft0, ft1, c0, 1024
mov ft2, c0
cbs ft3, c0
mov ft4, ft1
lsl ft5, ft4, c0
mov idx0, ft5;
1 : mov ft0, c64
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 5;
2 : mov ft0, c64
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 4;
3 : mov ft0, sh178[idx0]
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 0;
4 : mov ft0, sh179[idx0]
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 1;
5 : mov ft0, sh180[idx0]
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 2;
6 : mov ft0, sh181[idx0]
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 3;
Still register access, right? Let’s go up o 512:
#version 310 es
precision mediump float;
in vec4 inVertex;
out vec2 textureCoordinate;
layout (std140) uniform ubo
{
vec4 position[512];
} ubo1;
void main()
{
textureCoordinate = vec2(1.0, 1.0);
gl_Position = ubo1.position[511];
}
--------------------- Disassembled HW Code --------------------
0 : mov ft0, c64
mov ft0.e0.e1.e2.e3, ft0
mov i0, sh3;
uvsw.write ft0, 5;
1 : smadd64 ft0, sh4, c1, sh2, i0,
mov r5.e0.e1.e2.e3, fte
mov r4, ft0;
ld r0, drc0, 4, r4;
2 : wdf drc0
3 : mov ft0, r0
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 0;
4 : mov ft0, r1
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 1;
5 : mov ft0, r2
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 2;
6 : mov ft0, c64
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 4;
7 : mov ft0, r3
mov ft0.e0.e1.e2.e3, ft0
uvsw.write ft0, 3;
PVRShaderEditor 2.12, PowerVR Series6
Is this a bug in the shader editor or do we have more register space in vertex shader?