-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Driver: Web - "fyne serve" GOOS = Windows #3161
Comments
Hum, indeed, gopherks does not support Windows for building. You can work around this by disabling gopherjs and use You could also use fyne-cross new web target to build the web site which include gopherjs by using docker/podman. |
The only error that matter here is the getAttribLocation. I hadn't seen that before using your branch for rounded corner. I will have to dig further to understand what is going on, but is it possible that a shader compilation failed or something given to that getAttribLocation call that actually come from a failed call. |
Thank you for the information! I will try to find the issue too. |
I will try testing your PR tomorrow afternoon and let you know. Cool work! |
Sorry it took me time to come back to your PR. I am still having trouble with it after fixing the crash you got above. I have created a PR that solve this problem : fyne-io/gl-js#9 . Weirdness of JS... After this I get a lot of:
|
(you will need to do a go mod edit -replace until that PR land along with go mod vendor until that PR land) |
Rendering on WebGL (GL ES) works now. func (p *painter) drawTextureWithDetails(o fyne.CanvasObject, creator func(canvasObject fyne.CanvasObject) Texture,
pos fyne.Position, size, frame fyne.Size, fill canvas.ImageFill, alpha float32, pad float32) {
(...)
p.defineVertexArray(p.program, "vert", 3, 5, 0)
p.defineVertexArray(p.program, "vertTexCoord", 2, 5, 3)
}
func (p *painter) drawLine(line *canvas.Line, pos fyne.Position, frame fyne.Size) {
(...)
p.defineVertexArray(p.lineProgram, "vert", 2, 4, 0)
p.defineVertexArray(p.lineProgram, "normal", 2, 4, 2)
}
func (p *painter) drawRectangle(rect *canvas.Rectangle, pos fyne.Position, frame fyne.Size) {
points := p.flexRectCoords(pos, rect, 0.5, frame)
p.ctx.UseProgram(p.rectangleProgram)
vbo := p.createBuffer(points)
p.defineVertexArray(p.rectangleProgram, "vert", 2, 7, 0)
p.defineVertexArray(p.rectangleProgram, "normal", 2, 7, 2)
p.defineVertexArray(p.rectangleProgram, "colorSwitch", 1, 7, 4)
p.defineVertexArray(p.rectangleProgram, "lineWidth", 1, 7, 5)
p.defineVertexArray(p.rectangleProgram, "feather", 1, 7, 6)
} Solution: p.ctx.DrawArrays(triangles, 0, triangleXYPoints)
p.ctx.DisableVertexAttribArray(p.ctx.GetAttribLocation(p.rectangleProgram, "colorSwitch"))
p.ctx.DisableVertexAttribArray(p.ctx.GetAttribLocation(p.rectangleProgram, "lineWidth"))
p.ctx.DisableVertexAttribArray(p.ctx.GetAttribLocation(p.rectangleProgram, "feather")) #2803 |
Thanks for all this work. Your point about performance is interesting and likely not just affecting the web driver. Would you mind opening a separate issue to track it? |
Yes, I will open a separate issue. |
The main reason we are supporting gopherjs is that it is the only solution for Chrome based browser at this point as they do exhibit a bug with their optimizer and webassembly. In term of performance, I have only felt marginal difference between the two solutions (We do not have a benchmark at the moment that would be useful for this case). So in production, you would need to deploy both wasm and gopherjs, but during testing you could just use wasm and rely on firefox. |
I still need to add a proper warning for the case where the host platform is windows. |
@Bluebugs is the warning added already? This would be a good time as we plan for the next release. |
This is now covered in develop. |
Checklist
Describe the bug
I tried to execute the fyne_demo with "fyne serve" but got following message:
GOOS is not supported, the supported GOOS values are linux and darwin. The GopherJS is falling back to GOOS=linux
panic: open c:\go\src\runtime/fastrand.go: open /\src\runtime/fastrand.go: file does not exist
Does this mean that development of a web version is only possible on Linux and MacOS?
How to reproduce
on Windows
Screenshots
No response
Example code
...
Fyne version
2.2.2
Go compiler version
1.17
Operating system
Windows
Operating system version
Windows 10
Additional Information
--
The text was updated successfully, but these errors were encountered: