Hash :
0e28c030
Author :
Date :
2025-04-02T17:26:28
ScalarizeVecAndMatConstructorArgs on WGSL shaders. WGSL does not support mixing types in the constructors of vectors and matrices. Use the ScalarizeVecAndMatConstructorArgs traverser to scalarize these constructors and update it to cast to the destination type if the inputs are not in that type already. Bug: angleproject:395659799 Change-Id: I4c270f2b18e79393e3c187916f33ad719bc88a63 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6427067 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
//
// Copyright 2002 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Scalarize vector and matrix constructor args, so that vectors built from components don't have
// matrix arguments, and matrices built from components don't have vector arguments. This avoids
// driver bugs around vector and matrix constructors.
//
#ifndef COMPILER_TRANSLATOR_TREEOPS_GLSL_SCALARIZEVECANDMATCONSTRUCTORARGS_H_
#define COMPILER_TRANSLATOR_TREEOPS_GLSL_SCALARIZEVECANDMATCONSTRUCTORARGS_H_
#include "GLSLANG/ShaderLang.h"
#include "common/angleutils.h"
#include "common/debug.h"
namespace sh
{
class TCompiler;
class TIntermBlock;
class TSymbolTable;
[[nodiscard]] bool ScalarizeVecAndMatConstructorArgs(TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_GLSL_SCALARIZEVECANDMATCONSTRUCTORARGS_H_