Comments (7)
Based on the link failure, I narrowed it down to these lines:
int col = int(texture2D(u_texture[img], uv).r * 255.0);
According to this stackoverflow answer, we shouldn't be able to do this:
In GLSL 1.30 to 3.30, you can have sampler arrays, but with severe restrictions on the index. The index must be an integral constant expression. Thus, while you can declare a sampler array, you can't loop over it.
So I don't understand how this code was working ever? I suspect there's a disconnect in GL versions maybe? I worked around it by unwrapping the array access so the index is a constant and now things work:
https://gist.github.com/AndrewNelis/ea5d8780c2d6aab047b00f3f2d52aa7b
(can't attach patches to github comments 👎 )
Improvements welcome...
from pyxel.
Digging deeper, I added the validate
argument to compileProgram
and got a more useful error:
def __init__(self, vertex_shader, fragment_shader):
try:
self._program = shaders.compileProgram(
shaders.compileShader(vertex_shader, gl.GL_VERTEX_SHADER),
shaders.compileShader(fragment_shader, gl.GL_FRAGMENT_SHADER), validate=False)
except Exception as e:
print(str(e).encode('utf-8').decode('unicode_escape'))
raise SystemExit()
self._att = None
self._tex_list = []
Error output is now:
Link failure (0): b'Vertex info
-----------
0(32) : warning C7050: "v_max_pos" might be used before being initialized
0(31) : warning C7050: "v_min_pos" might be used before being initialized
Fragment info
-------------
0(154) : error C5208: Sampler needs to be a uniform (global or parameter to main), need to inline function or resolve conditional expression
0(155) : error C5208: Sampler needs to be a uniform (global or parameter to main), need to inline function or resolve conditional expression
I believe it's complaining about an issue with the DRAWING_FRAGMENT_SHADER
, the blt()
and text()
functions.
from pyxel.
Hi, I'm seeing the same traceback:
- Pyxel version: master branch.
- OS: Fedora 27
- Python version: 3.3.6
- Video Driver: NVIDIA 340.107
- Video card:
VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210] (rev a2)
I've attached glxinfo.txt in case that helps.
As above, the traceback message is empty so I can't see what's wrong.
from pyxel.
I see.
I shouldn't use variables to specify the index of the texture image array in GLSL.
I'll change to use if as your patch.
from pyxel.
Thank you!
I fixed this bug in Pyxel 0.7.5.
from pyxel.
Thanks for patching.
from pyxel.
i'm on windows 8.1 x64, Pyxel 0.9.5 but still get the same error, any help will be appreciated
from pyxel.
Related Issues (20)
- Freeze when rotating screen on iOS (on web) HOT 1
- ImportError: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory HOT 4
- [Feature request] Implement an equivalent method to Pico 8 Load() HOT 3
- When I run an HTML application with ver 2.0, the assets file does not load properly. HOT 3
- Pyxel edit crashes upon cursor entering with EXC_BAD_ACCESS (SIGBUS) HOT 5
- demo of 30 Seconds Of Daylight is crashing HOT 2
- Pyxel 2.0.0 displays only black screen on Raspberry Pi HOT 12
- Confusion with `blt` function HOT 7
- Unable to import classes from different files using https://kitao.github.io/pyxel/wasm/launcher/?run= HOT 6
- palette only 0..254 (v2.0.2) HOT 2
- mouse_wheel never become 0 HOT 3
- Pyxel Editor crash when selecting Music Editor HOT 6
- Non pixel perfect pixels on the right side of the screen HOT 29
- Pyxel not running HOT 4
- Pyxel crash when starting edit or hello world example HOT 1
- Don't start when I ask for
- command for the terminal didn't work (pycharm) HOT 2
- Slide sound effect only works once HOT 4
- Unable to build a pyxel to exe application on a drive other than C:/ on Windows. HOT 1
- pyxel edit で音符マークを押したら music_editor.py の インデックスエラーで異常終了する。 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyxel.