dneto, to random
@dneto@mastodon.gamedev.place avatar

I think people get tied up in knots when trying to parse SPIR-V with structured control flow.

You gotta do it in reverse structured post-order.

Once you lay out the basic blocks in that order, the nested control constructs map to intervals over that list. (:galaxy brain:)

For details, see Tint's SPIR-V to WGSL translator.

https://dawn.googlesource.com/dawn/+/refs/heads/main/src/tint/lang/spirv/reader/ast_parser/function.cc#72

athas, to webgpu
@athas@freeradical.zone avatar

How do people test programs/shaders in CI? Can Chrome or Firefox run headless on a server in a closet? Is there a implementation that does not need a physical GPU?

niklaskorz, to rust
@niklaskorz@rheinneckar.social avatar

I'm happy to announce I will be speaking at this year. My talk is about Linon, a graphical application I began writing during my MSc studies at @uniheidelberg for interactively exploring the visual effects of continuous refraction or distortion of light rays. The application is based on , making heavy use of compute shaders.

https://rustfest.ch/talks/interactive-exploration-of-nonlinear-ray-casting-with-rust-and-wgpu/

ypujante, to webgpu
@ypujante@fosstodon.org avatar

Banging my head against the wall...

It seems that I am getting pos.x as the actual screen coordinate instead of [-1, 1] as demonstrated by:

@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {
var color = vec4f(0);
if(pos.x > 100) {
color = vec4f(1,0,0,1);
}
return color;
}

Any idea?????

ypujante, to webgpu
@ypujante@fosstodon.org avatar

Downloading Google Dawn on Windows10 fails due to filename too long.. here is the filename ImageSampleProjDrefExplicitLod_CheckForLod0_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_0.spvasm.expected.ir.msl

Kind of insane if you ask me...

dneto,
@dneto@mastodon.gamedev.place avatar

@ypujante
(And, those would be one of the unit tests of the SPIR-V to WGSL translator, converted to an end-to-end test so we can check the right thing will be emitted on all the backend languages.)

xarvh, to apple
@xarvh@functional.cafe avatar

I'm finally at the point where I have to start working on perhaps the main feature of my programming language Squarepants: the ability to compile to GPU Shaders.

The most attractive target would be which is an intermediate representation that works almost everywhere... Except on browsers, and only because didn't want to give control of the standard to the group that develops SpirV.
Instead, Apple imposed , which is a language instead than an intermediate representation, so it's a pain in the ass to target and will end up with the same problem as .

At some point there will be translators from SpirV to WGSL, but I can't rely on those now.

So, what am I going to target?
Right now Squarepants compiles to javascript, so can run easily in both browsers and .

There is a project to run SpirV (via Vulkan) on node, but has been dead for years, which means that if I want to compile to a native application, I need Squarepants to compile to C or LLVM first.

OTOH if I go through the square-peg-in-round-hole and target WGSL, then I can target browsers.

-sigh-, I feel like I have no good option.

dneto,
@dneto@mastodon.gamedev.place avatar

@xarvh

Unity uses this SPIR-V to translator.

Brendan Duncan talked about this a year ago. See his pinned post.

https://mastodon.gamedev.place/@brendan/112191277347723535

julienbarnoin, to programming
@julienbarnoin@mastodon.gamedev.place avatar

I've been working a lot with for a while now, writing complex code. Overall, I feel like the single improvement that would make the most difference for the language would be support for pass-by-reference instead of copy in/copy out syntax, as suggested here https://github.com/KhronosGroup/GLSL/issues/84

This would make it possible to do a lot of things that are either not possible or ridiculously inefficient to compile, including object oriented programming.

dneto,
@dneto@mastodon.gamedev.place avatar

@gfxstrand @julienbarnoin

has pass by ref but we call them pointers.

And it also has a no aliasing restriction; you can't have two names for the same variable memory and have a RW, WR, or WW hazard in the same function.
https://www.w3.org/TR/WGSL/#alias-analysis

And with all that our compiler does call site specialization until it boils those pointer params away. It's convenient for the programmer but can bloat code size (hopefully no more than hand rolling it yourself)

shanecelis, to GraphicsProgramming
@shanecelis@mastodon.gamedev.place avatar

I like the wgsl shading language, but the no swizzle assignment feels bad.

janriemer, to graphics

shadplay - Real-time visualisation tooling for educating oneself in the art of programming

https://github.com/alphastrata/shadplay

absulit, to webgpu
@absulit@mastodon.social avatar

My version of a kishimisu (instagram.com/kishimisu/) style shader, after following his YouTube tutorial but in #webgpu. Mostly all things are translatable from #glsl to #wgsl

#generativeart #creativecoding #genart #webgl
#abstract #abstractart #digitalart #animation #mograph #motiongraphics
#math #mathart #javascript #surrealism #surrealart
#shader #loop #cgi

video/mp4

absulit, (edited ) to webgpu
@absulit@mastodon.social avatar
amy, to random

🎉 Just cross-compiled my first WGSL SDF function from my node graph 🎉

(I had to add the connections manually, and there were some ID collisions but it works)

toxi, to random
@toxi@mastodon.thi.ng avatar

A warm welcome to all the , & people who started following me over the past few days (not 100% sure why, though!)

😉👋

I'm nothing more than an enthusiast in this field, but do a have strong interest (and prior experience) in mapping/visualization and also would like to work more again in that field. So here's a short thread about a few related tools and artistic projects I've been working on over the past couple of years (all work-in-progress)...

1/3

2D DEM visualization (with 3D shading, ambient occlusion, contour lines) of a small region near N38 W119 (near Mono Lake, CA)

toxi,
@toxi@mastodon.thi.ng avatar

Realtime visualization/editor using http://shadergraph.thi.ng

This web-based shader graph editor started in 2020 and is in urgent need to be developed further (i.e. to support loading & saving of projects, & export). The tool is really more about visual algebra and prototyping in general and so isn't specifically aimed at DEM visualizations, but it provides several useful operators to facilitate such (at least for pre-viz purposes and/or to create custom aesthetics). For example, there're generators for ambient occlusion maps, normal maps, bump mapping, elevation-based color gradients etc. Altogether, there're 36 customizable generators & operators, some also animated. Images (up to 4K res) can be imported via drag & drop. Currently only supports JPG/PNG, GeoTIFF will have to be pre-converted for now. If there's interest, I can record a quick video walkthrough of the tool...

The editor & all shader operators are written in , with the latter being transpiled to GLSL via https://thi.ng/shader-ast.

The attached screenshots show some of the graphs/workflows I've used to produce visualizations & artwork for prints. You can (maybe, who can say these days?) also find more examples (incl. videos) on my old Twitter:

https://twitter.com/search?q=from%3A%40thing_umbrella+shadergraph&f=live

2/3

Screenshot of the editor showing a grayscale heightmap image and 7 operator nodes (processing stages) to create a 3D shaded visualization with ambient occlusion (local shadows).
Screenshot of the editor showing a grayscale heightmap image and 7 operator nodes (processing stages) to create a 3D shaded visualization with ambient occlusion (local shadows).
Similar to the previous images, but here the visualization also uses an elevation-based 4-stop color gradient to produce a colored terrain with a different result aesthetic.

raph, to random
@raph@mastodon.online avatar

I just published a blog post, "A note on Metal shader converter": https://raphlinus.github.io/gpu/2023/06/12/shader-converter.html

As I discuss in the post, in the long term I'm hopeful for a future with robust GPU compute infrastructure, based on well-documented standards and rigorous testing so that we can be confident that GPU hardware will actually run our code (including sophisticated lock-free algorithms). We have a long way to go, and I think is a better path toward that future than proprietary GPU languages.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • khanakhh
  • kavyap
  • thenastyranch
  • everett
  • tacticalgear
  • rosin
  • Durango
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • InstantRegret
  • Youngstown
  • slotface
  • megavids
  • ethstaker
  • ngwrru68w68
  • cisconetworking
  • modclub
  • tester
  • osvaldo12
  • cubers
  • GTA5RPClips
  • normalnudes
  • Leos
  • provamag3
  • anitta
  • lostlight
  • All magazines