Hash :
63d8f74c
Author :
Date :
2025-08-12T19:39:03
WGSL: move DeclareDefaultUniforms() out of SPIR-V WGSL needs the same thing (default uniforms gathered into an interface block). Changes 3 things in the file move: 1. Now capable of adding a named interface block (Vulkan's is nameless) to hold the default uniforms. 2. Removes inactive uniforms 3. Deals with the case where there are no active default uniforms, by not declaring an interface block at all. Bug: angleproject:376553328 Change-Id: Ia25318b4db93068010c3c44414cd00803b783799 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6843929 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
//
// Copyright 2020 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.
//
#ifndef COMPILER_TRANSLATOR_TREEOPS_MSL_REDUCEINTERFACEBLOCKS_H_
#define COMPILER_TRANSLATOR_TREEOPS_MSL_REDUCEINTERFACEBLOCKS_H_
#include <functional>
#include "common/angleutils.h"
#include "compiler/translator/Compiler.h"
namespace sh
{
class TSymbolTable;
using InterfaceBlockInstanceVarNameGen = std::function<ImmutableString()>;
// This rewrites interface block declarations only.
//
// Example:
// uniform Foo { int x; } foo;
// Becomes:
// struct Foo { int x; }; uniform Foo x;
//
[[nodiscard]] bool ReduceInterfaceBlocks(TCompiler &compiler,
TIntermBlock &root,
InterfaceBlockInstanceVarNameGen nameGen);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_MSL_REDUCEINTERFACEBLOCKS_H_