Skip to content

Commit

Permalink
Merge #2175
Browse files Browse the repository at this point in the history
2175: mtl: Use pointers for temporary state r=kvark a=grovesNL

Partially fix to #2161
PR checklist:
- [ ] `make` succeeds (on *nix)
- [ ] `make reftests` succeeds
- [ ] tested examples with the following backends:

This replaces buffer/texture/sampler object usage with pointers instead. This allows us to bypass Objective-C's reference counting (i.e. retain/release). The idea is to create the same objects as before, but purposely leak them and acquire a pointer to them instead. When we're finished with the objects, we take back ownership and release as usual. We should be able to do this either through `drop` on the owning struct, or through relevant `destroy_*` functions.

Still heavily WIP (but works with quad/Dota 2) because there are a few places that will cause leaks or use-after-free in its current state (need to fix cases where the same image is returned for an image view, verify `drop` exists on all the correct owners, etc.)

Co-authored-by: Joshua Groves <josh@joshgroves.com>
  • Loading branch information
bors[bot] and grovesNL committed Jun 25, 2018
2 parents 4306768 + a6cb5a0 commit 6cb2a80
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 206 deletions.
Loading

0 comments on commit 6cb2a80

Please sign in to comment.