-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
kinc_g4_texture_lock() returns null for RGBA128 textures #623
Comments
It's indeed only for compute currently (or more specifically for UAVs). Kinc needs some explicit options for that - in the meantime you can just change the D3D11_TEXTURE2D_DESC to the same values as in the else branch and remove the if-block at the end of the function to make it work. PS: When something doesn't work, please run a debug-build. In this specific case it would have triggered an assert and printed an error message. |
Thanks a lot, I will definitely test this as soon as I'm continuing my work on the project I had this issue with.
I was a bit imprecise. What I meant is that if there is no way to write to RGBA128 textures there is probably no easy way in Kha to write floats to a texture (for LUTs for example)? It looks like there is also a grayscale 32 bit float format but that would require multiple samples for reading 3 or 4 floats in the shader if they would otherwise be accessible by sampling just one texel. Or is this irrelevant in terms of performance?
Thanks, that's good to know (I didn't even realize that I was using release mode). |
Describe the bug
Original issue: https://github.com/armory3d/armorcore/issues/17. When locking an RGBA128 texture in Kha/Krom on d3d11, the application crashes. The reason for this seems to be that
kinc_g4_texture_lock()
returns null when using the RGBA128 format (that's why I'm opening the issue in this repo).To Reproduce
Minimal example code for Kha:
This is the stack trace (the screenshot was made for the original Armorcore issue in March but the problem persists):

In the original issue I also mentioned that it looks like RGBA128 is reserved for compute shaders only (source) and that the CPU might not able to write to the data. I wonder how floats should be written into textures then if the minimum floating point size in Haxe is 32 bit (kha.FastFloat)?
I know about
kha.Image.fromBytes()
but I need to change data in the texture on each frame and a full re-creation of the texture is too slow.Expected behavior
The application shouldn't crash and allow access to write 32 bit floats to a buffer.
Execution Environment:
The text was updated successfully, but these errors were encountered: