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 <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair 2020-11-07 02:03:45 +00:00 committed by Commit Bot service account
parent 2c0cd311b8
commit 8655b62207
3 changed files with 3 additions and 12 deletions

View File

@ -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())) {

View File

@ -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

View File

@ -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
)");
}