[Tint] Requiring language feature in SPIRV

76 views
Skip to first unread message

Akio Gaule

unread,
Sep 11, 2024, 5:01:40 PM9/11/24
to Dawn Graphics
Hi all,

I have an HLSL compute shader that is writing into a RWTexture2D (Storage Texture). I'm using DXC to compile to SPIRV and then use Tint to generate WGSL but I'm getting the following error:

Tint: error: language feature 'readonly_and_readwrite_storage_textures' is not allowed in the current environment.

It looks like I need to add a requirement for the "readonly_and_readwrite_storage_textures" language feature in the shader (similar to the "requires readonly_and_readwrite_storage_textures:" in WGSL) but I have no idea how I can do that. Is there a way to add these language requirements in either HLSL or SPIRV?

Thanks

James Price

unread,
Sep 12, 2024, 3:59:09 AM9/12/24
to Akio Gaule, Dawn Graphics
Hi Akio,

Are you using the Tint executable or programmatically as a library?

If you're using Tint as a library, you just need to add the feature to the options struct that you pass to `tint::spirv::reader::Read()`.
If you're using the Tint executable, there's currently no way to do this as we haven't added an option for it, but it should be straightforward to do.

James

--
You received this message because you are subscribed to the Google Groups "Dawn Graphics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dawn-graphic...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dawn-graphics/696736a6-d493-4373-8829-fb39831261d4n%40googlegroups.com.

Akio Gaule

unread,
Sep 13, 2024, 8:56:03 PM9/13/24
to Dawn Graphics
Hi James,

I'm using Tint as an executable so after looking in the code,  I ended up adding an option to add all required language features as allowed features, similar to what DXC does with capabilities in SPIR-V. Is it possible to have something like this, or maybe a command line argument to specify allowed features? Do I need to file a bug/request somewhere?

Thanks

James Price

unread,
Sep 19, 2024, 9:36:57 AM9/19/24
to Akio Gaule, Dawn Graphics
Hi Akio,

I've opened crbug.com/368289749 for this request.

James

Reply all
Reply to author
Forward
0 new messages