Skip to content

Commit

Permalink
Increase buffers that use max dimensions from the Libretro geometry
Browse files Browse the repository at this point in the history
Some cores may render frames bigger that reported max dimensions. This may help a bit.
  • Loading branch information
sergystepanov committed Jul 15, 2024
1 parent 83b040b commit ba7db72
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/worker/caged/libretro/nanoarch/nanoarch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ba7db72

Please sign in to comment.