Browse Source

inline?

Signed-off-by: lizzie <lizzie@eden-emu.dev>
pull/2900/head
lizzie 3 months ago
committed by crueter
parent
commit
4ef214b19d
  1. 8
      src/shader_recompiler/frontend/ir/attribute.h
  2. 2
      src/shader_recompiler/frontend/ir/flow_test.h

8
src/shader_recompiler/frontend/ir/attribute.h

@ -235,23 +235,23 @@ enum class Attribute : u64 {
constexpr size_t NUM_GENERICS = 32;
constexpr size_t NUM_FIXEDFNCTEXTURE = 10;
[[nodiscard]] bool IsGeneric(Attribute attribute) noexcept {
[[nodiscard]] inline bool IsGeneric(Attribute attribute) noexcept {
return attribute >= Attribute::Generic0X && attribute <= Attribute::Generic31X;
}
[[nodiscard]] u32 GenericAttributeIndex(Attribute attribute) {
[[nodiscard]] inline u32 GenericAttributeIndex(Attribute attribute) {
if (!IsGeneric(attribute))
throw InvalidArgument("Attribute is not generic {}", attribute);
return (u32(attribute) - u32(Attribute::Generic0X)) / 4u;
}
[[nodiscard]] u32 GenericAttributeElement(Attribute attribute) {
[[nodiscard]] inline u32 GenericAttributeElement(Attribute attribute) {
if (!IsGeneric(attribute))
throw InvalidArgument("Attribute is not generic {}", attribute);
return u32(attribute) % 4;
}
[[nodiscard]] std::string NameOf(Attribute attribute) {
[[nodiscard]] inline std::string NameOf(Attribute attribute) {
switch (attribute) {
#define SRIR_ATTRIBUTE_ELEM(n, v) case Attribute::n: return #n;
SRIR_ATTRIBUTE_LIST

2
src/shader_recompiler/frontend/ir/flow_test.h

@ -52,7 +52,7 @@ enum class FlowTest : u64 {
#undef SRIR_FLOW_TEST_ELEM
};
[[nodiscard]] std::string NameOf(FlowTest flow_test) {
[[nodiscard]] inline std::string NameOf(FlowTest flow_test) {
switch (flow_test) {
#define SRIR_FLOW_TEST_ELEM(n) case FlowTest::n: return #n;
SRIR_FLOW_TEST_LIST

Loading…
Cancel
Save