Hacker News new | past | comments | ask | show | jobs | submit | nicebyte's comments login

this really does not belong on the front page of hn

> One with tools more powerful, elegant, and accessible: Linux.

triple ha


vulkan is already supported on windows as a first-class citizen by all major IHVs. I am not sure what this "adoption" you speak would entail. If you're talking about replacing d3d12, that actually is a terrible idea.


That's not really the same as being supported by Windows. I think that's 3rd party support and not built into the OS.


what do you mean when you say "built into the os"? d3d12 is just an api. the d3d runtime is user-space, both the UMD that wraps it and the KMD are supplied by the hardware vendor. In the end, both a d3d app and a vulkan app end up talking to the very same KMD. See here for reference:

https://learn.microsoft.com/en-us/windows-hardware/drivers/d...


D3D is clearly more integrated into the OS than Vulkan is.

Most importantly, Windows includes a software D3D renderer (WARP) so apps can depend on it always being present (even if the performance isn’t spectacular). There are lots of situations where Vulkan isn’t present on Windows, for example a Remote Desktop/terminal server session, or machines with old/low-end video cards. These might not be important for AAA games, but for normal applications they are.

Another example: Windows doesn’t include the Vulkan loader (vulkan-1.dll), apps need to bundle/install that.


> D3D is clearly more integrated into the OS than Vulkan is.

sure, but addressing the two points that you brought up would not entail changing windows _the operating system_, just the stuff that ships with it. you could easily ship swift shader along with warp and the loader library, both of those are just some application libraries as far as the os/kernel is concerned. of course now we're in the territory of arguing about "what constitutes an OS" :-)


Oh, I was under the impression that Direct X 12 was built-in for Windows like Metal is on Apple.


If you're talking about replacing d3d12, that actually is a terrible idea.

Why do you say that?


I say this because vulkan is hamstrung by being an "open API" intended to run on a very wide range of devices including mobiles. this has major repercussions, like the awkward descriptor set binding model (whereas d3d12's descriptor heaps are both easier to deal with and map better to the actual hardware that d3d12 is intended to run on, see e.g. https://www.gfxstrand.net/faith/blog/2022/08/descriptors-are...). overall d3d has the benefit of a narrower scope.

Another problem with being an open API is that (and this is my own speculation) it's easier for IHVs to collaborate with just Microsoft to move faster and hammer out the APIs for upcoming novel features like work graphs for example, vs bringing it into the public working group and "showing their cards" so to speak. This is probably why vk gets all new shiny stuff like rtrt, mesh shaders etc. only after it has been in d3d for a while.

One could argue this is all solvable by "just" adding a torrent of extensions to vulkan but it's really not clear to me what that path offers vs d3d.


I would guess that if DX didn't exist the iteration on VK side would just be faster. Through extensions, like you've mentioned.

In the end it might have even speed up the adoption of such features. Currently if you have a multiplatform engine, even though windows is like 99% of your PC player base it's still sometimes a tough decision to just use a feature that you can't support on all your targets.


The downside is that it ties them incredibly heavily to Microsoft, and makes cross-platform efforts much harder.


Does that support extend to ARM? Not sure if it's still the case, but I recall that early Windows on ARM devices didn't have native Vulkan (and I believe OpenGL was translated to DirectX via ANGLE).


I haven't laid my hands on any ARM windows devices so I wouldn't be able to tell you. I'd be somewhat surprised if the newer snapdragon stuff doesn't have vulkan support because qcom supports vulkan first-class on its gpus. in fact, on newer android devices OpenGL support might already be implemented on top of vulkan, but don't quote me on that.


LunarG released a native ARM version of the Vulkan SDK shortly after the Snapdragon X machines launched so presumably it works on those.

edit: yup https://vulkan.gpuinfo.org/listreports.php?devicename=Micros...


> ("software" means it runs on the CPU instead of GPU)

no, in this context it means that the rasterisation algorithm is implemented in a compute kernel, rather than using the fixed hw built into the gpu. so rasterization still happens on the gpu, just using programmable blocks.


Take it from someone who has worked on android dev tools - yes.


c++ isn't memory safe and will probably never be. that being said, it's not more or less possible to create an efficient browser engine for multicore systems with c++ than any other language. programming language is not the thing that makes the task difficult.


As I said, I'm pretty out of practice, but doesn't stuff like unique_ptr give you a lot of memory-safe features out of the box?


Not really, no


Let it burn.

> If the summer blockbuster season is ever to recover, it's going to require some blue-sky thinking.

Yeah, revolutionary thinking like: stop producing recycled content slop, lower the budgets, make original films not based on pre-existing IPs. Maybe even try some relatable human-scale stories instead of wannabe grandiose "save the galaxy" type stuff.

I can't believe a human being with a pulse can sit through a superhero movie. The way those things are constructed, their "nutritional value", is worse than run-of-the-mill degenerate isekai harem anime, expect the latter costs a lot less to make and wastes less human potential.


I'd be very surprised if they were actually using geometry shaders (at least this conclusion can't be drawn from their post). Geom shaders are basically dead weight, a holdover from a bygone time, and are better avoided for modern renderers.

The techniques they're drawing on mentioned in the post - parallax mapping, shell mapping - do not generate explicit geometry, rather they rely on raymarching through heightfields in the frag shader. It's more likely that they're doing something like that.


Err, right, they're doing the transformations CPU-side. The blog hints that it's related to shell maps, so maybe the new mesh geometry is densest on the sharp edges?


Parallax mapping breaks on the edges of polygons though, while this technique seems to actually add geometry since the edges of surfaces are appropriately detailed and bumpy.


they're not. they're saying "if we had constructors in c, we'd need a mechanism to allow multiple constructors for the same type". in c++ function overloading and mangling are used to get that, but it's far from the only way something like that could be achieved. imo that whole part could be removed, it's like a little distraction and doesn't really have anything to do with the core of their argument.


thanks! appreciate the reply


I respect Jean-Heyd very much, but I'm unconvinced by this article. First, the whole name mangling discussion is completely irrelevant to the issue and can be omitted. Second, one could tack on both copy and move constructors on to C in order to solve the double-free issue, in much the same way regular ctors are tacked on in the email proposal. In fact, I would argue that it is _necessary_ because A in RAII stands for Acquisition not Allocation. "Acquisition" implies ownership, which can be transferred or shared, so your copies and moves _have_ to have a special meaning to them. The fact that the proposal is bad or incomplete does not mean that it is "impossible" to have RAII in C. I don't claim that it _is_, but reading this did not reveal to me anything fundamental that would preclude RAII, only that all the preceding RAII proposals have been sloppy.


I found the arguments compelling. The discussion on "Effective types" and C not having a proper concept of objects is key.

Another way to think about it: even if you had defined constructors and destructors for a struct, you have not solved when to call them. C++'s answer to that question is its sophisticated object model. C does not have one, and in order to answer that question, it must. It's worth noting that RAII was not a feature that was intentionally created in C++. Rather, astute early C++ developers realized it was a useful idiom made possible by C++'s object model.


You say "just add copy and move contructors", but that requires function overloading, which is exactly why he spent a third of the article ranting about name mangling. The point is that there is a tangled network of interdependent features that make C++ work, and you can't ""just"" take a small piece to put into C without dragging a whole bunch of other stuff along.


No it does not. You can absolutely add copy and move ctors without function overloading.


Yes, it meanders to much to get to the point. Which is that RAII doesn't work in C because unlike C++, which has a comprehensive type system mandated by a standard, a C program doesn't "know" at runtime that a struct is composed of other (typed) fields so it can do a proper deep field copy (or destruction). And implementing that type system in C doesn't seem feasible for practical and political reasons.

I think the actual question should be "can C get automatic memory management like in C++ without having the equivalent of C++'s type system"?

Though I can't put my finger on it, my intuition says it can, if the interested people are willing to look deep enough.


> a C program doesn't "know" at runtime that a struct is composed of other (typed) fields so it can do a proper deep field copy (or destruction).

This doesn’t make sense: you don’t need runtime introspection to do this?


In C++, when you copy a struct instance to another instance, the runtime knows if any fields (to whatever depth) have manually defined assignment or move operators and will call them in the proper order. So it's a deep copy. The same information is used for calling any field constructors and destructors that are user defined.

Introspection (reflection) would go even further and provide at runtime all the information that you have at compile time about an object. But that's not required for assignment and destruction operations to work.

C doesn't have any of that, so a struct copy is just a shallow copy, a bit by bit copy of the entire struct contents. Which works pretty well, except for pointers/references.


No. Well, yes, in that if the type of an object is dynamic, it's possible that certain functions are resolved at runtime usually through a "virtual table". The static type of an object is only known at compile time, and all that the virtual dispatch does is an indirection through the virtual table to the static constructor or destructor as required, and the static special functions always know how to construct, copy, or destroy any subobjects.

So, no, runtime introspection is not needed, but runtime dispatch may be needed.


I'm calling eBPF "kernel shaders" to confuse graphics, os and gpgpu people all at the same time.


Decade and a half ago there was PacketShader, which used usermode networking+GPUs to do packet routing. It was a thrilling time. I thought this kind of effort to integrate off-the-shelf hardware and open source software-defined-networking (SDN) was only going to build and amplify. We do have some great SDN but remains a fairly niche world that stays largely behind the scenes. https://shader.kaist.edu/packetshader/index.html

I wish someone would take up this effort again. It'd be awesome to see VPP or someone target offload to GPUs again. It feels like there's a ton of optimization we could do today based around PCI-P2P, where the network card could DMA direct to the GPU and back out without having to transit main-memory/the CPU at all; lower latency & very efficient. It's a long leap & long hope, but I very much dream that CXL eventually brings us closer to that "disaggregated rack" model where a less host-based fabric starts disrupting architecture, create more deeply connected systems.

That said, just dropping down an fpga right on the nic is probably/definitely a smarter move. Seems like a bunch of hyperscaler do this. Unclear how much traction Marvell/Nvidia get from BlueField being on their boxes but it's there. Actually using the fpga is hard of course. Xilinx/AMD have a track record of kicking out some open source projects that seem interesting but don't seem to have any follow through. Nanotube being an XDP offload engine seemed brilliant, like a sure win. https://github.com/Xilinx/nanotube and https://github.com/Xilinx/open-nic .


What about Nvidia / Mellanox / Bluefield?

It looks like they have some demo code doing something like that. https://docs.nvidia.com/doca/archive/doca-v2.2.1/gpu-packet-...

What kind of workloads do you think would benefit from GPU processing?


I've been exactly thinking about it this way for a long time. Actually once we're able to push computation down into our disk drives, I wouldn't be surprised if these "Disk Shaders" will be written in eBPF.


It's already a thing on mainframes, disk shaders are called channel programs: https://en.m.wikipedia.org/wiki/Channel_I/O#Channel_program


Thank you for this beautiful rabbit hole to chase.


Totally sibling comment confirms it already exists! I hope that the 'shader' name sticks too! I find the idea of a shader has a very appropriate shape for tiny-program-embedded-in-specific-context so it seems perfect from a hacker POV!

I have a VFX(Houdini now, RSL shaders etc earlier) and openCL-dabbling and demoscene-lurking background, based on which I think I prefer 'shader' to 'kernel', that's what OpenCL calls them.. but that conflicts with the name of like, 'the OS kernel' at least somewhat..


I read that as eBNF and was very confused


This analogy works well when trying to describe how eBPF is used for network applications. The eBPF scripts are "packet shaders" - like a "pixel shaders" they are executed for every packet independently and can modify attributes and/or payload according to a certain algorithm.


The name “shader” screwed me up for so long. But once I better understood what they really are I think they’re incredibly powerful. “Kernel shader” is amazing.


I love this name, I hope it catches on


Seems to have worked on me! Well played! :)


not "koroutines"? I like "kernel shaders" though.


I'm stealing this.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: