GithubHelp home page GithubHelp logo

Comments (8)

spencer-lunarg avatar spencer-lunarg commented on July 17, 2024
#version 450
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable
#extension GL_EXT_shader_image_int64 : enable
layout(set = 0, binding = 0) buffer ssbo { uint64_t y; };
layout(set = 0, binding = 1, r64ui) uniform u64image2D z;
void main() {
    y = imageAtomicAdd(z, ivec2(1, 1), y);
}

will currently show

accessed: 1

but I can see how having a "type of access" flag to list if it was atomic could be helpful

Seems like something I could take a crack at

from spirv-reflect.

mbechard avatar mbechard commented on July 17, 2024

That would be amazing. A related request is this:
#99
where it would be useful to know if the resource is used via a read and/or a write operation. This would allow more finely controlling the VkAccessFlags used on the resource before it's used.

from spirv-reflect.

spencer-lunarg avatar spencer-lunarg commented on July 17, 2024

@mbechard I have an implementation of this in #224 (which I still need to invest more time before I feel comfortable merging it)

I would love feedback on it if you think it works as expected for your use case

from spirv-reflect.

mbechard avatar mbechard commented on July 17, 2024

Thanks! This looks great. Seems to work with a simple test case. Offhand I would expect the READ/WRITE flags to also be set when ATOMIC is set though. It allows for logic that is just looking if a resource is read or written to handle those flags regardless of if the operation happens to be atomic or not

from spirv-reflect.

spencer-lunarg avatar spencer-lunarg commented on July 17, 2024

I would expect the READ/WRITE flags to also be set when ATOMIC is set though

I wasn't 100% if it made sense to have it do that or not... I think you are right and would be easier to just have to check for READ then READ or ATOMIC

from spirv-reflect.

chaoticbob avatar chaoticbob commented on July 17, 2024

I finally had some time to look at #224 .

I wanted to get a better understanding of what the purpose of the READ/WRITE flags are?

If the the READ/WRITE flag is to indicate if a descriptor binding is READ_ONLY or READ_WRITE, then having SPV_REFLECT_RESOURCE_FLAG_UAV set on SpvReflectDescriptorBinding::resource_type will indicate that it's READ_WRITE - otherwise is is READ_ONLY.

from spirv-reflect.

spencer-lunarg avatar spencer-lunarg commented on July 17, 2024

something else worth noting from my PR, something like

 %ac = OpAccessChain %ptr %index
 %14 = OpArrayLength %uint %ac 1

I am not sure if this is actually a "read" (seems it isn't from the spec) but currently this is marked as "accessed"

edit: this is a bug, OpArrayLength is an access (https://gitlab.khronos.org/vulkan/vulkan/-/issues/3682)

from spirv-reflect.

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.