Path: blob/21.2-virgl/src/compiler/spirv/tests/avail_vis.cpp
4547 views
/*1* Copyright © 2020 Valve Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*/22#include "helpers.h"2324TEST_F(spirv_test, opload_vis)25{26/*27OpCapability Shader28OpCapability VulkanMemoryModel29OpCapability VulkanMemoryModelDeviceScope30%1 = OpExtInstImport "GLSL.std.450"31OpMemoryModel Logical Vulkan32OpEntryPoint GLCompute %4 "main" %933OpExecutionMode %4 LocalSize 1 1 134OpMemberDecorate %_struct_7 0 Offset 035OpDecorate %_struct_7 Block36OpDecorate %9 DescriptorSet 037OpDecorate %9 Binding 038%void = OpTypeVoid39%3 = OpTypeFunction %void40%uint = OpTypeInt 32 041%_struct_7 = OpTypeStruct %uint42%_ptr_StorageBuffer__struct_7 = OpTypePointer StorageBuffer %_struct_743%9 = OpVariable %_ptr_StorageBuffer__struct_7 StorageBuffer44%int = OpTypeInt 32 145%int_0 = OpConstant %int 046%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint47%device = OpConstant %int 148%4 = OpFunction %void None %349%5 = OpLabel50%13 = OpAccessChain %_ptr_StorageBuffer_uint %9 %int_051%14 = OpLoad %uint %13 NonPrivatePointer|MakePointerVisible %device52OpStore %13 %1453OpReturn54OpFunctionEnd55*/56static const uint32_t words[] = {570x07230203, 0x00010500, 0x00070000, 0x00000010, 0x00000000, 0x00020011,580x00000001, 0x00020011, 0x000014e1, 0x00020011, 0x000014e2, 0x0006000b,590x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e,600x00000000, 0x00000003, 0x0006000f, 0x00000005, 0x00000002, 0x6e69616d,610x00000000, 0x00000003, 0x00060010, 0x00000002, 0x00000011, 0x00000001,620x00000001, 0x00000001, 0x00050048, 0x00000004, 0x00000000, 0x00000023,630x00000000, 0x00030047, 0x00000004, 0x00000002, 0x00040047, 0x00000003,640x00000022, 0x00000000, 0x00040047, 0x00000003, 0x00000021, 0x00000000,650x00020013, 0x00000005, 0x00030021, 0x00000006, 0x00000005, 0x00040015,660x00000007, 0x00000020, 0x00000000, 0x0003001e, 0x00000004, 0x00000007,670x00040020, 0x00000008, 0x0000000c, 0x00000004, 0x0004003b, 0x00000008,680x00000003, 0x0000000c, 0x00040015, 0x00000009, 0x00000020, 0x00000001,690x0004002b, 0x00000009, 0x0000000a, 0x00000000, 0x00040020, 0x0000000b,700x0000000c, 0x00000007, 0x0004002b, 0x00000009, 0x0000000c, 0x00000001,710x00050036, 0x00000005, 0x00000002, 0x00000000, 0x00000006, 0x000200f8,720x0000000d, 0x00050041, 0x0000000b, 0x0000000e, 0x00000003, 0x0000000a,730x0006003d, 0x00000007, 0x0000000f, 0x0000000e, 0x00000030, 0x0000000c,740x0003003e, 0x0000000e, 0x0000000f, 0x000100fd, 0x00010038,75};7677get_nir(sizeof(words) / sizeof(words[0]), words);7879nir_intrinsic_instr *intrinsic = find_intrinsic(nir_intrinsic_scoped_barrier, 0);80ASSERT_NE(intrinsic, nullptr);8182EXPECT_EQ(nir_intrinsic_memory_semantics(intrinsic), NIR_MEMORY_MAKE_VISIBLE | NIR_MEMORY_ACQUIRE);83EXPECT_NE(nir_intrinsic_memory_modes(intrinsic) & nir_var_mem_ssbo, 0);84EXPECT_EQ(nir_intrinsic_memory_scope(intrinsic), NIR_SCOPE_DEVICE);85EXPECT_EQ(nir_intrinsic_execution_scope(intrinsic), NIR_SCOPE_NONE);86}8788TEST_F(spirv_test, opstore_avail)89{90/*91OpCapability Shader92OpCapability VulkanMemoryModel93OpCapability VulkanMemoryModelDeviceScope94%1 = OpExtInstImport "GLSL.std.450"95OpMemoryModel Logical Vulkan96OpEntryPoint GLCompute %4 "main" %997OpExecutionMode %4 LocalSize 1 1 198OpMemberDecorate %_struct_7 0 Offset 099OpDecorate %_struct_7 Block100OpDecorate %9 DescriptorSet 0101OpDecorate %9 Binding 0102%void = OpTypeVoid103%3 = OpTypeFunction %void104%uint = OpTypeInt 32 0105%_struct_7 = OpTypeStruct %uint106%_ptr_StorageBuffer__struct_7 = OpTypePointer StorageBuffer %_struct_7107%9 = OpVariable %_ptr_StorageBuffer__struct_7 StorageBuffer108%int = OpTypeInt 32 1109%int_0 = OpConstant %int 0110%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint111%device = OpConstant %int 1112%4 = OpFunction %void None %3113%5 = OpLabel114%13 = OpAccessChain %_ptr_StorageBuffer_uint %9 %int_0115%14 = OpLoad %uint %13116OpStore %13 %14 NonPrivatePointer|MakePointerAvailable %device117OpReturn118OpFunctionEnd119*/120static const uint32_t words[] = {1210x07230203, 0x00010500, 0x00070000, 0x00000010, 0x00000000, 0x00020011,1220x00000001, 0x00020011, 0x000014e1, 0x00020011, 0x000014e2, 0x0006000b,1230x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e,1240x00000000, 0x00000003, 0x0006000f, 0x00000005, 0x00000002, 0x6e69616d,1250x00000000, 0x00000003, 0x00060010, 0x00000002, 0x00000011, 0x00000001,1260x00000001, 0x00000001, 0x00050048, 0x00000004, 0x00000000, 0x00000023,1270x00000000, 0x00030047, 0x00000004, 0x00000002, 0x00040047, 0x00000003,1280x00000022, 0x00000000, 0x00040047, 0x00000003, 0x00000021, 0x00000000,1290x00020013, 0x00000005, 0x00030021, 0x00000006, 0x00000005, 0x00040015,1300x00000007, 0x00000020, 0x00000000, 0x0003001e, 0x00000004, 0x00000007,1310x00040020, 0x00000008, 0x0000000c, 0x00000004, 0x0004003b, 0x00000008,1320x00000003, 0x0000000c, 0x00040015, 0x00000009, 0x00000020, 0x00000001,1330x0004002b, 0x00000009, 0x0000000a, 0x00000000, 0x00040020, 0x0000000b,1340x0000000c, 0x00000007, 0x0004002b, 0x00000009, 0x0000000c, 0x00000001,1350x00050036, 0x00000005, 0x00000002, 0x00000000, 0x00000006, 0x000200f8,1360x0000000d, 0x00050041, 0x0000000b, 0x0000000e, 0x00000003, 0x0000000a,1370x0004003d, 0x00000007, 0x0000000f, 0x0000000e, 0x0005003e, 0x0000000e,1380x0000000f, 0x00000028, 0x0000000c, 0x000100fd, 0x00010038,139};140141get_nir(sizeof(words) / sizeof(words[0]), words);142143nir_intrinsic_instr *intrinsic = find_intrinsic(nir_intrinsic_scoped_barrier, 0);144ASSERT_NE(intrinsic, nullptr);145146EXPECT_EQ(nir_intrinsic_memory_semantics(intrinsic), NIR_MEMORY_MAKE_AVAILABLE | NIR_MEMORY_RELEASE);147EXPECT_NE(nir_intrinsic_memory_modes(intrinsic) & nir_var_mem_ssbo, 0);148EXPECT_EQ(nir_intrinsic_memory_scope(intrinsic), NIR_SCOPE_DEVICE);149EXPECT_EQ(nir_intrinsic_execution_scope(intrinsic), NIR_SCOPE_NONE);150}151152TEST_F(spirv_test, opcopymemory_visavail_both_combined)153{154/*155OpCapability Shader156OpCapability VulkanMemoryModel157OpCapability VulkanMemoryModelDeviceScope158%1 = OpExtInstImport "GLSL.std.450"159OpMemoryModel Logical Vulkan160OpEntryPoint GLCompute %4 "main" %9161OpExecutionMode %4 LocalSize 1 1 1162OpMemberDecorate %_struct_7 0 Offset 0163OpDecorate %_struct_7 Block164OpDecorate %9 DescriptorSet 0165OpDecorate %9 Binding 0166%void = OpTypeVoid167%3 = OpTypeFunction %void168%uint = OpTypeInt 32 0169%_struct_7 = OpTypeStruct %uint170%_ptr_StorageBuffer__struct_7 = OpTypePointer StorageBuffer %_struct_7171%9 = OpVariable %_ptr_StorageBuffer__struct_7 StorageBuffer172%int = OpTypeInt 32 1173%int_0 = OpConstant %int 0174%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint175%device = OpConstant %int 1176%workgroup = OpConstant %int 2177%4 = OpFunction %void None %3178%5 = OpLabel179%13 = OpAccessChain %_ptr_StorageBuffer_uint %9 %int_0180OpCopyMemory %13 %13 NonPrivatePointer|MakePointerAvailable|MakePointerVisible %device %workgroup181OpReturn182OpFunctionEnd183*/184static const uint32_t words[] = {1850x07230203, 0x00010500, 0x00070000, 0x00000010, 0x00000000, 0x00020011,1860x00000001, 0x00020011, 0x000014e1, 0x00020011, 0x000014e2, 0x0006000b,1870x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e,1880x00000000, 0x00000003, 0x0006000f, 0x00000005, 0x00000002, 0x6e69616d,1890x00000000, 0x00000003, 0x00060010, 0x00000002, 0x00000011, 0x00000001,1900x00000001, 0x00000001, 0x00050048, 0x00000004, 0x00000000, 0x00000023,1910x00000000, 0x00030047, 0x00000004, 0x00000002, 0x00040047, 0x00000003,1920x00000022, 0x00000000, 0x00040047, 0x00000003, 0x00000021, 0x00000000,1930x00020013, 0x00000005, 0x00030021, 0x00000006, 0x00000005, 0x00040015,1940x00000007, 0x00000020, 0x00000000, 0x0003001e, 0x00000004, 0x00000007,1950x00040020, 0x00000008, 0x0000000c, 0x00000004, 0x0004003b, 0x00000008,1960x00000003, 0x0000000c, 0x00040015, 0x00000009, 0x00000020, 0x00000001,1970x0004002b, 0x00000009, 0x0000000a, 0x00000000, 0x00040020, 0x0000000b,1980x0000000c, 0x00000007, 0x0004002b, 0x00000009, 0x0000000c, 0x00000001,1990x0004002b, 0x00000009, 0x0000000d, 0x00000002, 0x00050036, 0x00000005,2000x00000002, 0x00000000, 0x00000006, 0x000200f8, 0x0000000e, 0x00050041,2010x0000000b, 0x0000000f, 0x00000003, 0x0000000a, 0x0006003f, 0x0000000f,2020x0000000f, 0x00000038, 0x0000000c, 0x0000000d, 0x000100fd, 0x00010038,203};204205get_nir(sizeof(words) / sizeof(words[0]), words);206207nir_intrinsic_instr *first = find_intrinsic(nir_intrinsic_scoped_barrier, 0);208nir_intrinsic_instr *second = find_intrinsic(nir_intrinsic_scoped_barrier, 1);209ASSERT_NE(first, nullptr);210ASSERT_NE(second, nullptr);211212EXPECT_EQ(nir_intrinsic_memory_semantics(first), NIR_MEMORY_MAKE_VISIBLE | NIR_MEMORY_ACQUIRE);213EXPECT_NE(nir_intrinsic_memory_modes(first) & nir_var_mem_ssbo, 0);214EXPECT_EQ(nir_intrinsic_memory_scope(first), NIR_SCOPE_WORKGROUP);215EXPECT_EQ(nir_intrinsic_execution_scope(first), NIR_SCOPE_NONE);216217EXPECT_EQ(nir_intrinsic_memory_semantics(second), NIR_MEMORY_MAKE_AVAILABLE | NIR_MEMORY_RELEASE);218EXPECT_NE(nir_intrinsic_memory_modes(second) & nir_var_mem_ssbo, 0);219EXPECT_EQ(nir_intrinsic_memory_scope(second), NIR_SCOPE_DEVICE);220EXPECT_EQ(nir_intrinsic_execution_scope(first), NIR_SCOPE_NONE);221}222223TEST_F(spirv_test, opcopymemory_visavail_both_separate)224{225/*226OpCapability Shader227OpCapability VulkanMemoryModel228OpCapability VulkanMemoryModelDeviceScope229%1 = OpExtInstImport "GLSL.std.450"230OpMemoryModel Logical Vulkan231OpEntryPoint GLCompute %4 "main" %9232OpExecutionMode %4 LocalSize 1 1 1233OpMemberDecorate %_struct_7 0 Offset 0234OpDecorate %_struct_7 Block235OpDecorate %9 DescriptorSet 0236OpDecorate %9 Binding 0237%void = OpTypeVoid238%3 = OpTypeFunction %void239%uint = OpTypeInt 32 0240%_struct_7 = OpTypeStruct %uint241%_ptr_StorageBuffer__struct_7 = OpTypePointer StorageBuffer %_struct_7242%9 = OpVariable %_ptr_StorageBuffer__struct_7 StorageBuffer243%int = OpTypeInt 32 1244%int_0 = OpConstant %int 0245%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint246%device = OpConstant %int 1247%workgroup = OpConstant %int 2248%4 = OpFunction %void None %3249%5 = OpLabel250%13 = OpAccessChain %_ptr_StorageBuffer_uint %9 %int_0251OpCopyMemory %13 %13 NonPrivatePointer|MakePointerAvailable %device NonPrivatePointer|MakePointerVisible %workgroup252OpReturn253OpFunctionEnd254*/255static const uint32_t words[] = {2560x07230203, 0x00010500, 0x00070000, 0x00000010, 0x00000000, 0x00020011,2570x00000001, 0x00020011, 0x000014e1, 0x00020011, 0x000014e2, 0x0006000b,2580x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e,2590x00000000, 0x00000003, 0x0006000f, 0x00000005, 0x00000002, 0x6e69616d,2600x00000000, 0x00000003, 0x00060010, 0x00000002, 0x00000011, 0x00000001,2610x00000001, 0x00000001, 0x00050048, 0x00000004, 0x00000000, 0x00000023,2620x00000000, 0x00030047, 0x00000004, 0x00000002, 0x00040047, 0x00000003,2630x00000022, 0x00000000, 0x00040047, 0x00000003, 0x00000021, 0x00000000,2640x00020013, 0x00000005, 0x00030021, 0x00000006, 0x00000005, 0x00040015,2650x00000007, 0x00000020, 0x00000000, 0x0003001e, 0x00000004, 0x00000007,2660x00040020, 0x00000008, 0x0000000c, 0x00000004, 0x0004003b, 0x00000008,2670x00000003, 0x0000000c, 0x00040015, 0x00000009, 0x00000020, 0x00000001,2680x0004002b, 0x00000009, 0x0000000a, 0x00000000, 0x00040020, 0x0000000b,2690x0000000c, 0x00000007, 0x0004002b, 0x00000009, 0x0000000c, 0x00000001,2700x0004002b, 0x00000009, 0x0000000d, 0x00000002, 0x00050036, 0x00000005,2710x00000002, 0x00000000, 0x00000006, 0x000200f8, 0x0000000e, 0x00050041,2720x0000000b, 0x0000000f, 0x00000003, 0x0000000a, 0x0007003f, 0x0000000f,2730x0000000f, 0x00000028, 0x0000000c, 0x00000030, 0x0000000d, 0x000100fd,2740x00010038,275};276277get_nir(sizeof(words) / sizeof(words[0]), words);278279nir_intrinsic_instr *first = find_intrinsic(nir_intrinsic_scoped_barrier, 0);280nir_intrinsic_instr *second = find_intrinsic(nir_intrinsic_scoped_barrier, 1);281ASSERT_NE(first, nullptr);282ASSERT_NE(second, nullptr);283284EXPECT_EQ(nir_intrinsic_memory_semantics(first), NIR_MEMORY_MAKE_VISIBLE | NIR_MEMORY_ACQUIRE);285EXPECT_NE(nir_intrinsic_memory_modes(first) & nir_var_mem_ssbo, 0);286EXPECT_EQ(nir_intrinsic_memory_scope(first), NIR_SCOPE_WORKGROUP);287EXPECT_EQ(nir_intrinsic_execution_scope(first), NIR_SCOPE_NONE);288289EXPECT_EQ(nir_intrinsic_memory_semantics(second), NIR_MEMORY_MAKE_AVAILABLE | NIR_MEMORY_RELEASE);290EXPECT_NE(nir_intrinsic_memory_modes(second) & nir_var_mem_ssbo, 0);291EXPECT_EQ(nir_intrinsic_memory_scope(second), NIR_SCOPE_DEVICE);292EXPECT_EQ(nir_intrinsic_execution_scope(second), NIR_SCOPE_NONE);293}294295TEST_F(spirv_test, opcopymemory_avail)296{297/*298OpCapability Shader299OpCapability VulkanMemoryModel300OpCapability VulkanMemoryModelDeviceScope301%1 = OpExtInstImport "GLSL.std.450"302OpMemoryModel Logical Vulkan303OpEntryPoint GLCompute %4 "main" %9304OpExecutionMode %4 LocalSize 1 1 1305OpMemberDecorate %_struct_7 0 Offset 0306OpDecorate %_struct_7 Block307OpDecorate %9 DescriptorSet 0308OpDecorate %9 Binding 0309%void = OpTypeVoid310%3 = OpTypeFunction %void311%uint = OpTypeInt 32 0312%_struct_7 = OpTypeStruct %uint313%_ptr_StorageBuffer__struct_7 = OpTypePointer StorageBuffer %_struct_7314%9 = OpVariable %_ptr_StorageBuffer__struct_7 StorageBuffer315%int = OpTypeInt 32 1316%int_0 = OpConstant %int 0317%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint318%device = OpConstant %int 1319%4 = OpFunction %void None %3320%5 = OpLabel321%13 = OpAccessChain %_ptr_StorageBuffer_uint %9 %int_0322OpCopyMemory %13 %13 NonPrivatePointer|MakePointerAvailable %device323OpReturn324OpFunctionEnd325*/326static const uint32_t words[] = {3270x07230203, 0x00010500, 0x00070000, 0x0000000f, 0x00000000, 0x00020011,3280x00000001, 0x00020011, 0x000014e1, 0x00020011, 0x000014e2, 0x0006000b,3290x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e,3300x00000000, 0x00000003, 0x0006000f, 0x00000005, 0x00000002, 0x6e69616d,3310x00000000, 0x00000003, 0x00060010, 0x00000002, 0x00000011, 0x00000001,3320x00000001, 0x00000001, 0x00050048, 0x00000004, 0x00000000, 0x00000023,3330x00000000, 0x00030047, 0x00000004, 0x00000002, 0x00040047, 0x00000003,3340x00000022, 0x00000000, 0x00040047, 0x00000003, 0x00000021, 0x00000000,3350x00020013, 0x00000005, 0x00030021, 0x00000006, 0x00000005, 0x00040015,3360x00000007, 0x00000020, 0x00000000, 0x0003001e, 0x00000004, 0x00000007,3370x00040020, 0x00000008, 0x0000000c, 0x00000004, 0x0004003b, 0x00000008,3380x00000003, 0x0000000c, 0x00040015, 0x00000009, 0x00000020, 0x00000001,3390x0004002b, 0x00000009, 0x0000000a, 0x00000000, 0x00040020, 0x0000000b,3400x0000000c, 0x00000007, 0x0004002b, 0x00000009, 0x0000000c, 0x00000001,3410x00050036, 0x00000005, 0x00000002, 0x00000000, 0x00000006, 0x000200f8,3420x0000000d, 0x00050041, 0x0000000b, 0x0000000e, 0x00000003, 0x0000000a,3430x0005003f, 0x0000000e, 0x0000000e, 0x00000028, 0x0000000c, 0x000100fd,3440x00010038,345};346347get_nir(sizeof(words) / sizeof(words[0]), words);348349nir_intrinsic_instr *intrinsic = find_intrinsic(nir_intrinsic_scoped_barrier, 0);350ASSERT_NE(intrinsic, nullptr);351352EXPECT_EQ(nir_intrinsic_memory_semantics(intrinsic), NIR_MEMORY_MAKE_AVAILABLE | NIR_MEMORY_RELEASE);353EXPECT_NE(nir_intrinsic_memory_modes(intrinsic) & nir_var_mem_ssbo, 0);354EXPECT_EQ(nir_intrinsic_memory_scope(intrinsic), NIR_SCOPE_DEVICE);355EXPECT_EQ(nir_intrinsic_execution_scope(intrinsic), NIR_SCOPE_NONE);356}357358TEST_F(spirv_test, opcopymemory_vis)359{360/*361OpCapability Shader362OpCapability VulkanMemoryModel363OpCapability VulkanMemoryModelDeviceScope364%1 = OpExtInstImport "GLSL.std.450"365OpMemoryModel Logical Vulkan366OpEntryPoint GLCompute %4 "main" %9367OpExecutionMode %4 LocalSize 1 1 1368OpMemberDecorate %_struct_7 0 Offset 0369OpDecorate %_struct_7 Block370OpDecorate %9 DescriptorSet 0371OpDecorate %9 Binding 0372%void = OpTypeVoid373%3 = OpTypeFunction %void374%uint = OpTypeInt 32 0375%_struct_7 = OpTypeStruct %uint376%_ptr_StorageBuffer__struct_7 = OpTypePointer StorageBuffer %_struct_7377%9 = OpVariable %_ptr_StorageBuffer__struct_7 StorageBuffer378%int = OpTypeInt 32 1379%int_0 = OpConstant %int 0380%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint381%workgroup = OpConstant %int 2382%4 = OpFunction %void None %3383%5 = OpLabel384%13 = OpAccessChain %_ptr_StorageBuffer_uint %9 %int_0385OpCopyMemory %13 %13 NonPrivatePointer|MakePointerVisible %workgroup386OpReturn387OpFunctionEnd388*/389static const uint32_t words[] = {3900x07230203, 0x00010500, 0x00070000, 0x0000000f, 0x00000000, 0x00020011,3910x00000001, 0x00020011, 0x000014e1, 0x00020011, 0x000014e2, 0x0006000b,3920x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e,3930x00000000, 0x00000003, 0x0006000f, 0x00000005, 0x00000002, 0x6e69616d,3940x00000000, 0x00000003, 0x00060010, 0x00000002, 0x00000011, 0x00000001,3950x00000001, 0x00000001, 0x00050048, 0x00000004, 0x00000000, 0x00000023,3960x00000000, 0x00030047, 0x00000004, 0x00000002, 0x00040047, 0x00000003,3970x00000022, 0x00000000, 0x00040047, 0x00000003, 0x00000021, 0x00000000,3980x00020013, 0x00000005, 0x00030021, 0x00000006, 0x00000005, 0x00040015,3990x00000007, 0x00000020, 0x00000000, 0x0003001e, 0x00000004, 0x00000007,4000x00040020, 0x00000008, 0x0000000c, 0x00000004, 0x0004003b, 0x00000008,4010x00000003, 0x0000000c, 0x00040015, 0x00000009, 0x00000020, 0x00000001,4020x0004002b, 0x00000009, 0x0000000a, 0x00000000, 0x00040020, 0x0000000b,4030x0000000c, 0x00000007, 0x0004002b, 0x00000009, 0x0000000c, 0x00000002,4040x00050036, 0x00000005, 0x00000002, 0x00000000, 0x00000006, 0x000200f8,4050x0000000d, 0x00050041, 0x0000000b, 0x0000000e, 0x00000003, 0x0000000a,4060x0005003f, 0x0000000e, 0x0000000e, 0x00000030, 0x0000000c, 0x000100fd,4070x00010038,408};409410get_nir(sizeof(words) / sizeof(words[0]), words);411412nir_intrinsic_instr *intrinsic = find_intrinsic(nir_intrinsic_scoped_barrier, 0);413ASSERT_NE(intrinsic, nullptr);414415EXPECT_EQ(nir_intrinsic_memory_semantics(intrinsic), NIR_MEMORY_MAKE_VISIBLE | NIR_MEMORY_ACQUIRE);416EXPECT_NE(nir_intrinsic_memory_modes(intrinsic) & nir_var_mem_ssbo, 0);417EXPECT_EQ(nir_intrinsic_memory_scope(intrinsic), NIR_SCOPE_WORKGROUP);418EXPECT_EQ(nir_intrinsic_execution_scope(intrinsic), NIR_SCOPE_NONE);419}420421422