Skip to content
Snippets Groups Projects
Commit 92d05ce5 authored by David Neto's avatar David Neto
Browse files

Use statically typed compilation results in C++ API

Class shaderc::CompilationResult is a template over the element type for
the compilation output. It has three specializations: for a SPIR-V
binary module (with uint32_t element type), SPIR-V assembly text (char
element type), and preprocessed source (char element type).

The compilation output is accessed via cbegin(), cend() and begin()
end() iterators.

Test code updates:
- Add 'using' declarations for all three compilation result
  classes.
- Add const to compilation result variables, where possible.
- IsValidSpv should take an SpvCompilationResult, and should not
  be parameterized over compilation result types.
- IsValidSpv should take an SpvCompilationResult
- Test PreprocessingOnlyOption should use a
  PreprocessedSourceCompilationResult variable instead of an
  AssemblyCompilationResult variable.

Remove SetDisassemblyMode and SetPreprocessOnlyMode methods on the
CompileOptions object so we can't get the wrong output by mixing up
options with compilation methods.

Removed FileCompiler members disassemble_ and preprocess_only_

Remove Disassembly and PreprocessOnly options on shaderc_util::Compiler

C API changes:

- Use different compile functions in the C API for different output types.
- Remove disassembly mode and preprocess-only mode calls.
parent 1f84b05e
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment