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

Assert Failure When Running Sample #198

Closed BenjaminGu closed 1 month ago

BenjaminGu commented 1 month ago

When running the sample, the following assert fails:

"Cannot cycle color attachment when load op is LOAD!"

The call stack is as follows:

textdrawing.exe!SDL_GpuBeginRenderPass_REAL(SDL_GpuCommandBuffer commandBuffer, SDL_GpuColorAttachmentInfo colorAttachmentInfos, unsigned int colorAttachmentCount, SDL_GpuDepthStencilAttachmentInfo depthStencilAttachmentInfo) Line 1194 C textdrawing.exe!SDL_GpuBeginRenderPass(SDL_GpuCommandBuffer a, SDL_GpuColorAttachmentInfo b, unsigned int c, SDL_GpuDepthStencilAttachmentInfo d) Line 1121 C textdrawing.exe!cf_apply_shader(CF_Shader shader_handle, CF_Material material_handle) Line 1756 C++ textdrawing.exe!s_draw_report(spritebatch_sprite_t sprites, int count, int texture_w, int texture_h, void udata) Line 387 C++ textdrawing.exe!spritebatch_flush(spritebatch_t sb) Line 1618 C++ textdrawing.exe!cf_render_to(CF_Canvas canvas, bool clear) Line 2369 C++ textdrawing.exe!cf_app_draw_onto_screen(bool clear) Line 516 C++ textdrawing.exe!Cute::app_draw_onto_screen(bool clear) Line 839 C++ textdrawing.exe!main(int argc, char * argv) Line 81 C++

RandyGaul commented 1 month ago

Thanks, there was an SDL_Gpu update that asserts when trying to cycle GPU resources while also specifying load to load previous buffer. I'll see about what to do.

RandyGaul commented 1 month ago

Let me know if this works for you https://github.com/RandyGaul/cute_framework/commit/ec5ef3da8060bbcb3390023e7676112ceec83efe

BenjaminGu commented 1 month ago

Thanks for the fix! I tested commit ec5ef3d, and it works now!