@@ -2039,6 +2039,65 @@ OpFunctionEnd
20392039 " with a Storage Class of Input or Output.\n " ));
20402040}
20412041
2042+ TEST_F (ValidateInterfacesTest, VectorIdFragmentInputOutputPass) {
2043+ const std::string text = R"(
2044+ OpCapability Shader
2045+ OpCapability LongVectorEXT
2046+ OpExtension "SPV_EXT_long_vector"
2047+ OpMemoryModel Logical GLSL450
2048+ OpEntryPoint Fragment %main "main" %in %out
2049+ OpExecutionMode %main OriginUpperLeft
2050+ OpDecorate %in Location 0
2051+ OpDecorate %out Location 0
2052+ %void = OpTypeVoid
2053+ %f32 = OpTypeFloat 32
2054+ %u32 = OpTypeInt 32 0
2055+ %u4 = OpConstant %u32 4
2056+ %f32vec = OpTypeVectorIdEXT %f32 %u4
2057+ %in_ptr = OpTypePointer Input %f32vec
2058+ %out_ptr = OpTypePointer Output %f32vec
2059+ %in = OpVariable %in_ptr Input
2060+ %out = OpVariable %out_ptr Output
2061+ %void_fn = OpTypeFunction %void
2062+ %main = OpFunction %void None %void_fn
2063+ %entry = OpLabel
2064+ OpReturn
2065+ OpFunctionEnd
2066+ )" ;
2067+
2068+ CompileSuccessfully (text, SPV_ENV_VULKAN_1_3);
2069+ ASSERT_EQ (SPV_SUCCESS, ValidateInstructions (SPV_ENV_VULKAN_1_3));
2070+ }
2071+
2072+ TEST_F (ValidateInterfacesTest, VectorIdVertexInputOutputPass) {
2073+ const std::string text = R"(
2074+ OpCapability Shader
2075+ OpCapability LongVectorEXT
2076+ OpExtension "SPV_EXT_long_vector"
2077+ OpMemoryModel Logical GLSL450
2078+ OpEntryPoint Vertex %main "main" %in %out
2079+ OpDecorate %in Location 0
2080+ OpDecorate %out Location 0
2081+ %void = OpTypeVoid
2082+ %f32 = OpTypeFloat 32
2083+ %u32 = OpTypeInt 32 0
2084+ %u4 = OpConstant %u32 4
2085+ %f32vec = OpTypeVectorIdEXT %f32 %u4
2086+ %in_ptr = OpTypePointer Input %f32vec
2087+ %out_ptr = OpTypePointer Output %f32vec
2088+ %in = OpVariable %in_ptr Input
2089+ %out = OpVariable %out_ptr Output
2090+ %void_fn = OpTypeFunction %void
2091+ %main = OpFunction %void None %void_fn
2092+ %entry = OpLabel
2093+ OpReturn
2094+ OpFunctionEnd
2095+ )" ;
2096+
2097+ CompileSuccessfully (text, SPV_ENV_VULKAN_1_3);
2098+ ASSERT_EQ (SPV_SUCCESS, ValidateInstructions (SPV_ENV_VULKAN_1_3));
2099+ }
2100+
20422101} // namespace
20432102} // namespace val
20442103} // namespace spvtools
0 commit comments