mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-12 21:58:34 +02:00
[vk] Sample Locations ordering
This commit is contained in:
parent
9190b6c761
commit
9411fcd352
1 changed files with 16 additions and 7 deletions
|
|
@ -52,6 +52,15 @@ using VideoCommon::ImageViewType;
|
||||||
namespace {
|
namespace {
|
||||||
constexpr float SAMPLE_LOCATION_SCALE = 1.0f / 16.0f;
|
constexpr float SAMPLE_LOCATION_SCALE = 1.0f / 16.0f;
|
||||||
|
|
||||||
|
bool SampleLocationsEqual(const std::array<VkSampleLocationEXT, VideoCommon::MaxSampleLocationSlots>& lhs,
|
||||||
|
const std::array<VkSampleLocationEXT, VideoCommon::MaxSampleLocationSlots>& rhs,
|
||||||
|
u32 count) {
|
||||||
|
return std::equal(lhs.begin(), lhs.begin() + count, rhs.begin(), rhs.begin() + count,
|
||||||
|
[](const VkSampleLocationEXT& a, const VkSampleLocationEXT& b) {
|
||||||
|
return a.x == b.x && a.y == b.y;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
std::array<VkSampleLocationEXT, VideoCommon::MaxSampleLocationSlots>
|
std::array<VkSampleLocationEXT, VideoCommon::MaxSampleLocationSlots>
|
||||||
DecodeSampleLocationRegisters(const Maxwell& regs) {
|
DecodeSampleLocationRegisters(const Maxwell& regs) {
|
||||||
std::array<VkSampleLocationEXT, VideoCommon::MaxSampleLocationSlots> decoded{};
|
std::array<VkSampleLocationEXT, VideoCommon::MaxSampleLocationSlots> decoded{};
|
||||||
|
|
@ -1710,13 +1719,13 @@ void RasterizerVulkan::UpdateSampleLocations(Maxwell& regs) {
|
||||||
.height = grid_height,
|
.height = grid_height,
|
||||||
};
|
};
|
||||||
|
|
||||||
const bool pattern_changed = !sample_location_state.initialized ||
|
const bool pattern_changed =
|
||||||
sample_location_state.msaa_mode != msaa_mode ||
|
!sample_location_state.initialized || sample_location_state.msaa_mode != msaa_mode ||
|
||||||
sample_location_state.grid_size.width != grid_size.width ||
|
sample_location_state.grid_size.width != grid_size.width ||
|
||||||
sample_location_state.grid_size.height != grid_size.height ||
|
sample_location_state.grid_size.height != grid_size.height ||
|
||||||
sample_location_state.samples_per_pixel != vk_samples ||
|
sample_location_state.samples_per_pixel != vk_samples ||
|
||||||
sample_location_state.locations_count != sample_locations_count ||
|
sample_location_state.locations_count != sample_locations_count ||
|
||||||
sample_location_state.locations != resolved;
|
!SampleLocationsEqual(sample_location_state.locations, resolved, sample_locations_count);
|
||||||
|
|
||||||
const bool dirty = state_tracker.TouchSampleLocations() || pattern_changed;
|
const bool dirty = state_tracker.TouchSampleLocations() || pattern_changed;
|
||||||
if (!dirty) {
|
if (!dirty) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue