Skip to content

Fix shader cleanup only affecting pipeline#48

Merged
morew4rd merged 1 commit intolyte2d:mainfrom
Zorbn:fix-shader-cleanup
Jan 18, 2024
Merged

Fix shader cleanup only affecting pipeline#48
morew4rd merged 1 commit intolyte2d:mainfrom
Zorbn:fix-shader-cleanup

Conversation

@Zorbn
Copy link
Contributor

@Zorbn Zorbn commented Jan 18, 2024

Sokol GP creates an internal shader when you call its make pipeline function but doesn't expose it to the user so you can never destroy it. This PR fixes that. The changes to Sokol GP could probably be upstreamed.

@morew4rd morew4rd merged commit fa3b3a5 into lyte2d:main Jan 18, 2024
@morew4rd
Copy link
Collaborator

🙏

morew4rd added a commit that referenced this pull request Feb 4, 2024
* fix #39

* gitattributes file, to handle crlf better

https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

* Normalize all the line endings

* fix memory issues

- __gc was not correctly set (found and fix provided by Zorbn)
- with that fixed, resources in use but not referenced can cause read after free issues. these are:
    - play_music
    - set_shader
    - set_font
    - set_canvas
  these now save a reference to the object to prevent premature collection. (previously done in C API)

* remove 'lyte/api/defs/output' folder as it gets unnecessarily chatty with the commits

* Fix shader cleanup only affecting pipeline (#48)

* update sokol_gp to v0.4.1 which fixes the shader leak

* image drawing extensions. fixes #45

functions are extended to support angle/scale_x/scale_y etc.

* fix manual code: draw_image, repeated angle

* lyte.get_textinput() api. progress towards #44

* lyte.get_textinput() api. progress towards #44 (take 2)

* utf8.*

- full lua 5.3 utf.* functionalilty
- some extras

used: https://github.com/starwing/luautf8/

* fix build issues

* get_pressed_keys() api. fixes #50

* image drawing functions: swap order of origin and scale params

---------

Co-authored-by: Zorbn <70043176+Zorbn@users.noreply.github.com>
@morew4rd morew4rd mentioned this pull request Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants