Demo
Register Allocation ported to GeeXLab.
Location in the demopack:
gl-32-shadertoy-01/gl32-register-allocation.xmlDownloads:-
Shadertoy demopack for GeeXLab-
GeeXLab downloadsTests:
- Resolution: 800x480
- GPU: GeForce GTX 1080 + 417.71 + Win10 64-bit 1809
NUM is a constant that can be changed in the pixel shader source code (line 75 in the XML demo file).
- NUM = 256 => 4500 FPS
- NUM = 512 => 3500 FPS
- NUM = 1024 => 2900 FPS
- NUM = 2048 => 2900 FPS
- NUM = 3072 => 2800 FPS
- NUM = 4080 => 2800 FPS
- NUM = 4096 => compiler crash
=> Internal error: assembly compile error for fragment shader at offset 783:
line 27, column 12: error: size of temp array must be integer
- NUM = 8192 => 0(47) : error C5041: cannot locate suitable resource to bind variable "data". Possibly large array.
For NUM=4096, the NVIDIA GLSL compiler gave me:
-------------
Internal error: assembly compile error for fragment shader at offset 783:
-- error message --
line 27, column 12: error: size of temp array must be integer
line 31, column 12: error: expected ','
line 39, column 12: error: expected ','
line 43, column 12: error: expected ','
line 44, column 20: error: expected ';'
line 45, column 20: error: expected ';'
line 46, column 20: error: expected ';'
-- internal assembly text --
!!NVfp5.0
OPTION NV_internal;
OPTION NV_bindless_texture;
# cgc version 3.4.0001, build date Jan 11 2019
# command line args:
#vendor NVIDIA Corporation
#version 3.4.0.1 COP Build Date Jan 11 2019
#profile gp5fp
#program main
#semantic iResolution
#semantic iTime
#semantic iMouse
#semantic iFrame
#semantic data : __LOCAL
#var float4 gl_FragCoord : $vin.WPOS : WPOS : -1 : 1
#var float4 FragColor : $vout.COL00 : COL0[0] : -1 : 1
#var float4 v_texcoord : : : -1 : 0
#var float3 iResolution : : : -1 : 0
#var float iTime : : c[0] : -1 : 1
#var float4 iMouse : : : -1 : 0
#var int iFrame : : c[1] : -1 : 1
#var float4 data[0] : : lmem0[0], 4096 : -1 : 1
PARAM c[2] = { program.local[0..1] };
ATTRIB fragment_position = fragment.position;
TEMP R0, R1, R2;
TEMP T;
TEMP lmem0[4096];
OUTPUT result_color0 = result.color;
MOV.F R0.yzw, {0, 1, 0, 0}.xxxy;
SIN.F32 R0.x, c[0].x;
MOV.F lmem0[0], R0;
TRUNC.S R1.x, fragment.position;
ADD.S R0.y, R1.x, c[1].x;
MOD.S R0.y, R0, {4096, 0, 0, 0}.x;
MOV.F R0.xzw, {0, 1, 0, 0}.xyxy;
MOV.S R1.x, R0.y;
ADD.F32 R1.y, c[0].x, {2, 0, 0, 0}.x;
SIN.F32 R0.y, R1.y;
MOV.F lmem0[R1.x], R0;
ADD.F32 R0.z, c[0].x, {4, 0, 0, 0}.x;
MOV.F R0.xyw, {0, 1, 0, 0}.xxzy;
SIN.F32 R0.z, R0.z;
MOV.F lmem0[4095], R0;
MOV.F R2.xyz, lmem0[4095].xyzw;
MOV.F R1.xyz, lmem0[R1.x].xyzw;
MOV.F R0.xyz, lmem0[0].xyzw;
ADD.F32 R0.xyz, R0, R1;
ADD.F32 result_color0.xyz, R0, R2;
MOV.F result_color0.w, {1, 0, 0, 0}.x;
END
# 21 instructions, 3 R-regs
For NUM=8192 :
0(47) : error C5041: cannot locate suitable resource to bind variable "data". Possibly large array.
