Skip to content

Commit

Permalink
Test Drive: Allow virtual framebuffer copies. This eliminates the hyp…
Browse files Browse the repository at this point in the history
…er expensive readbacks.

Write some comments in Depal about how we could get rid of the banding.
  • Loading branch information
hrydgard committed Aug 29, 2020
1 parent 950469f commit 65b8c36
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 12 additions & 2 deletions GPU/Common/DepalettizeShaderCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,20 @@ void GenerateDepalShader300(char *buffer, GEBufferFormat pixelFormat, ShaderLang
int shift = gstate.getClutIndexShift();
int offset = gstate.getClutIndexStartPos();
GEPaletteFormat clutFormat = gstate.getClutPaletteFormat();
// Unfortunately sampling turned our texture into floating point. To avoid this, might be able

// Sampling turns our texture into floating point. To avoid this, might be able
// to declare them as isampler2D objects, but these require integer textures, which needs more work.
// Anyhow, we simply work around this by converting back to integer. Hopefully there will be no loss of precision.
// Anyhow, we simply work around this by converting back to integer, which is fine.
// Use the mask to skip reading some components.

// TODO: Since we actually have higher precision color data here, we might want to apply a dithering pattern here
// in the 5551, 565 and 4444 modes. This would benefit Test Drive which renders at 16-bit on the real hardware
// and dithers immediately, while we render at higher color depth and thus don't dither resulting in banding
// when we sample it at low color depth like this.

// An alternative would be to have a special mode where we keep some extra precision here and sample the CLUT linearly - works for ramps such
// as those that Test Drive uses for its color remapping. But would need game specific flagging.

int shiftedMask = mask << shift;
switch (pixelFormat) {
case GE_FORMAT_8888:
Expand Down
6 changes: 6 additions & 0 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,12 @@ ULJM05049 = true
ULKS46027 = true
ULAS42019 = true

# Test Drive Unlimited
ULET00386 = true
ULUS10249 = true
ULES00637 = true
ULKS46126 = true

# Note! This whole flag is disabled temporarily by appending "Disabled" to its name). See 7914
[YugiohSaveFixDisabled]
# The cause of Yu-gi-oh series 's bad save (cannot save) are load "save status" and use cwcheat,
Expand Down

0 comments on commit 65b8c36

Please sign in to comment.