Code Monkey home page Code Monkey logo

Comments (5)

mellinoe avatar mellinoe commented on June 1, 2024

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.

mellinoe avatar mellinoe commented on June 1, 2024

@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.

mellinoe avatar mellinoe commented on June 1, 2024

@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.

SomeAnonDev avatar SomeAnonDev commented on June 1, 2024

Yes, everything is fine now.

from veldrid.

mellinoe avatar mellinoe commented on June 1, 2024

@SomeAnon42 Awesome, thanks for the report and the testing.

from veldrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.