Skip to content
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

RenderTexture issues on iOS/macOS #233

Closed
etsek opened this issue Oct 14, 2020 · 5 comments
Closed

RenderTexture issues on iOS/macOS #233

etsek opened this issue Oct 14, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@etsek
Copy link

etsek commented Oct 14, 2020

  • cocos2d-x version:cocos2d-x-4.0
  • devices test on: iOS 14 (iPhone), macOS 10.15.6
  • developing environments
    • NDK version:
    • Xcode version: 12.0, 11.7
    • VS version:
    • browser type and version:

Steps to Reproduce:

  1. Build cpp-tests, run test 41 (Node:RenderTexture)
  2. Try Save Image PMA, Save Image Non-PMA: assertion failure

Image saved image-pma-0.png
Assert failed: reference count should be greater than 0
Assertion failed: (_referenceCount > 0), function release, file /Users/xxxx/xxxx/cocos2d/cocos/base/CCRef.cpp, line 89.

  1. Try Clear to Random, Clear to Transparent: exception raised (EXC_BAD_ACCESS)

RenderTargetMTL::Attachment RenderTargetMTL::getColorAttachment(int index) const
{
if(isDefaultRenderTarget() && index == 0)
return {DeviceMTL::getCurrentDrawable().texture, 0};
auto& rb = this->_color[index];
return RenderTargetMTL::Attachment{static_cast(rb) ? (id)(rb.texture->getHandler()) : nil, rb.level};
}

@halx99 halx99 added the bug Something isn't working label Oct 15, 2020
@halx99 halx99 closed this as completed in 755a0fb Oct 15, 2020
@halx99
Copy link
Collaborator

halx99 commented Oct 15, 2020

thanks, should be fixed by the latest commit

@etsek
Copy link
Author

etsek commented Oct 15, 2020

Thanks, I tested the first issue (save image) and indeed it has been fixed. The second issue however (clear) remains even after Commit 755a0fb. @halx99 can you check please?

@halx99
Copy link
Collaborator

halx99 commented Oct 15, 2020

I will check it later

@halx99 halx99 reopened this Oct 15, 2020
@halx99 halx99 closed this as completed in a397287 Oct 15, 2020
@etsek
Copy link
Author

etsek commented Oct 15, 2020

Clear() works as expected now, thank you!

@halx99
Copy link
Collaborator

halx99 commented Oct 16, 2020

You are welcome, thanks for your report this issue

halx99 added a commit that referenced this issue Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants