Skip to content

Compiler issues invalid error: non constant expression in initialization #13

@afd

Description

@afd

[Shaders, screenshots, error log, reproduction steps, etc.] [ZIP]

This code:

#version 440

void main(void)
{
  vec4 A[2] = vec4[2](vec4(1.0), vec4((vec2(1.0) * mat2(1.0)).x));
  int x = 1;
  vec4 y = vec4(A[x].z);
}

is accepted by glslangValidator (and also a recent Intel driver).

The NVIDIA compiler erroneously gives an error:

LINK_ERROR
Vertex info
-----------
0(2) : warning C7555: 'attribute' is deprecated, use 'in/out' instead

Fragment info
-------------
0(7) : error C1059: non constant expression in initialization

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions