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

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.

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

I know SPIR-V is not meant for human readability and all that, but damn. Is there not any way that the variables were named anything closer to useful than %13525? I understand that it's not a one-to-one match with my glsl variables, but like... This feels like it's actively trying to obfuscate the code 🥲

Maybe there's some glslang option I don't know about that tries to make them a bit clearer?

vulkan, to GraphicsProgramming
@vulkan@fosstodon.org avatar

The SPIR Working Group developed 2 new SPIR-V extensions to provide shader authors with more guarantees about the execution model of shaders: SPV_KHR_maximal_reconvergence and VK_KHR_shader_quad_control.

Learn more: https://www.khronos.org/blog/khronos-releases-maximal-reconvergence-and-quad-control-extensions-for-vulkan-and-spir-v

rml, to random
@rml@functional.cafe avatar

wow this project is so cool, a sophisticated IDE with its own virtual machine
https://shadered.org/
https://github.com/dfranx/SPIRV-VM

pekka, to random

chipStar 1.0 released! It's a tool for compiling and running CUDA/HIP applications on SPIR-V-supported OpenCL or LevelZero platforms. v1.0 can already run various HPC applications correctly. See: https://github.com/CHIP-SPV/chipStar/releases/tag/v1.0
#opencl #levelzero #spirv #cuda #hip

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