RandyGaul / cute_framework

The *cutest* framework out there for creating 2D games in C++!
https://randygaul.github.io/cute_framework/#/
Other
534 stars 31 forks source link

Check support for texture format #207

Closed pusewicz closed 1 month ago

pusewicz commented 1 month ago

Similarly to https://github.com/cocos2d/cocos2d-x/pull/19774/files, we default to CF_PIXEL_FORMAT_D32_FLOAT_S8_UINT and set it to CF_PIXEL_FORMAT_D24_UNORM_S8_UINT if it's supported.

pusewicz commented 1 month ago

This needs some more work:


-[MTLDebugRenderCommandEncoder setRenderPipelineState:]:1615: failed assertion `Set Render Pipeline State Validation
For stencil attachment, the render pipeline's pixelFormat (MTLPixelFormatInvalid) does not match the framebuffer's pixelFormat (MTLPixelFormatDepth32Float_Stencil8).
RandyGaul commented 1 month ago

Looks good so far. Not sure why the depth format of a pipeline doesn't match. The depth format is supposed to get copied over here: https://github.com/RandyGaul/cute_framework/blob/master/src/cute_graphics.cpp#L1651

pusewicz commented 1 month ago

It raises here: https://github.com/RandyGaul/cute_framework/blob/master/src/cute_graphics.cpp#L1793

RandyGaul commented 1 month ago

Yep so it's a matter of debugging to see where the different depth formats are set. If you need help debugging let me know, or if you're stuck I can also look into it and solve it. Thanks so much for the help!

pusewicz commented 1 month ago

@RandyGaul It turns out, this branch works just fine. I applied the same branch again, on a fresh clone of Cute and it works as expected. Must have been a cache issue when building via XCode.

Screenshot 2024-09-02 at 19 42 32