New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory API #477
Merged
Merged
Memory API #477
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nd buffer and assignment logic Next up, prepare details from graphics.defineEffect()
…from Program Slight redesign of TimeTransform with caching (to synchronize multiple invocations with a frame) and slightly less heavyweight call site
Err, was calling Modulo for sine method, heh That said, time transform seems to work in basic test
Fixed error detection for positive number time transform inputs Relaxed amplitude positivity requirement
Maintenance Revert Test
My mistake adding back changes made
This reverts commit 0b5e1e9.
…(should also make the acquire logic a little less confusing) Using interface macros Also made two of them each With and without arguments, that is (for public version and callbacks internally) No check for resize's existence in *OfSize() interface methods, since NullResize would be installed then
Interface is reified when acquiring an interface, not in creation Added dummy interface for failure case
First draft of docs rounded out
Reverted uint16_t to unsigned short in C API
…ack correctly in memory API Simply using void * rather than unsigned char * for byte getter signatures; in practice, was just recasting it again anyhow A few more macros Added references to APIs to be visible to Windows simulator
Added fake variable on Apple
After some review, this will probably need at least another commit. MSVC is okay with the type punning (and I believe GCC is too), but I'm not sure about Clang. That's apparently a bit of a no-no per some of the standards, so should be redone; it might already be fairly |
Shchvova
approved these changes
Jan 24, 2023
…nter (starting with a NULL one, in the second case), rather than a union-based type punning Fixed a couple bad stack indices for environment keys in same (version and data lookups)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a small addition to the C API, and a major refinement of some policies I've been using to share binary data among my own plugins. It's basically in the spirit of a Lua metamethod: one side provides data of some sort, and then the other is able to consume it using that object's "memory interface", but without needing to know the internal details: the object could be a fixed string, a (possibly resizable) userdata of some sort, maybe even a static buffer.
I hammered out this draft before sitting down to code. Some of that's now obsolete, but it has a few examples too.
I did make an earlier attempt at such an API—files here and here—but never got around to testing it, much less submitting; anyhow, this version is much more focused and only adds five functions.
I've tested by building the simulator, overwriting the relevant binaries in the Windows install of Solar, building a modified Bytemap plugin (see this commit) linked to that, and then running a test.
The Bytemap's
SetBytes()
is being called in a few ways already in a test script: once with a blob of data encoded as a string (so it uses the special-case interface for them); another happens indirectly, via aBytemap:loadTexture()
(which will use theByteProxy
seen in that commit). I added a new test for the light userdata policy (also in the commit; 16 integers are encoded and stored in globals):with results:
Nothing in the engine yet uses this, so I figured it would be safe to add the files to the various platforms and get this out there. (It looked like web didn't add
CoronaGraphics.*
, so I also held off adding anything there.) I'll see if I can do some sanity checks on a few of these.Per experience with the graphics APIs with other still-pending PRs, I also added the symbol exports for Windows simulator and Apple targets. If something similar is also needed on Linux, I missed it.
@Shchvova We were discussing ways to enhance meshes and I believe this is at least part of the puzzle (perhaps also the custom objects PRs). Off-hand, there are one or two other Solar APIs that might be able to export to a buffer as well. (To conveniently stuff into a binary archive, for instance.)