diff --git a/src/inspector/entry_point.h b/src/inspector/entry_point.h index ca72cca0b5..b652ba1e1b 100644 --- a/src/inspector/entry_point.h +++ b/src/inspector/entry_point.h @@ -92,6 +92,17 @@ InterpolationSampling ASTToInspectorInterpolationSampling( struct OverridableConstant { /// Name of the constant std::string name; + + /// Type of the scalar + enum class Type { + kBool, + kFloat32, + kUint32, + kInt32, + }; + + /// Type of the scalar + Type type; }; /// Reflection data for an entry point in the shader. diff --git a/src/inspector/inspector.cc b/src/inspector/inspector.cc index 1c1906ea9c..9118f398f3 100644 --- a/src/inspector/inspector.cc +++ b/src/inspector/inspector.cc @@ -197,6 +197,20 @@ std::vector Inspector::GetEntryPoints() { if (global && global->IsPipelineConstant()) { OverridableConstant overridable_constant; overridable_constant.name = name; + auto* type = var->Type(); + TINT_ASSERT(Inspector, type->is_scalar()); + if (type->is_bool_scalar_or_vector()) { + overridable_constant.type = OverridableConstant::Type::kBool; + } else if (type->is_float_scalar()) { + overridable_constant.type = OverridableConstant::Type::kFloat32; + } else if (type->is_signed_integer_scalar()) { + overridable_constant.type = OverridableConstant::Type::kInt32; + } else if (type->is_unsigned_integer_scalar()) { + overridable_constant.type = OverridableConstant::Type::kUint32; + } else { + TINT_UNREACHABLE(Inspector, diagnostics_); + } + entry_point.overridable_constants.push_back(overridable_constant); } }