• LalSalaamComrade@lemmy.ml
      link
      fedilink
      English
      arrow-up
      10
      ·
      edit-2
      8 months ago

      Printing a gradient triangle using C, in OpenGL, takes about a few 100-130 lines - it could be lesser, I think. In Vulkan, it takes about a thousand lines.

      Source: I wrote a “simple” gradient triangle in Vulkan, using C during my free time. Created the gradient triangle in C as a part of my university coursework.

      • kingthrillgore@lemmy.ml
        link
        fedilink
        arrow-up
        5
        ·
        8 months ago

        It takes 75 lines to draw a blank window. It takes like three in CoreAnimation in macOS. We really need an OSS take on CoreAnimation but I’m also fine leaving the graphics work to a game engine.

    • Ansis@iusearchlinux.fyi
      link
      fedilink
      arrow-up
      8
      ·
      8 months ago

      Lower level means you have more control over the small details. However, that also means that you have to reimplement some things from scratch, while higher level frameworks do those things for you.

        • teawrecks@sopuli.xyz
          link
          fedilink
          arrow-up
          4
          ·
          8 months ago

          I think you are confused about the difference between the opengl spec and an actual implementation of the spec, and who is responsible for shipping what.

          • Nvidia ships their own opengl implementation with their drivers, because that’s what a driver is.
          • Microsoft doesn’t ship “opengl binaries”, they don’t have any hardware. Maybe you mean they published their own fork of the ogl spec before giving up and making DX? That may be true.
          • Mantle predates DX12, both vulkan and dx12 took inspiration from it, not the other way around.
          • There are two interpretations being thrown around for “low level”:
            • The more traditional meaning is “how far are you from natively talking to hardware?” which is not determined by the rendering API, but the specific implementation. Ex. Nvidia’s dx9 driver is equally “low level” as their DX12 driver, in that the API calls you make are 1 step away from sending commands directly to GPU hardware. Meanwhile, using DX12 via DXVK would be 2 steps away from hardware, which is “higher level” than just using Nvidia’s DX9 implementation directly. Again, “level” is not determined by the API.
            • the other interpretation is what I would call “granularity” or “terse-ness” of the API, i.e. how much control over the hardware does it expose. In this case, yes, dx12 and vulkan give finer control over the hardware vs dx9 and ogl.
          • your last statement…doesn’t make sense, I don’t understand it. Maybe you’re trying to say that DX12/VK are made to be thinner, with less internal state tracking and less overhead per call, and therefore now all that state tracking is the app’s responsibility? Yes, that is true. But I wouldn’t say that code is “specific to a GPU”.
            • teawrecks@sopuli.xyz
              link
              fedilink
              arrow-up
              1
              ·
              8 months ago

              So, here’s the thing, I don’t consider myself an expert in many things, but this subject is literally my day job, and it’s possibly the only thing I do consider myself an expert in. And I’m telling you, you are confused and I would gladly help clear it up if you’ll allow me.

              They could do what AMD does on Linux and rely on the openGL upstream implementation from Mesa

              Nvidia’s OGL driver is a driver. Mesa’s radv backend is a driver. Nouveau, the open source Nvidia meds backend is a driver. An opengl implementation does a driver make.

              There was a time they did, yes

              What GPU did Microsoft’s driver target? Or are you referring to a software implementation?

              Yes and No… DirectX 3D was always low-level

              You literally said that Mantle was inspired by DX12, which is false. You can try to pivot to regurgitating more Mantle history, but I’m just saying…

              No its not, see above…

              Yes, it is, see above my disambiguation of the term “low-level”. The entire programming community has always used the term to refer to how far “above the metal” you are, not how granular an API is. The first party DX9 and DX12 drivers are equally “low-level”, take it from someone who literally wrote them for a living. The APIs themselves function very differently to give finer control over the API, and many news outlets and forums full of confused information (like this one) like to infer that that means it’s “lower level”.

              Your last statement doesn’t make sense, so I don’t know how to correct it.

                • Vik@lemmy.world
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  edit-2
                  8 months ago

                  This is confusing. There are kernel and user space drivers. For example, amdgpu is the kernel driver (inclusive of KMD, DAL & several other functions like powerplay), RadeonSI / RADV / AMDVLK / OGLP (amdgpu-pro) are UMDs for 3D GFX API implementations.

                  Mantle was not inspired by DX at its time. It was designed as an alternative to OGL and d3d11.