GLSL Operation Support in SPIRV Dialect

Hi everyone,

We have done and are working on supporting some glsl operations (most of them are related to image and vectors, e.g. SampledImageType, ImageType…) supporting in SPIRV Dialect. We noticed that the latest MLIR project hasn’t support some operations we have done. We are interested in knowing the status and plan of supporting GLSL operations in SPIRV dialect. Also we would be happy to contribute our work if possible. Is there any suggestion on what we should do? I am a newbie in this community. :slight_smile: Thanks!

Hi @Weiwei-2021,

That’s awesome to know! By GLSL operations I assume you mostly mean core SPIR-V types/operations for graphics (which is different from GLSL extended instruction set operations)?

Yup. We don’t have much in-tree support for graphics at the moment. This is because folks interested in SPIR-V right now are using it for lowering ML models via either Vulkan compute or OpenCL. But I’ve been wanting to see progress on the graphics side from the beginning and the dialect and its infrastructure is designed with that support. If you have use cases that would need graphics support, please certainly feel free to push it forward!

Contributions are certainly very welcome! Thanks in advance!

I’d suggest you to read through How to Contribute - MLIR, which describes the logistics for contributing to MLIR in general. For SPIR-V side, given you mentioned that you have already done some ops, I’d assume you’ve already read about 'spv' Dialect - MLIR, which describes some useful tools/scripts. After that, a good first step might be to isolate some small amount of code you’ve already written and upload via Phabricator to get familiar with the flow. Let me know if you hit issues; help to help! :slight_smile:

Yes, we are working on core SPIR-V types/operaions for graphics.

Thank you for your quick reply and nice guidance. We are also excited to share our exploration on MLIR. I will follow your suggestion and start playing with Phabricator. :slight_smile:

Hi @antiagainst

I have uploaded a patch ⚙ D95580 [mlir][spirv] Add support for OpImageType. As you suggested, this patch is a small one to support the OpImageType. Please review it and let me know if it has any problem. As I mentioned, I am a beginner of MLIR, any feedback is appreciated! Thanks in advance and have a good night!

LGTM! I left a few comments on the patch. Thanks again for the contribution! :smiley:

Thank you very much for the review and explanation on MLIR! It is really helpful! Our pleasure to contribute. Looking forward to keep working on it!

Also thank you and @bob.belcher, I know how to play with Phabricator now. :slight_smile:

1 Like