Replies: 82 comments 88 replies
-
Yeah even if I manually add the Vulkan includes it doesn't compile. Severity Code Description Project File Line Suppression State |
Beta Was this translation helpful? Give feedback.
-
Hi! Sorry about that, I mostly focused on Rust examples when developing because that's what I'm familiar the most with There was an issue with one of the type names regarding As for the hardcoded "D:" drive includes, you'll have to fix those yourself in Visual Studio Unfortunately I don't have a proper CMake setup for the C++ test project because I was mostly concerned with testing whether the bindings were sound or not rather than usage of the API which I had the Rust examples for. Here is a short snippet you can plug in to an existing D3D11 render loop with the latest commit. libra_d3d11_filter_chain_t create_d3d11_filter_chain(libra_instance_t& instance, const char* path, ID3D11Device* device) {
libra_shader_preset_t preset;
libra_error_t error;
error = instance.preset_create(path, &preset);
if (error != NULL) {
instance.error_print(error);
instance.error_free(&error);
return NULL;
}
libra_d3d11_filter_chain_t filter_chain;
error = instance.d3d11_filter_chain_create(&preset, NULL, device,
&filter_chain);
if (error != NULL) {
instance.error_print(error);
instance.error_free(&error);
return NULL;
}
return filter_chain;
}
void apply_d3d11_filter_chain_to_frame(
libra_instance_t& instance, libra_d3d11_filter_chain_t& filter_chain, size_t frame_count, const ID3D11ShaderResourceView* srv,
const ID3D11RenderTargetView *rtv, uint32_t height, uint32_t width, float_t x, float_t y) {
libra_source_image_d3d11_t input = { srv, height, width };
libra_viewport_t vp = {x, y, height, width};
// can check for error if you want
instance.d3d11_filter_chain_frame(&filter_chain, frame_count, input, vp,
rtv, NULL, NULL);
} Note that at this point in time, while in beta, I recommend you build your own copy of |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into this. I'll try it out. |
Beta Was this translation helpful? Give feedback.
-
No luck. Cannot get this thing to work as a static lib. Severity Code Description Project File Line Suppression State The header doesn't work out of the box, either. It includes Vulkan stuff even if you're specifying D3D11. |
Beta Was this translation helpful? Give feedback.
-
Seeing this when adding this to .cargo/config.toml: libshaderc_sys-d34cdc21cb8ef69a.rlib(compiler.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in liblibrashader_spirv_cross-f96f5a6da73edc39.rlib(wrapper.o) |
Beta Was this translation helpful? Give feedback.
-
And it doesn't work if you use librashader_ld.h, either, because that gets you: Severity Code Description Project File Line Suppression State |
Beta Was this translation helpful? Give feedback.
-
Okay just for the heck of it, I tried letting it load the DLL. Surprise surprise, doesn't work either. libra_instance_t librashader = librashader_load_instance();
Bombs out when falling chain_create. Exception thrown at 0x00007FFA438ECB0E (librashader.dll) in .exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF. |
Beta Was this translation helpful? Give feedback.
-
Should be fixed in 62b0d59. Forgot to apply type renaming fixes to the loader header, since that one is manually written and not generated. To link as a static lib, you shouldn't need to add
|
Beta Was this translation helpful? Give feedback.
-
Are you using the fixed header in 62b0d59 for this? Can you try passing in |
Beta Was this translation helpful? Give feedback.
-
error is 0x000001d8a1958750 when I do it with NULL, but it isn't outright crashing anymore. libra_error_t error = librashader.d3d11_filter_chain_create(&preset, NULL, g_game->m_d3dDevice1.Get(), &chain); |
Beta Was this translation helpful? Give feedback.
-
And libra_d3d11_filter_chain_t chain is 0xcccccccccccccccc. |
Beta Was this translation helpful? Give feedback.
-
That's what I did, and I get the mismatch errors. error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' My project is statically linked, but that .lib is not regardless of whether I mess with the rust flags. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I can look more into this after work.
…On Thu, Jan 26, 2023 at 10:31 AM star69rem ***@***.***> wrote:
To link as a static lib, you shouldn't need to add rustflags = ["-C",
"target-feature=+crt-static"]. Instead you link against librashader.lib,
and you'll have to add that yourself in Visual Studio. This will pull in a
bunch of system linkages that you'll need to resolve as well depending on
your project.
That's what I did, and I get the mismatch errors.
error LNK2038: mismatch detected for 'RuntimeLibrary': value
'MD_DynamicRelease' doesn't match value 'MT_StaticRelease'
My project is statically linked, but that .lib is not regardless of
whether I mess with the rust flags.
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHUIN3HBLDBI7A433J5TIDWUKKGBANCNFSM6AAAAAAUCAO7TQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I just checked, and the only reason it didn't crash with the access violation was when it was called before the d3d device was created. Also note that this is a ComPtr, and I'm getting the pointer with ComPtr Get() if that matters. |
Beta Was this translation helpful? Give feedback.
-
I suspect that it has to do with the library expecting a pointer to the
ComPtr. I’ll have to fix the generated headers to account for that.
…On Thu, Jan 26, 2023 at 11:07 AM star69rem ***@***.***> wrote:
I just checked, and the only reason it didn't crash with the access
violation was when it was called before the d3d device was created. Also
note that this is a ComPtr, and I'm getting the pointer with ComPtr Get()
if that matters.
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHUINZ5MERGYQCVY7KIVBTWUKOMDANCNFSM6AAAAAAUCAO7TQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Those errors show up with Lottes on RetroArch as well if you have the debug layer enabled. It's a problem with the shader, not the runtime. |
Beta Was this translation helpful? Give feedback.
-
Do some of the shaders require a depth stencil view? I'm not creating one. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
zfast capture. |
Beta Was this translation helpful? Give feedback.
-
Re: crashing issue The first thing I can think of that could potentially cause driver crashes on initialization is parallel shader compilation introduced in if you created your D3D11 device with You can disable multithreading there by setting the |
Beta Was this translation helpful? Give feedback.
-
Scalefx seems to be working now too. During fade transitions I see what look like little artifacts but when the image is stable it looks stable. That might just be how it behaves. |
Beta Was this translation helpful? Give feedback.
-
Just wanted to let you know I'm really happy with how Librashader is working now, and performance is pretty good. For comparison, Final Fight in Retroarch with CRT Royale uses ~10% of my GPU @ 60hz. At 4:3 with an internal resolution of 384x224 with CRT Royale through Librashader, my program uses 20% GPU at 144hz. Running CPS games at ultrawide resolutions (692x224) uses about 30% GPU usage at 144hz, which is still playable. I've got an option integrated into the in-game menu for it. https://cdn.discordapp.com/attachments/1011419989246488598/1073147787480420352/image.png |
Beta Was this translation helpful? Give feedback.
-
For frame count, what happens if I let the size_t overflow? If I don't handle it with a comparison to size_max and reset it to 0, will things blow up? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Nevermind the post about the build not working. The last VS2022 upgrade broke my Rust environment. Yay! |
Beta Was this translation helpful? Give feedback.
-
I know you can't possibly be expected to support this scenario, but using the latest RC, Librashader stopped working for a couple of my users who were using a Windows build through Wine. Older versions (that predate CRT Royale working) seemed to work for them in Wine. |
Beta Was this translation helpful? Give feedback.
-
Am being told it doesn't work with proton-ge or wine-ge. |
Beta Was this translation helpful? Give feedback.
-
More reports from users, and apparently it was even breaking in Windows 11 for some people, and the build with runtime-d3d11 fixed it for them as well. So it really isn't just a Wine issue. |
Beta Was this translation helpful? Give feedback.
-
Can you try ./assets/shaders/cubic/b-spline-fast.slangp? I'm not seeing the same output in my program as Retroarch. |
Beta Was this translation helpful? Give feedback.
-
librashader-capi-tests doesn't even compile because it has hardcoded include paths to someone's D drive, and there only seems to be a Vulkan example. I just wanted to test out a D3D11 sample to see whether it was worth torpedoing one of my projects for.
Beta Was this translation helpful? Give feedback.
All reactions