gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
754 stars 174 forks source link

Non-zero default framebuffer is completely overridden at certain points #2803

Open jgcodes2020 opened 7 months ago

jgcodes2020 commented 7 months ago

I'm writing a custom frontend for Mupen64Plus. I have overridden VidExt_GL_GetDefaultFramebuffer to use an FBO I create. It seems that GLideN64 will somehow override this FBO, resetting all of its attachments. If I try naively to setup the framebuffer again, it seems to be fairly inconsistent on whether it wants to work or not.

Config settings:

[Video-GLideN64]

# Settings version. Don't touch it.
configVersion = 29
# Enable threaded video backend.
ThreadedVideo = False
# Set MultiSampling (MSAA) value. (0=off, 2,4,8,16=quality)
MultiSampling = 0
# Toggle Fast Approximate Anti-Aliasing (FXAA).
FXAA = False
# Screen aspect ratio. (0=stretch, 1=force 4:3, 2=force 16:9, 3=adjust)
AspectRatio = 1
# Swap frame buffers. (0=On VI update call, 1=On VI origin change, 2=On buffer update)
BufferSwapMode = 0
# Frame buffer size is the factor of N64 native resolution.
UseNativeResolutionFactor = 0
# Bilinear filtering mode. (0=N64 3point, 1=standard)
bilinearMode = True
# Remove halos around filtered textures.
enableHalosRemoval = False
# Max level of Anisotropic Filtering, 0 for off.
anisotropy = 0
# Enable dithering pattern on output image.
EnableDitheringPattern = False
# Enable hi-res noise dithering.
EnableHiresNoiseDithering = False
# Dither with color quantization.
DitheringQuantization = True
# Dithering mode for image in RDRAM. (0=disable, 1=bayer, 2=magic square, 3=blue noise)
RDRAMImageDitheringMode = 3
# Enable LOD emulation.
EnableLOD = True
# Enable hardware per-pixel lighting.
EnableHWLighting = False
# Enable pixel coverage calculation. Used for better blending emulation and wire-frame mode. Needs fast GPU.
EnableCoverage = False
# Enable software vertices clipping. Brings various benefits.
EnableClipping = True
# Use persistent storage for compiled shaders.
EnableShadersStorage = True
# Do not use shaders to emulate N64 blending modes. Works faster on slow GPU. Can cause glitches.
EnableLegacyBlending = False
# Enable hybrid integer scaling filter. Can be slow with low-end GPUs.
EnableHybridFilter = True
# Use fast but less accurate shaders. Can help with low-end GPUs.
EnableInaccurateTextureCoordinates = False
# Enable writing of fragment depth. Some mobile GPUs do not support it, thus made optional. Leave enabled.
EnableFragmentDepthWrite = True
# Use GLideN64 per-game settings.
EnableCustomSettings = True
# Make texrect coordinates continuous to avoid black lines between them. (0=Off, 1=Auto, 2=Force)
CorrectTexrectCoords = 0
# Render 2D texrects in native resolution to fix misalignment between parts of 2D image. (0=Off, 1=Optimized, 2=Unoptimized)
EnableNativeResTexrects = 0
# Render backgrounds mode. (HLE only). (0=One piece (fast), 1=Stripped (precise))
BackgroundsMode = 1
# Bound texture rectangle texture coordinates to the values they take in native resolutions. It prevents garbage due to fetching out of texture bounds, but can result in hard edges. (0=Off, 1=On)
EnableTexCoordBounds = 0
# Enable frame and/or depth buffer emulation.
EnableFBEmulation = False
# Copy auxiliary buffers to RDRAM.
EnableCopyAuxiliaryToRDRAM = False
# Enable N64 depth compare instead of OpenGL standard one. Experimental. (0=Off, 1=Fast, 2=Compatible)
EnableN64DepthCompare = 0
# Force depth buffer clear. Hack. Needed for Eikou no Saint Andrews.
ForceDepthBufferClear = False
# Disable buffers read/write with FBInfo. Use for games which do not work with FBInfo.
DisableFBInfo = True
# Read color buffer by 4kb chunks (strictly follow FBRead specification).
FBInfoReadColorChunk = False
# Read depth buffer by 4kb chunks (strictly follow FBRead specification).
FBInfoReadDepthChunk = True
# Enable color buffer copy to RDRAM. (0=do not copy, 1=copy in sync mode, 2=Double Buffer, 3=Triple Buffer)
EnableCopyColorToRDRAM = 2
# Enable depth buffer copy to RDRAM. (0=do not copy, 1=copy from video memory, 2=use software render)
EnableCopyDepthToRDRAM = 2
# Enable color buffer copy from RDRAM.
EnableCopyColorFromRDRAM = False
# Enable resulted image crop by Overscan.
EnableOverscan = False
# PAL mode. Left bound of Overscan.
OverscanPalLeft = 0
# PAL mode. Right bound of Overscan.
OverscanPalRight = 0
# PAL mode. Top bound of Overscan.
OverscanPalTop = 0
# PAL mode. Bottom bound of Overscan.
OverscanPalBottom = 0
# NTSC mode. Left bound of Overscan.
OverscanNtscLeft = 0
# NTSC mode. Right bound of Overscan.
OverscanNtscRight = 0
# NTSC mode. Top bound of Overscan.
OverscanNtscTop = 0
# NTSC mode. Bottom bound of Overscan.
OverscanNtscBottom = 0
# Texture filter. (0=none, 1=Smooth filtering 1, 2=Smooth filtering 2, 3=Smooth filtering 3, 4=Smooth filtering 4, 5=Sharp filtering 1, 6=Sharp filtering 2)
txFilterMode = 0
# Texture enhancement. (0=none, 1=store as is, 2=X2, 3=X2SAI, 4=HQ2X, 5=HQ2XS, 6=LQ2X, 7=LQ2XS, 8=HQ4X, 9=2xBRZ, 10=3xBRZ, 11=4xBRZ, 12=5xBRZ, 13=6xBRZ)
txEnhancementMode = 0
# Deposterize texture before enhancement.
txDeposterize = False
# Don't filter background textures.
txFilterIgnoreBG = False
# Size of memory cache for enhanced textures in megabytes.
txCacheSize = 100
# Use high resolution texture packs if available.
txHiresEnable = False
# Allow to fully use the alpha channel for high resolution textures.
txHiresFullAlphaChannel = True
# Use alternative method for paletted textures CRC calculation.
txHresAltCRC = False
# Zip texture cache.
txCacheCompression = True
# Force the use of 16-bit texture formats for HD textures.
txForce16bpp = False
# Save texture cache to hard disk.
txSaveCache = True
# Dump textures
txDump = False
# Use file storage instead of memory cache for enhanced textures.
txEnhancedTextureFileStorage = False
# Use file storage instead of memory cache for HD textures.
txHiresTextureFileStorage = False
# Use no file storage or cache for HD textures.
txNoTextureFileStorage = False
# Limit hi-res textures size in VRAM (in MB, 0 = no limit)
txHiresVramLimit = 0
# Path to folder with hi-res texture packs.
txPath = "/home/jgcodes/.local/share/mupen64plus//hires_texture"
# Path to folder where plugin saves texture cache files.
txCachePath = "/home/jgcodes/.cache/mupen64plus//cache"
# Path to folder where plugin saves dumped textures.
txDumpPath = "/home/jgcodes/.cache/mupen64plus//texture_dump"
# File name of True Type Font for text messages.
fontName = "FreeSans.ttf"
# Font size.
fontSize = 18
# Font color in RGB format.
fontColor = "B5E61D"
# Force gamma correction.
ForceGammaCorrection = False
# Gamma correction level.
GammaCorrectionLevel = 2.000000
# Show FPS counter.
ShowFPS = False
# Show VI/s counter.
ShowVIS = False
# Show percent counter.
ShowPercent = False
# Show internal resolution.
ShowInternalResolution = False
# Show rendering resolution.
ShowRenderingResolution = False
# Show statistics for drawn elements.
ShowStatistics = False
# Counters position. (1=top left, 2=top center, 4=top right, 8=bottom left, 16=bottom center, 32=bottom right)
CountersPos = 8
# Hotkey: toggle textures dump
hkTexDump = ""
# Hotkey: reload HD textures
hkHdTexReload = ""
# Hotkey: toggle HD textures
hkHdTexToggle = ""
# Hotkey: toggle texcoords bounds
hkTexCoordBounds = ""
# Hotkey: toggle 2D texrects in native resolution
hkNativeResTexrects = ""
# Hotkey: toggle VSync
hkVsync = ""
# Hotkey: toggle frame buffer emulation
hkFBEmulation = ""
# Hotkey: toggle N64 depth compare
hkN64DepthCompare = ""
# Hotkey: toggle OSD VI/S
hkOsdVis = ""
# Hotkey: toggle OSD FPS
hkOsdFps = ""
# Hotkey: toggle OSD percent
hkOsdPercent = ""
# Hotkey: toggle OSD internal resolution
hkOsdInternalResolution = ""
# Hotkey: toggle OSD rendering resolution
hkOsdRenderingResolution = ""
# Hotkey: toggle force gamma correction
hkForceGammaCorrection = ""
# Hotkey: toggle inaccurate texture coordinates
hkInaccurateTexCords = ""