Coder Social home page Coder Social logo

Comments (11)

DadSchoorse avatar DadSchoorse commented on July 22, 2024

I am currently working on resolving this issue (see the 2 branch). My plan is:

  1. return non swapchain images to the game
  2. use a graphic pipeline instead of a compute pipeline
  3. use the image that the game writes to as sampled image in the fragment shader
  4. output to the real swapchain image and present it

I still do not know if that solves the sRGB issue though.

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on July 22, 2024

@sigexp An issue with your approach is, that no driver I know of supports sRGB storage images.

from vkbasalt.

doitsujin avatar doitsujin commented on July 22, 2024

I still do not know if that solves the sRGB issue though.

It does, since both images will have sRGB conversion either enabled or enabled. I agree that this is probably the best solution, even if it doesn't allow for the same degree of optimization that you could in theory and with quite a bit of extra work achieve with a compute shader, but the sharpening only has a marginal impact on the overall frame time anyway.

that no driver I know of supports sRGB storage images.

That's why it would have to be implemented manually in a compute shader, but that would make it unnecessarily complicated.

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on July 22, 2024

That's why it would have to be implemented manually in a compute shader, but that would make it unnecessarily complicated.

What type of image would even be written to? As I am understanding it, creating a storage image would be undefined behavior and currently it is just "luck" that there is just no conversion. But could not everything from a crash to just a darker image happen?

from vkbasalt.

doitsujin avatar doitsujin commented on July 22, 2024

You can create a non-sRGB view for an sRGB image, in which case no conversion occurs.

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on July 22, 2024

You can create a non-sRGB view for an sRGB image, in which case no conversion occurs.

And that is defined behavior? Cool I did not know that.

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on July 22, 2024

Ok, my approach kinda works now on NVIDIA, I just need to stop the game from changing the image layout to present on the non swapchain images to get it working on AMD.

from vkbasalt.

doitsujin avatar doitsujin commented on July 22, 2024

Just do a PRESENT_SRC_KHR -> SHADER_READ_ONLY_OPTIMAL layout transition before beginning the render pass.

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on July 22, 2024

Well that would be the easy way, but I think the spec does technically not allow Image layout transitions to present on non swapchain images. But simply replacing PRESENT_SRC_KHR with SHADER_READ_ONLY_OPTIMAL in pipeline barriers and the renderPass creation should be allowed, shouldn't it? Oh and I just wanted to ask if it is okay that I ask you stuff about this project all the time.

from vkbasalt.

doitsujin avatar doitsujin commented on July 22, 2024

But simply replacing PRESENT_SRC_KHR with SHADER_READ_ONLY_OPTIMAL in pipeline barriers and the renderPass creation should be allowed, shouldn't it?

Yes, it is.

Well that would be the easy way, but I think the spec does technically not allow Image layout transitions to present on non swapchain images.

This should be allowed (you can always enable validation layers though to check whether they yell at you). The spec states that the only operation allowed while the image is in PRESENT_SRC_KHR layout is presentation, but this does not disallow subsequent layout transitions, and it does not explicitly state that only swap chain images may be transitioned to this layout.

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on July 22, 2024

I have finished the rewrite, it seems to work on AMD #30 and solves the sRGB issue #18.

from vkbasalt.

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.