Fragment shader functions not in working order
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
首先运行链接的 gpgpuTest 示例,并将生成的着色器与 reorganizedFragmentShader.js 和 originalFragmentShader.js 进行比较,尤其要关注 issue 中引用的函数范围。跟踪 GPU.js 如何组装片段着色器,并复现 WebGL 编译失败。完成的标准是示例能够编译并运行,而无需手动重新排列函数。
由索引模型根据 Issue 内容生成。
描述
What is wrong?
I have a problem with a shader. The functions in the shader are not in the correct order. I am trying to add roughly 20 functions, and they are breaking the compiled fragment shader. The problematic shader has some functions defined before functions it depends on, which apparently does not work in webGL. I rearranged the shader functions by hand and it works fine.
Where does it happen?
A website running GPU.js on my desktop Mac mini (specifically this website https://m0ose.github.io/jsSketches/gpgpuTest/index2.html)
How do we replicate the issue?
I put the example webpage here https://m0ose.github.io/jsSketches/gpgpuTest/index2.html , and the source code for it is here https://github.com/m0ose/jsSketches/tree/master/gpgpuTest .
The first time it tries to run the kernel it uses the compiled shader, and throws an error. Then, it sets the shader to the hand edited one(with the functions in a different order) and it works.
Specifically, I had to change the order of these functions to get it to work, https://github.com/m0ose/jsSketches/blob/master/gpgpuTest/reorganizedFragmentShader.js#L473-L531 .
Here is the original runtime compiled shader for reference, https://github.com/m0ose/jsSketches/blob/master/gpgpuTest/originalFragmentShader.js#L540-L545 .
How important is this (1-5)?
𝜋
Expected behavior (i.e. solution)
I am not sure what is causing this bug. I was not able to extract a smaller example, which might show the problem better. Could it be caused by the function names?
Other Comments
This is an Amazing library.
- 主要语言
- JavaScript
- 星标
- 15.5k
- 派生
- 663
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gpujs/gpu.js 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
-
WebGL backend silently returns all zeros for long-running kernels (no GL error, no context loss)未关闭
难度 5/5 一周以上 新手友好度 42/100
-
难度 5/5 一周以上 新手友好度 20/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
难度 2/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
status: waiting triage
难度 2/5 1-3 小时 新手友好度 84/100
freeCodeCamp/freeCodeCamp#70412 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
rohitg00/ai-engineering-from-scratch#490 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 6 天内回复