Skip to content
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

Add support for runtime uniform variables, using shared memory for cr… #226

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wheaney
Copy link

@wheaney wheaney commented Sep 23, 2023

…oss-process communication

@wheaney
Copy link
Author

wheaney commented Sep 23, 2023

Reshade allows for changing uniform "runtime" variables by declaring custom "add-on" code, essentially a way of incorporating custom code as a C++ reshade plugin. I wanted a way to get the same functionality in a vkBasalt shader (i.e. being able to dynamically change the variables that a shader is working with) without the complicated add-on process.

What I came up with was allowing a shader's uniform variable annotations to specify a file-path and projId -- standard parameters for accessing shared memory using ftok in Linux -- that vkbasalt can use to keep the variables up-to-date; sort of an integration by convention, rather than by API. As a result, the implementation is really simple, and so is the integration.

@wheaney
Copy link
Author

wheaney commented Sep 23, 2023

Here is a working example of a shader I wrote that uses this change.

@wheaney wheaney force-pushed the master branch 3 times, most recently from 64b4161 to f1bf313 Compare September 26, 2023 20:57
@Kazevic
Copy link

Kazevic commented Jul 1, 2024

Hey, can I borrow both your PRs for my repo? As vkBasalt is abandoned, I thought I could maybe do that, as I found some open PRs (like yours) are quite useful and it couldn't hurt to merge them into a more active repo (I won't be able to do anything on my own though, I just reformated some stuff).

@wheaney
Copy link
Author

wheaney commented Jul 1, 2024

@Kazevic Fine by me.

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