We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Rasterizer is doing an unsafe data access operation that results in a race:
================== WARNING: DATA RACE Write at 0x00c0003012f0 by goroutine 8: github.com/fogleman/fauxgl.(*Context).rasterize() external/com_github_fogleman_fauxgl/context.go:252 +0x109c github.com/fogleman/fauxgl.(*Context).drawClippedTriangle() external/com_github_fogleman_fauxgl/context.go:347 +0xa49 github.com/fogleman/fauxgl.(*Context).DrawTriangle() external/com_github_fogleman_fauxgl/context.go:387 +0x924 github.com/fogleman/fauxgl.(*Context).DrawTriangles.func1() external/com_github_fogleman_fauxgl/context.go:421 +0xda github.com/fogleman/fauxgl.(*Context).DrawTriangles·dwrap·3() external/com_github_fogleman_fauxgl/context.go:426 +0x47 Previous read at 0x00c0003012f0 by goroutine 15: github.com/fogleman/fauxgl.(*Context).rasterize() external/com_github_fogleman_fauxgl/context.go:232 +0x99c github.com/fogleman/fauxgl.(*Context).drawClippedTriangle() external/com_github_fogleman_fauxgl/context.go:347 +0xa49 github.com/fogleman/fauxgl.(*Context).DrawTriangle() external/com_github_fogleman_fauxgl/context.go:387 +0x924 github.com/fogleman/fauxgl.(*Context).DrawTriangles.func1() external/com_github_fogleman_fauxgl/context.go:421 +0xda github.com/fogleman/fauxgl.(*Context).DrawTriangles·dwrap·3() external/com_github_fogleman_fauxgl/context.go:426 +0x47 Goroutine 8 (running) created at: github.com/fogleman/fauxgl.(*Context).DrawTriangles() external/com_github_fogleman_fauxgl/context.go:417 +0x7b github.com/fogleman/fauxgl.(*Context).DrawMesh() external/com_github_fogleman_fauxgl/context.go:436 +0x54 <skipped>
The code in question even has a comment:
if dc.ReadDepth && bz > dc.DepthBuffer[i] { // safe w/out lock? continue }
I think, a sync.RWMutex around accesses to DepthBuffer would fix it.
sync.RWMutex
The text was updated successfully, but these errors were encountered:
Acquire a lock in early depth buffer check. Fixes fogleman#21
1c920d2
No branches or pull requests
Rasterizer is doing an unsafe data access operation that results in a race:
The code in question even has a comment:
I think, a
sync.RWMutex
around accesses to DepthBuffer would fix it.The text was updated successfully, but these errors were encountered: