Increase buffers that use max dimensions from the Libretro geometry

Some cores may render frames bigger that reported max dimensions. This may help a bit.
This commit is contained in:
Sergey Stepanov 2024-07-15 12:10:18 +03:00
parent 83b040b39f
commit ba7db72093
No known key found for this signature in database
GPG key ID: A56B4929BAA8556B

View file

@ -897,9 +897,11 @@ func geometryChange(geom C.struct_retro_game_geometry) {
Nan0.sys.av.geometry = geom
if Nan0.Video.gl.enabled && (old.max_width != geom.max_width || old.max_height != geom.max_height) {
bufS := uint(geom.max_width*geom.max_height) * Nan0.Video.PixFmt.BPP
// (for LRPS2) makes the max height bigger increasing SDL2 and OpenGL buffers slightly
Nan0.sys.av.geometry.max_height = C.unsigned(float32(Nan0.sys.av.geometry.max_height) * 1.5)
bufS := uint(geom.max_width*Nan0.sys.av.geometry.max_height) * Nan0.Video.PixFmt.BPP
graphics.SetBuffer(int(bufS))
Nan0.log.Debug().Msgf("OpenGL frame buffer: %v", byteCountBinary(int64(bufS)))
Nan0.log.Debug().Msgf("OpenGL frame buffer: %v", bufS)
}
if Nan0.OnSystemAvInfo != nil {