From 8655b62207a5b2e16ad0ba2247bf880fcf7901f8 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Sat, 7 Nov 2020 02:03:45 +0000 Subject: [PATCH] Switch to GLSL450 memory model. This CL updates Tint to use the GLSL450 memory model. Bug: tint:63 Change-Id: Ia32851fbf8ee71233977a00386af5a91cb4b4b58 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31601 Commit-Queue: dan sinclair Reviewed-by: David Neto --- src/writer/spirv/builder.cc | 7 +------ src/writer/spirv/builder_function_test.cc | 4 +--- src/writer/spirv/builder_test.cc | 4 +--- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/writer/spirv/builder.cc b/src/writer/spirv/builder.cc index 1903704c1d..054645f1de 100644 --- a/src/writer/spirv/builder.cc +++ b/src/writer/spirv/builder.cc @@ -277,14 +277,9 @@ Builder::~Builder() = default; bool Builder::Build() { push_capability(SpvCapabilityShader); - // TODO(dneto): Stop using the Vulkan memory model. crbug.com/tint/63 - push_capability(SpvCapabilityVulkanMemoryModel); - push_extension(spv::Op::OpExtension, - {Operand::String("SPV_KHR_vulkan_memory_model")}); - push_memory_model(spv::Op::OpMemoryModel, {Operand::Int(SpvAddressingModelLogical), - Operand::Int(SpvMemoryModelVulkanKHR)}); + Operand::Int(SpvMemoryModelGLSL450)}); for (const auto& var : mod_->global_variables()) { if (!GenerateGlobalVariable(var.get())) { diff --git a/src/writer/spirv/builder_function_test.cc b/src/writer/spirv/builder_function_test.cc index ba4ad5922c..9ecc5f0db2 100644 --- a/src/writer/spirv/builder_function_test.cc +++ b/src/writer/spirv/builder_function_test.cc @@ -260,9 +260,7 @@ TEST_F(BuilderTest, Emit_Multiple_EntryPoint_With_Same_ModuleVar) { Builder b(&mod); ASSERT_TRUE(b.Build()); EXPECT_EQ(DumpBuilder(b), R"(OpCapability Shader -OpCapability VulkanMemoryModel -OpExtension "SPV_KHR_vulkan_memory_model" -OpMemoryModel Logical Vulkan +OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %7 "a" OpEntryPoint GLCompute %17 "b" OpExecutionMode %7 LocalSize 1 1 1 diff --git a/src/writer/spirv/builder_test.cc b/src/writer/spirv/builder_test.cc index 1e22d5f41d..4df69100a8 100644 --- a/src/writer/spirv/builder_test.cc +++ b/src/writer/spirv/builder_test.cc @@ -34,9 +34,7 @@ TEST_F(BuilderTest, InsertsPreamble) { Builder b(&m); ASSERT_TRUE(b.Build()); EXPECT_EQ(DumpBuilder(b), R"(OpCapability Shader -OpCapability VulkanMemoryModel -OpExtension "SPV_KHR_vulkan_memory_model" -OpMemoryModel Logical Vulkan +OpMemoryModel Logical GLSL450 )"); }