KhronosGroup / KhronosGroup/SPIRV-Tools

validate minimum SPIR-V version for operands

Open
#1,602 2 comments 0 reactions 1 assignee Claimed by @dneto0 View on GitHub
component:validation
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

VersionCheck in validate_instruction.cpp checks minimum version for a SPIR-V opcode. But it ignores min-version constraints on operands.

For example, when assembled with --target-env spv1.0, the following should fail validation because StorageBuffer is not in SPIR-V 1.0 core. (StorageBuffer is enabled by SPV_KHR_storage_buffer_storage_class)
```
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 3
; Schema: 0
OpCapability Shader
OpCapability Linkage
OpMemoryModel Logical GLSL450
%uint = OpTypeInt 32 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.