KhronosGroup / KhronosGroup/SPIRV-Tools

Make spvBinaryToText() independent of context and env

Open
#1,652 1 comment 0 reactions 0 assignees View on GitHub
component:as/dis
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

Currently, it seems one must do the following to get SPIR-V disassembled:

```
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_3); // what env to use?
spvBinaryToText(context, ...
```

A SPIR-V binary stands alone, with no side-band environment information needed to understand it.

Hence, I would worry if `spvBinaryToText()` behavior is dependent on `context` that something might be wrong, but if not then it would be irrelevant.

So, it seems this parameter should not be present, and indeed, an independent consumer of SPIRV-Tools like glslang does not really know how to come up with an `env` enumerant.

Can this dependency be removed?

Contributor guide

Open the contributing guide

Research direction

Start by locating the declaration, implementation, and callers of spvBinaryToText(), then inspect how its spv_context parameter affects disassembly. Check the API usage from the issue, including the glslang integration if available; done means the function no longer requires environment context and existing callers still build and behave correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.