Skip to content

Commit

Permalink
Matching MSAA behavior from D3D
Browse files Browse the repository at this point in the history
This will make the max AA setting functionally unavailable as 8x will be out of range. However - this will be more consistant with Windows where the max AA setting is typically interperated as 4x or 6x.
  • Loading branch information
colincornaby committed Dec 26, 2023
1 parent cb0002a commit 651f95f
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,27 +186,14 @@ void plMetalDevice::SetMaxAnsiotropy(uint8_t maxAnsiotropy)

void plMetalDevice::SetMSAASampleCount(uint8_t sampleCount)
{
// Plasma has some MSAA levels that don't completely correspond to what Metal can do
// Best fit them to levels Metal can do. Once they are best fit see if the hardware
// is capable.

uint8_t actualSampleCount = 1;
if (sampleCount == 6) {
actualSampleCount = 8;
} else if (sampleCount == 4) {
actualSampleCount = 4;
} else if (sampleCount == 2) {
actualSampleCount = 2;
}

while (actualSampleCount != 1) {
while (sampleCount != 1) {
if (fMetalDevice->supportsTextureSampleCount(actualSampleCount)) {
break;
}
actualSampleCount /= 2;
sampleCount--;
}

fSampleCount = actualSampleCount;
fSampleCount = sampleCount;
}

void plMetalDevice::ReleaseSamplerStates()
Expand Down

0 comments on commit 651f95f

Please sign in to comment.