mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 16:37:08 +00:00
writer/hlsl: Support bitcast of vectors
Add end to end tests Fixed: tint:1026 Change-Id: I10813cbe6dc4f1bccddf9a8a29e3a249a364c051 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59663 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
dcd3dcec70
commit
64dfcd2c32
@@ -268,6 +268,10 @@ bool GeneratorImpl::EmitArrayAccessor(std::ostream& out,
|
||||
bool GeneratorImpl::EmitBitcast(std::ostream& out,
|
||||
ast::BitcastExpression* expr) {
|
||||
auto* type = TypeOf(expr);
|
||||
if (auto* vec = type->UnwrapRef()->As<sem::Vector>()) {
|
||||
type = vec->type();
|
||||
}
|
||||
|
||||
if (!type->is_integer_scalar() && !type->is_float_scalar()) {
|
||||
diagnostics_.add_error(diag::System::Writer,
|
||||
"Unable to do bitcast to type " + type->type_name());
|
||||
|
||||
Reference in New Issue
Block a user