GithubHelp home page GithubHelp logo

Comments (2)

supervacuus avatar supervacuus commented on July 18, 2024 1

Hi, I had a brief look into this and wondered whether to fix it by adding signed/unsigned integer literals to the parser. Right now, the parser discards the sign of the tracked type when parsing literals:

https://github.com/gfx-rs/rspirv/blob/master/rspirv/binary/parser.rs#L312-L318

Generating signed integer literals at this point and correctly applying them throughout the code would fix this issue. The integer literals are already a specialization away from SPIRV's JSON grammar, so I don't think this change would break with spec. But introducing/changing literals might affect the parser's contracts to other code. If that direction sounds right, I can create a PR with my changes.

from rspirv.

supervacuus avatar supervacuus commented on July 18, 2024

I've added a PR which only touches the disassembler. Modifying the parser as proposed above will break client code, if it expects matches on LiteralIntXX to mean all (= signed + unsigned) integer literals in the binary.

If breaking client code is okay for the convenience of no longer needing to track OpTypeInt, then I can create a very drafty alternative PR. But reading through your other issues, it might make more sense to handle this in SR rather than DR.

from rspirv.

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.