mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-06 16:19:25 +02:00
Perf adjustments for gfxGetFramebufferDisplayOffset().
This commit is contained in:
parent
28e2759412
commit
4e77c36c30
@ -53,13 +53,16 @@ void gfxFlushBuffers(void);
|
||||
/// Use this to get the pixel-offset in the framebuffer. Returned value is in pixels, not bytes.
|
||||
/// This implements tegra blocklinear, with hard-coded constants etc.
|
||||
static inline u32 gfxGetFramebufferDisplayOffset(u32 x, u32 y) {
|
||||
u32 width=0, height=0;
|
||||
u32 width, height;
|
||||
u32 tilepos, tmp_pos;
|
||||
|
||||
gfxGetFramebufferResolution(&width, NULL);
|
||||
gfxGetFramebuffer(NULL, &height);
|
||||
extern size_t g_gfx_framebuf_width;
|
||||
extern size_t g_gfx_framebuf_display_height;
|
||||
|
||||
if (x >= width || y >= height) return (gfxGetFramebufferSize()-4)/4;//Return the last pixel-offset in the buffer, the data located here is not displayed due to alignment.
|
||||
width = g_gfx_framebuf_width;
|
||||
height = g_gfx_framebuf_display_height;
|
||||
|
||||
//if (x >= width || y >= height) return (gfxGetFramebufferSize()-4)/4;//Return the last pixel-offset in the buffer, the data located here is not displayed due to alignment. (Disabled for perf)
|
||||
|
||||
y = height-1-y;
|
||||
|
||||
|
@ -21,9 +21,9 @@ static bufferProducerQueueBufferOutput g_gfx_QueueBuffer_QueueBufferOutput;
|
||||
|
||||
static bool g_gfxDoubleBuf = 1;
|
||||
|
||||
static size_t g_gfx_framebuf_width=0, g_gfx_framebuf_aligned_width=0;
|
||||
static size_t g_gfx_framebuf_height=0, g_gfx_framebuf_aligned_height=0;
|
||||
static size_t g_gfx_framebuf_display_width=0, g_gfx_framebuf_display_height=0;
|
||||
size_t g_gfx_framebuf_width=0, g_gfx_framebuf_aligned_width=0;
|
||||
size_t g_gfx_framebuf_height=0, g_gfx_framebuf_aligned_height=0;
|
||||
size_t g_gfx_framebuf_display_width=0, g_gfx_framebuf_display_height=0;
|
||||
size_t g_gfx_singleframebuf_size=0;
|
||||
|
||||
static appletHookCookie g_gfx_autoresolution_applethookcookie;
|
||||
|
Loading…
Reference in New Issue
Block a user