mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-08 21:17:45 +00:00
Add support for SPIRV writing to BUILD.gn
BUG=tint:48 Change-Id: I6b92bb372b783ad4498fdc4817d0893851b0bb90 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19680 Reviewed-by: dan sinclair <dsinclair@google.com>
This commit is contained in:
@@ -223,7 +223,7 @@ uint32_t Builder::GenerateExpressionAndLoad(ast::Expression* expr) {
|
||||
error_ = "missing generated ID for variable";
|
||||
return 0;
|
||||
}
|
||||
auto var = spirv_id_to_variable_[id];
|
||||
auto* var = spirv_id_to_variable_[id];
|
||||
if (var->is_const()) {
|
||||
return id;
|
||||
}
|
||||
@@ -457,7 +457,7 @@ uint32_t Builder::GenerateConstructorExpression(
|
||||
return GenerateLiteralIfNeeded(expr->AsScalarConstructor()->literal());
|
||||
}
|
||||
if (expr->IsTypeConstructor()) {
|
||||
auto init = expr->AsTypeConstructor();
|
||||
auto* init = expr->AsTypeConstructor();
|
||||
auto type_id = GenerateTypeIfNeeded(init->type());
|
||||
if (type_id == 0) {
|
||||
return 0;
|
||||
@@ -568,7 +568,7 @@ uint32_t Builder::GenerateBinaryExpression(ast::BinaryExpression* expr) {
|
||||
|
||||
// Handle int and float and the vectors of those types. Other types
|
||||
// should have been rejected by validation.
|
||||
auto lhs_type = expr->lhs()->result_type();
|
||||
auto* lhs_type = expr->lhs()->result_type();
|
||||
bool lhs_is_float_or_vec =
|
||||
lhs_type->IsF32() ||
|
||||
(lhs_type->IsVector() && lhs_type->AsVector()->type()->IsF32());
|
||||
@@ -888,7 +888,7 @@ bool Builder::GeneratePointerType(ast::type::PointerType* ptr,
|
||||
bool Builder::GenerateStructType(ast::type::StructType* struct_type,
|
||||
const Operand& result) {
|
||||
auto struct_id = result.to_i();
|
||||
auto impl = struct_type->impl();
|
||||
auto* impl = struct_type->impl();
|
||||
|
||||
if (!struct_type->name().empty()) {
|
||||
push_debug(spv::Op::OpName,
|
||||
|
||||
@@ -27,6 +27,8 @@ Function::Function(const Instruction& declaration,
|
||||
const std::vector<Instruction>& params)
|
||||
: declaration_(declaration), label_op_(label_op), params_(params) {}
|
||||
|
||||
Function::Function(const Function& other) = default;
|
||||
|
||||
Function::~Function() = default;
|
||||
|
||||
void Function::iterate(std::function<void(const Instruction&)> cb) const {
|
||||
|
||||
@@ -42,7 +42,7 @@ class Function {
|
||||
const std::vector<Instruction>& params);
|
||||
/// Copy constructor
|
||||
/// @param other the function to copy
|
||||
Function(const Function& other) = default;
|
||||
Function(const Function& other);
|
||||
~Function();
|
||||
|
||||
/// Iterates over the function call the cb on each instruction
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace spirv {
|
||||
Instruction::Instruction(spv::Op op, std::vector<Operand> operands)
|
||||
: op_(op), operands_(std::move(operands)) {}
|
||||
|
||||
Instruction::Instruction(const Instruction&) = default;
|
||||
|
||||
Instruction::~Instruction() = default;
|
||||
|
||||
uint32_t Instruction::word_length() const {
|
||||
|
||||
@@ -32,7 +32,7 @@ class Instruction {
|
||||
/// @param operands the operand values for the instruction
|
||||
Instruction(spv::Op op, std::vector<Operand> operands);
|
||||
/// Copy Constructor
|
||||
Instruction(const Instruction&) = default;
|
||||
Instruction(const Instruction&);
|
||||
~Instruction();
|
||||
|
||||
/// @returns the instructions op
|
||||
|
||||
Reference in New Issue
Block a user