GithubHelp home page GithubHelp logo

Comments (5)

tangent-vector-personal avatar tangent-vector-personal commented on June 22, 2024

Where is the user definition? Is if in a Slang file or user code?

from slang.

nbentyNV avatar nbentyNV commented on June 22, 2024

User code. I'm using #import

from slang.

tangent-vector-personal avatar tangent-vector-personal commented on June 22, 2024

The fact that we aren't emitting a definition in user code is worrying: we are supposed to emit those unconditionally.

My best theory right now is that the semantic checking is deciding the user definition is a redeclaration, but in that case we should still emit whatever redeclaration has a body.

from slang.

tangent-vector-personal avatar tangent-vector-personal commented on June 22, 2024

My understanding is that this issue has been worked around in the original codbase.

I don't think this is something Slang should support long-term (interfaces and generics should cover most of what we want), so I'd like to close this as a "will not fix" if possible.

from slang.

tangent-vector avatar tangent-vector commented on June 22, 2024

Closing this as "will not fix." We will not support the case of a Slang file declaring a function that then gets defined in user HLSL or GLSL.

The basic rules of Slang will be:

  • A Slang "module" (one or more .slang files that get compiled as a unit) can explicitly depend on another module via import, but these can only be other Slang modules.

  • An HLSL/GLSL module (one translation unit_ can explicitly depend on Slang modules, via import

  • Any dependencies in the other direction ("I want this library code to call my code") need to be expressed as explicit parameterization (e.g., a library function takes a parameter of interface type, and the client passes in an instance which implements its members).

from slang.

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.