Code: Select all
VC_DISPMANX_ALPHA_T alpha = { DISPMANX_FLAGS_ALPHA_FROM_SOURCE | DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS,
255, /*alpha 0->255*/
DISPMANX_FLAGS_ALPHA_FROM_SOURCE };
vars->element = vc_dispmanx_element_add( vars->update,
vars->display,
2000, // layer
&dst_rect,
vars->resource,
&src_rect,
DISPMANX_PROTECTION_NONE,
&alpha,
NULL, // clamp
DISPMANX_NO_ROTATE);

Just create the resource as 256x239 pixels. Set the src_rect to 256<<16, 239<<16. Set the dest_rect to screensize (from graphics_get_display_size) and the scaling will be done on GPU.JPDefault wrote: Dattrax, my application generates a raw buffer of 256x239 pixels.
With GL ES I used to copy them onto a 256x256 texture and stretch it so that it would fill the screen, no matter which was the screen resolution.
Dispmanx sees the screen as 1280x1024 on my DVI monitor, and 750x572 on my small 5.6" screen over RCA.
For now, I'm doubling the raw buffer's pixels to 512x478 within a loop before I feed them to to vc_dispmanx_resource_write_data. Is that what you mean by "upscaling"?
This has to be done for each frame. However, if I just copy the pixels as they are, there is no impact on the FPS.
Would be nice if anyone could find out how to use it.blue wrote: I was wrong, turns out eglCreateGlobalImageBRCM actually produces 'native pixmaps' for eglCreateImageKHR. Now I'm trying to figuring out how to pass client data to such a global image. Hints are welcome.
I'm out of ideas myself, so here's the current code, if you can figure out something which I've missed:JPDefault wrote:Would be nice if anyone could find out how to use it.
I'm trying myself, but I'm not experienced nor lucky enough.
Code: Select all
./build_bcm_image_native.sh debug
No luck here, so I've been using dispmanx for fast fullscreen hardware scaling instead. So far I've got Vice, Fceux, Doxbox and Snes9x running at decent speeds.Chips wrote:Did you succeed to make it works ?
I wanted to use GLES for an emulator too since SDL is giving me some trouble...
If you are calling vc_dispmanx_update_submit_sync, that should wait for the next vsync before returning.Chips wrote:Ok thanks. I got dispmanx running too. Is there some way to have some vsync handling ?
Hi)JPDefault wrote:I wanted to use GLES for an emulator too since SDL is giving me some trouble...
No luck here, so I've been using dispmanx for fast fullscreen hardware scaling instead. So far I've got Vice, Fceux, Doxbox and Snes9x running at decent speeds.
Sounds is another issue... managed to have it perfect in FceuxX, good enough in Vice, but still have huge latencies in Snes9x and Sound Blaster emulation in Dosbox.
Sounds great! Looks like what I was initially trying to do, until I was told that rendering to texture without a native pixmap was slow.Andrey wrote:Hi)JPDefault wrote:I wanted to use GLES for an emulator too since SDL is giving me some trouble...
No luck here, so I've been using dispmanx for fast fullscreen hardware scaling instead. So far I've got Vice, Fceux, Doxbox and Snes9x running at decent speeds.
Sounds is another issue... managed to have it perfect in FceuxX, good enough in Vice, but still have huge latencies in Snes9x and Sound Blaster emulation in Dosbox.
I got 50/60 fps (vsynced PAL/NTSC) in Atari800/Unreal Speccy Portable emulators with GLES2 rendering.
Source code & some explanations here:
http://www.raspberrypi.org/phpBB3/viewt ... 78&t=30889