Update spirv-tools and add spirv-headers
This commit is contained in:
@@ -50,7 +50,8 @@ size_t SpirvAssembler::Result::word_count() const {
|
||||
return binary_ ? binary_->wordCount : 0;
|
||||
}
|
||||
|
||||
SpirvAssembler::SpirvAssembler() : spv_context_(spvContextCreate()) {}
|
||||
SpirvAssembler::SpirvAssembler()
|
||||
: spv_context_(spvContextCreate(SPV_ENV_VULKAN_1_0)) {}
|
||||
|
||||
SpirvAssembler::~SpirvAssembler() { spvContextDestroy(spv_context_); }
|
||||
|
||||
|
||||
@@ -53,7 +53,8 @@ void SpirvDisassembler::Result::AppendText(StringBuffer* target_buffer) const {
|
||||
}
|
||||
}
|
||||
|
||||
SpirvDisassembler::SpirvDisassembler() : spv_context_(spvContextCreate()) {}
|
||||
SpirvDisassembler::SpirvDisassembler()
|
||||
: spv_context_(spvContextCreate(SPV_ENV_VULKAN_1_0)) {}
|
||||
|
||||
SpirvDisassembler::~SpirvDisassembler() { spvContextDestroy(spv_context_); }
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#ifndef XENIA_UI_SPIRV_SPIRV_UTIL_H_
|
||||
#define XENIA_UI_SPIRV_SPIRV_UTIL_H_
|
||||
|
||||
#include "third_party/spirv-headers/include/spirv/1.1/spirv.hpp11"
|
||||
#include "third_party/spirv/GLSL.std.450.hpp11"
|
||||
#include "third_party/spirv/spirv.hpp11"
|
||||
|
||||
// Forward declarations from SPIRV-Tools so we don't pollute /so/ much.
|
||||
struct spv_binary_t;
|
||||
|
||||
@@ -53,7 +53,8 @@ void SpirvValidator::Result::AppendText(StringBuffer* target_buffer) const {
|
||||
}
|
||||
}
|
||||
|
||||
SpirvValidator::SpirvValidator() : spv_context_(spvContextCreate()) {}
|
||||
SpirvValidator::SpirvValidator()
|
||||
: spv_context_(spvContextCreate(SPV_ENV_UNIVERSAL_1_1)) {}
|
||||
SpirvValidator::~SpirvValidator() { spvContextDestroy(spv_context_); }
|
||||
|
||||
std::unique_ptr<SpirvValidator::Result> SpirvValidator::Validate(
|
||||
@@ -61,8 +62,7 @@ std::unique_ptr<SpirvValidator::Result> SpirvValidator::Validate(
|
||||
spv_text text = nullptr;
|
||||
spv_diagnostic diagnostic = nullptr;
|
||||
spv_const_binary_t binary = {words, word_count};
|
||||
auto result_code =
|
||||
spvValidate(spv_context_, &binary, SPV_VALIDATE_ALL, &diagnostic);
|
||||
auto result_code = spvValidate(spv_context_, &binary, &diagnostic);
|
||||
std::unique_ptr<Result> result(new Result(text, diagnostic));
|
||||
if (result_code) {
|
||||
XELOGE("Failed to validate spv: %d", result_code);
|
||||
|
||||
Reference in New Issue
Block a user