Giter Club home page Giter Club logo

Comments (2)

Malacath-92 avatar Malacath-92 commented on June 21, 2024

Compiling included files is intentional, it allows us to diagnose exactly where an issue occurs without having to do more complicated line mappings. When we added this I was thinking from a C++ programmer's perspective where a scenario that you describe is kinda bad engineering, as your code written in an include suddenly depends on client code. But I don't know if it's common in the graphics world. So I'll add a setting to skip this extra step, but you can expect worse diagnostics if your included files contain errors.

from shader-toy.

zlnimda avatar zlnimda commented on June 21, 2024

Thank you very much for the recent update.

Just a little thing about the "bad engineering" point of view of yours:
I don't know much what's your experience in cpp but I will guess you already used headers and inlines.
You know that in cpp you can use forward declaration which will produce undefined symbols which will be resolved at link.

Sadly in graphics programming, you often have to compile one unit directly to your program and not assemble multiple compile units into one at a link step. That's why using forward declare does not really work in this case, they expect that your compile unit contains no unresolved symbols. Except when all includes are contained into one unit which will be compiled and resolve the forward declaration in that same unit.

You might think this is bad engineering, but it's common engineering to use such forward declaration with definition in multiple compil units. (especially in cpp: all declarations in headers does not have symbols resolved in all compile unit of each cpp file, they are only resolved at link step)

from shader-toy.

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.