mirror of
https://github.com/RPCS3/glslang.git
synced 2024-12-11 12:53:41 +00:00
be63facd80
Allow constructors to and from references to be constant folded. Section 4.3.3 says constructors whose arguments are all constant expressions must fold. Disallow 'const' on buffer reference types. It is not a 'non-void transparent basic data type' (it is not considered 'basic'). Handle buffer reference constants (which can be assigned to a non-const reference, or can be further folded to another type of constant) by converting to 'constructor(uint64_t constant)' in addConversion. Disallow == and != operators on reference types.
21 lines
349 B
GLSL
21 lines
349 B
GLSL
#version 450
|
|
|
|
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable
|
|
#extension GL_EXT_buffer_reference : enable
|
|
#extension GL_EXT_scalar_block_layout : enable
|
|
|
|
layout(buffer_reference) buffer T1 {
|
|
int x;
|
|
};
|
|
|
|
const T1 a = T1(uint64_t(2));
|
|
|
|
void main()
|
|
{
|
|
T1 b, c;
|
|
const T1 d = b;
|
|
|
|
b == c;
|
|
b != c;
|
|
}
|