WebGL: INVALID_VALUE: vertexAttribPointer: index out of range (Ubuntu)

Đang mở
#194 23 bình luận 14 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript

Hướng nghiên cứu

The report points to PIXI.WebGLSpriteBatch.flush in phaser.js and the shader.aTextureIndex attribute lookup, where the location is -1; the minimal reproduction is new Phaser.Game({width: 10, height: 10, renderer: Phaser.AUTO, resolution: 1}). Start by comparing the affected 2.7.x behavior with 2.6.2 and trace the shader attribute setup and use. Done means the minimal game no longer produces the vertexAttribPointer warning in Firefox or Chromium.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug help wanted

A bug in the API:

I am getting WebGL: INVALID_VALUE: vertexAttribPointer: index out of range spam on Firefox as well as on Chromium, running Ubuntu.

There is no condition for it to happen. It just happens always. A "code example" therefore simply is the empty example codepen: https://codepen.io/pen?template=vyKJvw

There is nothing obvious wrong, except those errors being spammed.

Here is the stacktrace from chromium, referencing lines in phaser-arcade-physics.js of 2.7.7:

PIXI.WebGLSpriteBatch.flush @ phaser.js:5153
PIXI.WebGLSpriteBatch.end @ phaser.js:4806
PIXI.WebGLRenderer.renderDisplayObject @ phaser.js:3742
PIXI.WebGLRenderer.render @ phaser.js:3705
updateRender @ phaser.js:21403
update @ phaser.js:21325
updateRAF @ phaser.js:49064
_onLoop @ phaser.js:49047

It happens due to shader.aTextureIndex in the line
gl.vertexAttribPointer(shader.aTextureIndex, 1, gl.FLOAT, false, stride, 20);
being -1

It is -1 because the getAttributeLocation earlier does indeed seem to return -1
I have no idea why that is however. It reminds me of an issue I had in other WebGL code that was due to some attributes being optimized away since they were not used, but the shader code of the respective shader here does seem to at least superficially use the attribute.

The minimal code to create the issue is to have Phaser in your namespace and start it with:

new Phaser.Game({width: 10, height: 10, renderer: Phaser.AUTO, resolution: 1})

From that point on it spams the warning.

I tested 2.7.7 and 2.7.3, both show the error.
2.6.2 is unaffected

Ngôn ngữ chính
JavaScript
Star
1.4k
Fork
485
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của phaserjs/phaser-ce

Tất cả issue của phaserjs/phaser-ce

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.