KhronosGroup / KhronosGroup/WebGL

Test for WebGL1 that GLSL arrays can not be initialized?

Open
#2,821 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
2.9k
Forks
703
Avg merge
2d 9h
Merged PRs (30d)
4

Description

In GLSL ES 1.0 you can not do

float array[3] = float[3](1.0, 2.0, 3.0);

But you can in GLSL ES 3.0.

In fact in WebGL1 we get these error from ANGLE

ERROR: 0:13: '[]' : array constructor supported in GLSL ES 3.00 and above only
ERROR: 0:13: '[]' : first-class arrays (array initializer) supported in GLSL ES 3.00 and above only

I see a few WebGL2 tests that you can use that style. I don't see any WebGL1 tests that you can't

Am I missing it or should one be added?

Note: you can do this in GLSL 1.0

float array[3];
array[0] = 1.0;
array[1] = 2.0;
array[2] = 3.0;

and that is tested.

Contributor guide

Open the contributing guide

Research direction

Compare the existing WebGL2 tests for array constructors with the WebGL1 tests covering array declarations and assignments. Add a WebGL1 test for the rejected array-initializer syntax, then run the relevant WebGL1 tests and verify that compilation produces the expected failure.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics, testing-qa
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.