|
1 | | -// Copyright 2024 The Dawn & Tint Authors |
| 1 | +// Copyright 2026 The Dawn & Tint Authors |
2 | 2 | // |
3 | 3 | // Redistribution and use in source and binary forms, with or without |
4 | 4 | // modification, are permitted provided that the following conditions are met: |
|
25 | 25 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 | 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
|
28 | | -#ifndef SRC_TINT_LANG_CORE_IR_TRANSFORM_DECOMPOSE_UNIFORM_ACCESS_H_ |
29 | | -#define SRC_TINT_LANG_CORE_IR_TRANSFORM_DECOMPOSE_UNIFORM_ACCESS_H_ |
| 28 | +#ifndef SRC_TINT_API_COMMON_WORKGROUP_INFO_H_ |
| 29 | +#define SRC_TINT_API_COMMON_WORKGROUP_INFO_H_ |
30 | 30 |
|
31 | | -#include "src/tint/utils/result.h" |
| 31 | +#include <cstddef> |
| 32 | +#include <cstdint> |
| 33 | +#include <optional> |
32 | 34 |
|
33 | | -// Forward declarations. |
34 | | -namespace tint::core::ir { |
35 | | -class Module; |
36 | | -} // namespace tint::core::ir |
| 35 | +namespace tint { |
37 | 36 |
|
38 | | -namespace tint::core::ir::transform { |
| 37 | +/// Workgroup size information, which is part of the output of shader generation. |
| 38 | +struct WorkgroupInfo { |
| 39 | + /// The x-component |
| 40 | + uint32_t x = 0; |
| 41 | + /// The y-component |
| 42 | + uint32_t y = 0; |
| 43 | + /// The z-component |
| 44 | + uint32_t z = 0; |
39 | 45 |
|
40 | | -/// DecomposeUniformAccess is a transform used to replace uniform buffer accesses with a |
41 | | -/// the correct load of the HLSL primitive objects |
42 | | -/// |
43 | | -/// @param module the module to transform |
44 | | -/// @returns success or failure |
45 | | -Result<SuccessType> DecomposeUniformAccess(core::ir::Module& module); |
| 46 | + /// The needed workgroup storage size |
| 47 | + size_t storage_size = 0; |
46 | 48 |
|
47 | | -} // namespace tint::core::ir::transform |
| 49 | + /// The `@subgroup_size` attribute |
| 50 | + std::optional<uint32_t> subgroup_size; |
| 51 | +}; |
48 | 52 |
|
49 | | -#endif // SRC_TINT_LANG_CORE_IR_TRANSFORM_DECOMPOSE_UNIFORM_ACCESS_H_ |
| 53 | +} // namespace tint |
| 54 | + |
| 55 | +#endif // SRC_TINT_API_COMMON_WORKGROUP_INFO_H_ |
0 commit comments