corona icon indicating copy to clipboard operation
corona copied to clipboard

Mac Simulator: TextureResource Canvas rendering problem on MacBook Pro 2017 & 2018

Open labolado opened this issue 3 years ago • 3 comments

Describe the bug TextureResource Canvas rendering problem on MacBook Pro 2017 & 2018.

To Reproduce Steps to reproduce the behavior:

local tex = graphics.newTexture( { type="canvas", width=128, height=128 } )

local rect = display.newImageRect(
    tex.filename,   
    tex.baseDir,   
    display.contentWidth,
    display.contentHeight
)
rect.x = display.contentCenterX
rect.y = display.contentCenterY
 
local circ = display.newCircle( 0, 0, 64 )
circ:setFillColor( { type="gradient", color1={0,0.2,1}, color2={0.8,0.8,0.8}, direction="down" } )
tex:draw( circ )
 
tex:invalidate()

Run the code with Corona Simulator on MacBook Pro 2017 or 2018, and the result will be: image but the correct result should be:

image

Target platform and where build was made:

  • Device: MacBook Pro 2017 & 2018.
  • OS: macOS Big Sur

Additional context This problem only occurs on the simulator. If I build & run it with Xcode iPhone simulator, the problem will not occur.

more info: https://forums.solar2d.com/t/textureresourcecanvas-rendering-problem/353274/4

labolado avatar Jan 11 '22 02:01 labolado

Is it possible to use metal instead of OpenGL in the simulator to avoid this problem?

labolado avatar May 19 '22 09:05 labolado

Using metal on macOS is ongoing project, which has high priority. It should fix this.

Shchvova avatar May 19 '22 09:05 Shchvova

I have a 2018 MacBookPro and when using three TextureResource Canvases am getting a hard crash that shuts my mac down. Drawing to one is fine, but drawing to a second in the same frame causes flickering and glitches, and if left for too long the computer hard resets.

I was noticing Solar2D shutdown with the message starting GPU Hang in some cases before this.

personalnadir avatar Jul 12 '22 20:07 personalnadir