mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-27 13:10:37 +00:00
44e842cd9c
Purpose: glsl spec allows to define array with the length of the result of constant expression, the arithmetic operation of "mod(float (7.1), float (4.0))" should be generate the array length at the shader compile time, but glslang didn't support mod operation for the constant expression in previous implementation; An example is as following: ########### #version 460 flat out highp int vtx_out_out0; void main (void) { float array[int(mod(float (7.1), float (4.0)))]; vtx_out_out0 = array.length(); } ###########
17 lines
262 B
GLSL
17 lines
262 B
GLSL
#version 460 core
|
|
|
|
int i;
|
|
; // extraneous semicolon okay
|
|
float f;;;
|
|
|
|
void main()
|
|
{
|
|
bool b1;
|
|
float array[int(mod(float (7.1), float (4.0)))];
|
|
b1 = anyInvocation(b1);
|
|
b1 = allInvocations(b1);
|
|
b1 = allInvocationsEqual(b1);
|
|
}
|
|
;
|
|
;
|