Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSpencer Fricke <spencerfricke@gmail.com>2022-08-18 20:42:25 +0300
committerGitHub <noreply@github.com>2022-08-18 20:42:25 +0300
commit3c1a14b2b609ae5a352e39ef6b5baf8f64c32ec7 (patch)
tree0e5d9ec4e9a8e5c8b228e2e1b35f89fae3c26fb2 /test
parent0073a1fa36f7c52ad3d58059cb5d5de8efa825ad (diff)
spirv-val: SBT Index for OpExecuteCallableKHR (#4900)
Diffstat (limited to 'test')
-rw-r--r--test/val/val_ray_tracing.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/val/val_ray_tracing.cpp b/test/val/val_ray_tracing.cpp
index 9486777a0..58b9356ce 100644
--- a/test/val/val_ray_tracing.cpp
+++ b/test/val/val_ray_tracing.cpp
@@ -334,6 +334,34 @@ OpFunctionEnd
"or IncomingCallableDataKHR"));
}
+TEST_F(ValidateRayTracing, ExecuteCallableSbtIndex) {
+ const std::string body = R"(
+OpCapability RayTracingKHR
+OpExtension "SPV_KHR_ray_tracing"
+OpMemoryModel Logical GLSL450
+OpEntryPoint CallableKHR %main "main"
+OpName %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%int = OpTypeInt 32 1
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%int_1 = OpConstant %int 1
+%data_ptr = OpTypePointer CallableDataKHR %int
+%data = OpVariable %data_ptr CallableDataKHR
+%main = OpFunction %void None %func
+%label = OpLabel
+OpExecuteCallableKHR %int_1 %data
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(body.c_str());
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("SBT Index must be a 32-bit unsigned int scalar"));
+}
+
std::string GenerateRayTraceCode(
const std::string& body,
const std::string execution_model = "RayGenerationKHR") {