Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GLSL450 and Simple memory models #168

Merged
merged 3 commits into from
Oct 28, 2020
Merged

Support GLSL450 and Simple memory models #168

merged 3 commits into from
Oct 28, 2020

Conversation

khyperia
Copy link
Contributor

@khyperia khyperia commented Oct 28, 2020

Fixes #167

Only smoke-tested building the example-shader shader on both Simple and GLSL450 models, seems to work. We might want to set up tests for both all the spir-v versions and this going forwards.

spirv-builder/src/lib.rs Outdated Show resolved Hide resolved
spirv-builder/src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>
let mut builder = Builder::new();
// Default to spir-v 1.3
let version = version.unwrap_or((1, 3));
builder.set_version(version.0, version.1);
let memory_model = memory_model.unwrap_or(MemoryModel::Vulkan);
if kernel_mode {
builder.capability(Capability::Kernel);
} else {
builder.extension("SPV_KHR_vulkan_memory_model");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this extension actually needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the vulkan memory model isn't present for spir-v versions less than 1.5. I'll fix this, though.

Copy link
Contributor

@Jasper-Bekkers Jasper-Bekkers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine to have for now, but I think it would be a mistake to try to support GLSL or anything other then the Vulkan Memory Model if we run into complex memory model issues. For example, if we discuss around subgroup operations, I think that topic might already be tricky enough without the additional implications that OpenGL / GLSL450 brings (if any).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenGL compatibility
4 participants