Comments (5)
I understand the problem and I've verified a basic fix. I think this warrants doing a bit of cleanup related to how texture binding is handled more broadly, because it's too messy right now and there are probably other subtle issues with how the binding state is tracked. For example, because OpenGL objects are lazily initialized, there could be some other obscure issues where initializing the textures at an unexpected time could override the cached state.
Practically, I think everything needs to go through the OpenGLTextureSamplerManager if it ever touches the texture units. On top of that, the command executor probably needs to flush the resource sets right before a draw call and not assume that the texture units have been undisturbed. That will be more expensive than what I'm currently doing, but it should be fine.
As a mitigation, I these "one-off texture usages" should bind to the upper-most texture units that are available, because those are extremely unlikely to be in use. Doing so would avoid any real conflicts 99% of the time.
from veldrid.
@SomeAnon42 I have a fix here: 4e25323.
I'm going to run a few more tests on it on different platforms before merging it into master, but I think it is mostly correct.
from veldrid.
@SomeAnon42 Are you able to test out whether your scenario is fixed by the change? I did add a regression test that should match what you were seeing: https://github.com/mellinoe/veldrid/blob/4e25323875ec2b96070aad596c4d89601c8d9883/src/Veldrid.Tests/RenderTests.cs#L425
from veldrid.
Yes, everything is fine now.
from veldrid.
@SomeAnon42 Awesome, thanks for the report and the testing.
from veldrid.
Related Issues (20)
- Destroying a texture after GraphicsDevice.UpdateTexture
- Veldrid fails to build on iOS HOT 1
- MacOS Exception Error In VeldridStartup.CreateWindow HOT 2
- DisposeWhenIdle() never disposes
- Unable to find entry point named "objc_msgSend_stret" in shared library '/usr/lib/libobjc.A.dylib For Apple Silicon Based Macs HOT 8
- Next Release HOT 3
- NeoDemo fails on nVidia hardware (Pop_OS 22.04)
- Need to get to underlying ID3D11Texture2D pointer from a Veldrid texture... how? HOT 1
- Exception while creating graphics device on Windows
- Is veldrid still maintained? ? ? HOT 1
- Trying to make an ImageViewer using (Dear) ImGui NET: Veldrid.VeldridException: Unable to get image pixelspan. on huge images
- Game console support? HOT 3
- Direct3D11 creates garbage
- Question - Trilinear image scaling (ImGui)... how? HOT 3
- Convert EmguCV UMat/Mat to ImageSharpTexture
- Exceptions while trying to use Veldrid to make a VST UI HOT 2
- Release build crashes with mesa 23.1.x, 23.0.x is fine.
- [D3D11] Use FlipSequential instead of Discard on Win8+? HOT 3
- Copy staging texture to 8xSampled target, error not compatible textures
- NeoDemo Metal doesn't work on Intel Macbook HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from veldrid.