Pink screen on MTLCommandBuffer.presentDrawable.

I rewrote my graphics pipeline to use Load/Store better for clearing and don't care cases. All my tests pass, and in the Metal debugger, all the draw calls succeed.

But when I present drawables (before [commandBuffer commit]) I only get a pink screen. I've tried everything I can think of: making sure the pixel formats are the same for the back buffer as my render targets, etc. But it's still pink.

Could you point me in the right direction so I can fix this, or help describe why it's pink. That would be really helpful.

Thank you,

Brian Hapgood

Answered by DTS Engineer in 860574022

Hello,

As my colleague suggests, it would be helpful to see a sample project to reproduce the issue.

However, that's not completely necessary since you can likely debug this yourself using the Metal debugger.

In particular, capture a GPU trace and then look at the dependency viewer. It will show the stage where your rendering pipeline fails.

If you like you can send us a screenshot of the dependency viewer for feedback.

Thanks for your post. I was wondering if you have a way to reproduce the issue.

Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

A focused Xcode project that builds and demonstrates the issue. Ideally this will be a new Xcode project created specifically to demonstrate this issue, and which includes only the minimal code and API necessary to reproduce the issue. This focuses on the important code paths and may require you to perform additional debugging to extract the relevant code. Please do not include any 3rd-party code or frameworks unless they are absolutely required for this targeted test project to run.

We also recommend adding appropriate logging to your focused project. See Technical Note TN2347 - Basic debugging with the NSLog function and the DEBUG preprocessor macro:

https://developer.apple.com/library/content/technotes/tn2347/_index.html

Explicit steps to reproduce the issue. These steps should be everything we need to do to see the issue.

Albert Pascual
  Worldwide Developer Relations.

Hello,

As my colleague suggests, it would be helpful to see a sample project to reproduce the issue.

However, that's not completely necessary since you can likely debug this yourself using the Metal debugger.

In particular, capture a GPU trace and then look at the dependency viewer. It will show the stage where your rendering pipeline fails.

If you like you can send us a screenshot of the dependency viewer for feedback.

Pink screen on MTLCommandBuffer.presentDrawable.
 
 
Q