Oes spec says:
For the both the input array gl_SampleMaskIn[] and the output array gl_SampleMask[], bit B of mask M
(gl_SampleMaskIn[M] or gl_SampleMask[M]) corresponds to sample 32*M+B. These arrays have
ceil(gl_MaxSamples/32) elements, where gl_MaxSamples is the maximum number of color samples
supported by the implementation.
But glslang report error "array must have size before use length".
layout(location = 0) out mediump vec4 fragColor;
void main (void)
{
for (int i = 0; i < gl_SampleMask.length(); ++i)
gl_SampleMask[i] = int(0xAAAAAAAA);
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
}
* Add two test items, one is for gl_MaxSapmles = 32 and the other one is for gl_MaxSapmles = 64.
39 lines
1.5 KiB
Text
39 lines
1.5 KiB
Text
gl_samplemask_array_size.frag
|
|
Shader version: 320
|
|
0:? Sequence
|
|
0:4 Function Definition: main( ( global void)
|
|
0:4 Function Parameters:
|
|
0:6 Sequence
|
|
0:6 Sequence
|
|
0:6 Sequence
|
|
0:6 move second child to first child ( temp mediump int)
|
|
0:6 'i' ( temp mediump int)
|
|
0:6 Constant:
|
|
0:6 0 (const int)
|
|
0:6 Loop with condition tested first
|
|
0:6 Loop Condition
|
|
0:6 Compare Less Than ( temp bool)
|
|
0:6 'i' ( temp mediump int)
|
|
0:6 Constant:
|
|
0:6 2 (const int)
|
|
0:6 Loop Body
|
|
0:7 move second child to first child ( temp highp int)
|
|
0:7 indirect index ( temp highp int SampleMaskIn)
|
|
0:7 'gl_SampleMask' ( out runtime-sized array of highp int SampleMaskIn)
|
|
0:7 'i' ( temp mediump int)
|
|
0:7 Constant:
|
|
0:7 -1431655766 (const int)
|
|
0:6 Loop Terminal Expression
|
|
0:6 Pre-Increment ( temp mediump int)
|
|
0:6 'i' ( temp mediump int)
|
|
0:9 move second child to first child ( temp mediump 4-component vector of float)
|
|
0:9 'fragColor' (layout( location=0) out mediump 4-component vector of float)
|
|
0:9 Constant:
|
|
0:9 0.000000
|
|
0:9 1.000000
|
|
0:9 0.000000
|
|
0:9 1.000000
|
|
0:? Linker Objects
|
|
0:? 'fragColor' (layout( location=0) out mediump 4-component vector of float)
|
|
0:? 'gl_SampleMask' ( out runtime-sized array of highp int SampleMaskIn)
|
|
|