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:
parent
2c0cd311b8
commit
8655b62207
|
@ -277,14 +277,9 @@ Builder::~Builder() = default;
|
||||||
bool Builder::Build() {
|
bool Builder::Build() {
|
||||||
push_capability(SpvCapabilityShader);
|
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,
|
push_memory_model(spv::Op::OpMemoryModel,
|
||||||
{Operand::Int(SpvAddressingModelLogical),
|
{Operand::Int(SpvAddressingModelLogical),
|
||||||
Operand::Int(SpvMemoryModelVulkanKHR)});
|
Operand::Int(SpvMemoryModelGLSL450)});
|
||||||
|
|
||||||
for (const auto& var : mod_->global_variables()) {
|
for (const auto& var : mod_->global_variables()) {
|
||||||
if (!GenerateGlobalVariable(var.get())) {
|
if (!GenerateGlobalVariable(var.get())) {
|
||||||
|
|
|
@ -260,9 +260,7 @@ TEST_F(BuilderTest, Emit_Multiple_EntryPoint_With_Same_ModuleVar) {
|
||||||
Builder b(&mod);
|
Builder b(&mod);
|
||||||
ASSERT_TRUE(b.Build());
|
ASSERT_TRUE(b.Build());
|
||||||
EXPECT_EQ(DumpBuilder(b), R"(OpCapability Shader
|
EXPECT_EQ(DumpBuilder(b), R"(OpCapability Shader
|
||||||
OpCapability VulkanMemoryModel
|
OpMemoryModel Logical GLSL450
|
||||||
OpExtension "SPV_KHR_vulkan_memory_model"
|
|
||||||
OpMemoryModel Logical Vulkan
|
|
||||||
OpEntryPoint GLCompute %7 "a"
|
OpEntryPoint GLCompute %7 "a"
|
||||||
OpEntryPoint GLCompute %17 "b"
|
OpEntryPoint GLCompute %17 "b"
|
||||||
OpExecutionMode %7 LocalSize 1 1 1
|
OpExecutionMode %7 LocalSize 1 1 1
|
||||||
|
|
|
@ -34,9 +34,7 @@ TEST_F(BuilderTest, InsertsPreamble) {
|
||||||
Builder b(&m);
|
Builder b(&m);
|
||||||
ASSERT_TRUE(b.Build());
|
ASSERT_TRUE(b.Build());
|
||||||
EXPECT_EQ(DumpBuilder(b), R"(OpCapability Shader
|
EXPECT_EQ(DumpBuilder(b), R"(OpCapability Shader
|
||||||
OpCapability VulkanMemoryModel
|
OpMemoryModel Logical GLSL450
|
||||||
OpExtension "SPV_KHR_vulkan_memory_model"
|
|
||||||
OpMemoryModel Logical Vulkan
|
|
||||||
)");
|
)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue