Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion 3rdparty/cgltf/cgltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ typedef enum cgltf_meshopt_compression_filter {
cgltf_meshopt_compression_filter_octahedral,
cgltf_meshopt_compression_filter_quaternion,
cgltf_meshopt_compression_filter_exponential,
cgltf_meshopt_compression_filter_color,
cgltf_meshopt_compression_filter_max_enum
} cgltf_meshopt_compression_filter;

Expand All @@ -308,6 +309,7 @@ typedef struct cgltf_meshopt_compression
cgltf_size count;
cgltf_meshopt_compression_mode mode;
cgltf_meshopt_compression_filter filter;
cgltf_bool is_khr;
} cgltf_meshopt_compression;

typedef struct cgltf_buffer_view
Expand Down Expand Up @@ -1661,8 +1663,8 @@ cgltf_result cgltf_validate(cgltf_data* data)
CGLTF_ASSERT_IF((mc->mode == cgltf_meshopt_compression_mode_triangles || mc->mode == cgltf_meshopt_compression_mode_indices) && mc->filter != cgltf_meshopt_compression_filter_none, cgltf_result_invalid_gltf);

CGLTF_ASSERT_IF(mc->filter == cgltf_meshopt_compression_filter_octahedral && mc->stride != 4 && mc->stride != 8, cgltf_result_invalid_gltf);

CGLTF_ASSERT_IF(mc->filter == cgltf_meshopt_compression_filter_quaternion && mc->stride != 8, cgltf_result_invalid_gltf);
CGLTF_ASSERT_IF(mc->filter == cgltf_meshopt_compression_filter_color && mc->stride != 4 && mc->stride != 8, cgltf_result_invalid_gltf);
}
}

Expand Down Expand Up @@ -5118,6 +5120,10 @@ static int cgltf_parse_json_meshopt_compression(cgltf_options* options, jsmntok_
{
out_meshopt_compression->filter = cgltf_meshopt_compression_filter_exponential;
}
else if (cgltf_json_strcmp(tokens+i, json_chunk, "COLOR") == 0)
{
out_meshopt_compression->filter = cgltf_meshopt_compression_filter_color;
}
++i;
}
else
Expand Down Expand Up @@ -5228,6 +5234,12 @@ static int cgltf_parse_json_buffer_view(cgltf_options* options, jsmntok_t const*
out_buffer_view->has_meshopt_compression = 1;
i = cgltf_parse_json_meshopt_compression(options, tokens, i + 1, json_chunk, &out_buffer_view->meshopt_compression);
}
else if (cgltf_json_strcmp(tokens+i, json_chunk, "KHR_meshopt_compression") == 0)
{
out_buffer_view->has_meshopt_compression = 1;
out_buffer_view->meshopt_compression.is_khr = 1;
i = cgltf_parse_json_meshopt_compression(options, tokens, i + 1, json_chunk, &out_buffer_view->meshopt_compression);
}
else
{
i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_buffer_view->extensions[out_buffer_view->extensions_count++]));
Expand Down
21 changes: 13 additions & 8 deletions 3rdparty/dawn/include/tint/tint.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@
// TODO(tint:88): When implementing support for an install target, all of these
// headers will need to be moved to include/tint/.

#include "src/tint/api/common/subgroup_matrix.h"
#include "src/tint/api/common/substitute_overrides_config.h"
#include "src/tint/api/common/vertex_pulling_config.h"
#include "src/tint/api/tint.h"
#include "src/tint/lang/core/type/manager.h"
#include "src/tint/lang/wgsl/inspector/inspector.h"
#include "src/tint/utils/diagnostic/formatter.h"
#include "src/tint/utils/text/styled_text.h"
#include "src/tint/api/common/binding_point.h" // IWYU pragma: export
#include "src/tint/api/common/resource_type.h" // IWYU pragma: export
#include "src/tint/api/common/subgroup_matrix.h" // IWYU pragma: export
#include "src/tint/api/common/substitute_overrides_config.h" // IWYU pragma: export
#include "src/tint/api/common/vertex_pulling_config.h" // IWYU pragma: export
#include "src/tint/api/common/workgroup_info.h" // IWYU pragma: export
#include "src/tint/api/tint.h" // IWYU pragma: export
#include "src/tint/lang/core/type/manager.h" // IWYU pragma: export
#include "src/tint/lang/wgsl/enums.h" // IWYU pragma: export
#include "src/tint/lang/wgsl/feature_status.h" // IWYU pragma: export
#include "src/tint/lang/wgsl/inspector/inspector.h" // IWYU pragma: export
#include "src/tint/utils/diagnostic/formatter.h" // IWYU pragma: export
#include "src/tint/utils/text/styled_text.h" // IWYU pragma: export

///////////////
// NOTE if adding a new guard include here, it must also appear in src/tint/api/tint.cc for the
Expand Down
104 changes: 59 additions & 45 deletions 3rdparty/dawn/include/webgpu/webgpu.h

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions 3rdparty/dawn/src/tint/api/common/override_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define SRC_TINT_API_COMMON_OVERRIDE_ID_H_

#include <stdint.h>

#include <functional>

#include "src/tint/utils/math/hash.h"
Expand Down
2 changes: 2 additions & 0 deletions 3rdparty/dawn/src/tint/api/common/resource_table_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct ResourceTableConfig {
BindingPoint resource_table_binding;

// The binding point for the supporting storage buffer. This is a post-remapping binding point.
// TODO(crbug.com/435317394): Rename to metadata_buffer_binding
BindingPoint storage_buffer_binding;

// The ordering of default bindings which are placed after the user bindings. These will be used
Expand Down Expand Up @@ -91,6 +92,7 @@ struct ResourceTableConfig {
resource_table_binding,
storage_buffer_binding,
default_binding_type_order);
TINT_REFLECT_EQUALS(ResourceTableConfig);
};

} // namespace tint
Expand Down
22 changes: 16 additions & 6 deletions 3rdparty/dawn/src/tint/api/common/resource_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,28 @@ namespace tint {
enum class ResourceType : uint32_t {
kEmpty,

kTexture1d_f32,
kTexture1d_f32_filterable,
kTexture1d_f32_unfilterable,
kTexture1d_i32,
kTexture1d_u32,
kTexture2d_f32,
kTexture2d_f32_filterable,
kTexture2d_f32_unfilterable,
kTexture2d_i32,
kTexture2d_u32,
kTexture2dArray_f32,
kTexture2dArray_f32_filterable,
kTexture2dArray_f32_unfilterable,
kTexture2dArray_i32,
kTexture2dArray_u32,
kTexture3d_f32,
kTexture3d_f32_filterable,
kTexture3d_f32_unfilterable,
kTexture3d_i32,
kTexture3d_u32,
kTextureCube_f32,
kTextureCube_f32_filterable,
kTextureCube_f32_unfilterable,
kTextureCube_i32,
kTextureCube_u32,
kTextureCubeArray_f32,
kTextureCubeArray_f32_filterable,
kTextureCubeArray_f32_unfilterable,
kTextureCubeArray_i32,
kTextureCubeArray_u32,

Expand All @@ -63,6 +69,10 @@ enum class ResourceType : uint32_t {
kTextureDepthCube,
kTextureDepthCubeArray,
kTextureDepthMultisampled2d,

kSampler_filtering,
kSampler_non_filtering,
kSampler_comparison,
};
TINT_REFLECT_ENUM_RANGE(tint::ResourceType, kEmpty, kTextureDepthMultisampled2d);

Expand Down
1 change: 0 additions & 1 deletion 3rdparty/dawn/src/tint/api/common/subgroup_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <unordered_set>

#include "src/tint/utils/math/hash.h"

#include "src/tint/utils/reflection.h"

namespace tint {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Dawn & Tint Authors
// Copyright 2026 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
Expand All @@ -25,25 +25,31 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#ifndef SRC_TINT_LANG_CORE_IR_TRANSFORM_DECOMPOSE_UNIFORM_ACCESS_H_
#define SRC_TINT_LANG_CORE_IR_TRANSFORM_DECOMPOSE_UNIFORM_ACCESS_H_
#ifndef SRC_TINT_API_COMMON_WORKGROUP_INFO_H_
#define SRC_TINT_API_COMMON_WORKGROUP_INFO_H_

#include "src/tint/utils/result.h"
#include <cstddef>
#include <cstdint>
#include <optional>

// Forward declarations.
namespace tint::core::ir {
class Module;
} // namespace tint::core::ir
namespace tint {

namespace tint::core::ir::transform {
/// Workgroup size information, which is part of the output of shader generation.
struct WorkgroupInfo {
/// The x-component
uint32_t x = 0;
/// The y-component
uint32_t y = 0;
/// The z-component
uint32_t z = 0;

/// DecomposeUniformAccess is a transform used to replace uniform buffer accesses with a
/// the correct load of the HLSL primitive objects
///
/// @param module the module to transform
/// @returns success or failure
Result<SuccessType> DecomposeUniformAccess(core::ir::Module& module);
/// The needed workgroup storage size
size_t storage_size = 0;

} // namespace tint::core::ir::transform
/// The `@subgroup_size` attribute
std::optional<uint32_t> subgroup_size;
};

#endif // SRC_TINT_LANG_CORE_IR_TRANSFORM_DECOMPOSE_UNIFORM_ACCESS_H_
} // namespace tint

#endif // SRC_TINT_API_COMMON_WORKGROUP_INFO_H_
1 change: 1 addition & 0 deletions 3rdparty/dawn/src/tint/lang/core/constant/invalid.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define SRC_TINT_LANG_CORE_CONSTANT_INVALID_H_

#include <variant>

#include "src/tint/lang/core/constant/value.h"
#include "src/tint/lang/core/number.h"
#include "src/tint/lang/core/type/invalid.h"
Expand Down
6 changes: 6 additions & 0 deletions 3rdparty/dawn/src/tint/lang/core/constant/manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "src/tint/lang/core/type/i8.h"
#include "src/tint/lang/core/type/manager.h"
#include "src/tint/lang/core/type/matrix.h"
#include "src/tint/lang/core/type/u16.h"
#include "src/tint/lang/core/type/u32.h"
#include "src/tint/lang/core/type/u64.h"
#include "src/tint/lang/core/type/u8.h"
Expand Down Expand Up @@ -115,6 +116,10 @@ const Scalar<u8>* Manager::Get(u8 value) {
return Get<Scalar<u8>>(types.u8(), value);
}

const Scalar<u16>* Manager::Get(u16 value) {
return Get<Scalar<u16>>(types.u16(), value);
}

const Scalar<f32>* Manager::Get(f32 value) {
return Get<Scalar<f32>>(types.f32(), value);
}
Expand Down Expand Up @@ -182,6 +187,7 @@ const Value* Manager::Zero(const core::type::Type* type) {
[&](const core::type::U32*) { return Get(u32(0)); }, //
[&](const core::type::I8*) { return Get(i8(0)); }, //
[&](const core::type::U8*) { return Get(u8(0)); }, //
[&](const core::type::U16*) { return Get(u16(0)); }, //
[&](const core::type::U64*) { return Get(u64(0)); }, //
[&](const core::type::F32*) { return Get(f32(0)); }, //
[&](const core::type::F16*) { return Get(f16(0)); }, //
Expand Down
4 changes: 4 additions & 0 deletions 3rdparty/dawn/src/tint/lang/core/constant/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ class Manager final {
/// @return a Scalar holding the u8 value @p value
const Scalar<u8>* Get(u8 value);

/// @param value the constant value
/// @return a Scalar holding the u16 value @p value
const Scalar<u16>* Get(u16 value);

/// @param value the constant value
/// @return a Scalar holding the f32 value @p value
const Scalar<f32>* Get(f32 value);
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/dawn/src/tint/lang/core/constant/scalar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::core::constant::Scalar<tint::core::i8>);
TINT_INSTANTIATE_TYPEINFO(tint::core::constant::Scalar<tint::core::u32>);
TINT_INSTANTIATE_TYPEINFO(tint::core::constant::Scalar<tint::core::u64>);
TINT_INSTANTIATE_TYPEINFO(tint::core::constant::Scalar<tint::core::u8>);
TINT_INSTANTIATE_TYPEINFO(tint::core::constant::Scalar<tint::core::u16>);
TINT_INSTANTIATE_TYPEINFO(tint::core::constant::Scalar<tint::core::f16>);
TINT_INSTANTIATE_TYPEINFO(tint::core::constant::Scalar<tint::core::f32>);
TINT_INSTANTIATE_TYPEINFO(tint::core::constant::Scalar<bool>);
Expand Down
Loading