summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/maxwell_3d.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2022-11-29 14:04:40 +0100
committerLioncash <mathew1800@gmail.com>2022-11-29 14:38:46 +0100
commitd7ec031419f7eef3f85210659cf7f6dc8c50d791 (patch)
treeccc3c652023497a48af86a2842480d88949c2804 /src/video_core/engines/maxwell_3d.h
parentMerge pull request #9325 from german77/default_by_default (diff)
downloadyuzu-d7ec031419f7eef3f85210659cf7f6dc8c50d791.tar
yuzu-d7ec031419f7eef3f85210659cf7f6dc8c50d791.tar.gz
yuzu-d7ec031419f7eef3f85210659cf7f6dc8c50d791.tar.bz2
yuzu-d7ec031419f7eef3f85210659cf7f6dc8c50d791.tar.lz
yuzu-d7ec031419f7eef3f85210659cf7f6dc8c50d791.tar.xz
yuzu-d7ec031419f7eef3f85210659cf7f6dc8c50d791.tar.zst
yuzu-d7ec031419f7eef3f85210659cf7f6dc8c50d791.zip
Diffstat (limited to 'src/video_core/engines/maxwell_3d.h')
-rw-r--r--src/video_core/engines/maxwell_3d.h73
1 files changed, 25 insertions, 48 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 84c497ebd..cd334f188 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -96,8 +96,7 @@ public:
u32 type;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -106,8 +105,7 @@ public:
u32 address_low;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -124,8 +122,7 @@ public:
Mode mode;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(offset_high) << 32) |
- offset_low);
+ return (GPUVAddr{offset_high} << 32) | GPUVAddr{offset_low};
}
};
@@ -468,8 +465,7 @@ public:
INSERT_PADDING_BYTES_NOINIT(0xC);
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
static_assert(sizeof(Buffer) == 0x20);
@@ -511,12 +507,11 @@ public:
u32 default_size_per_warp;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
u64 Size() const {
- return (static_cast<u64>(size_high) << 32) | size_low;
+ return (u64{size_high} << 32) | u64{size_low};
}
};
@@ -538,13 +533,11 @@ public:
u32 storage_limit_address_low;
GPUVAddr StorageAddress() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(storage_address_high) << 32) |
- storage_address_low);
+ return (GPUVAddr{storage_address_high} << 32) | GPUVAddr{storage_address_low};
}
GPUVAddr StorageLimitAddress() const {
- return static_cast<GPUVAddr>(
- (static_cast<GPUVAddr>(storage_limit_address_high) << 32) |
- storage_limit_address_low);
+ return (GPUVAddr{storage_limit_address_high} << 32) |
+ GPUVAddr{storage_limit_address_low};
}
};
@@ -1138,8 +1131,7 @@ public:
INSERT_PADDING_BYTES_NOINIT(0x18);
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
static_assert(sizeof(RenderTargetConfig) == 0x40);
@@ -1482,8 +1474,7 @@ public:
u32 address_low;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -1533,8 +1524,7 @@ public:
u32 address_low;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -1561,8 +1551,7 @@ public:
u32 array_pitch;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -1910,8 +1899,7 @@ public:
Mode mode;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -1921,8 +1909,7 @@ public:
u32 limit;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -1932,8 +1919,7 @@ public:
u32 limit;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -1981,8 +1967,7 @@ public:
u32 address_low;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -2027,8 +2012,7 @@ public:
u32 address_low;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -2224,19 +2208,16 @@ public:
}
GPUVAddr StartAddress() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(start_addr_high) << 32) |
- start_addr_low);
+ return (GPUVAddr{start_addr_high} << 32) | GPUVAddr{start_addr_low};
}
GPUVAddr EndAddress() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(limit_addr_high) << 32) |
- limit_addr_low);
+ return (GPUVAddr{limit_addr_high} << 32) | GPUVAddr{limit_addr_low};
}
/// Adjust the index buffer offset so it points to the first desired index.
GPUVAddr IndexStart() const {
- return StartAddress() +
- static_cast<size_t>(first) * static_cast<size_t>(FormatSizeInBytes());
+ return StartAddress() + size_t{first} * size_t{FormatSizeInBytes()};
}
};
@@ -2464,8 +2445,7 @@ public:
} query;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
@@ -2479,8 +2459,7 @@ public:
u32 frequency;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
bool IsEnabled() const {
@@ -2494,8 +2473,7 @@ public:
u32 address_low;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};
static_assert(sizeof(VertexStreamLimit) == 0x8);
@@ -2543,8 +2521,7 @@ public:
std::array<u32, NumCBData> buffer;
GPUVAddr Address() const {
- return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
- address_low);
+ return (GPUVAddr{address_high} << 32) | GPUVAddr{address_low};
}
};