Giter Club home page Giter Club logo

Comments (19)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Confirming that SDL_UpdateRect does not seem to work :(  Changing status to 
accepted.

Original comment by [email protected] on 23 Jun 2009 at 6:49

  • Changed state: Accepted

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
I set SDL_UpdateRects() to call the flip, is this sufficient?

Original comment by [email protected] on 1 Jul 2009 at 7:50

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
nevermind, that was a bad idea.

Original comment by [email protected] on 1 Jul 2009 at 8:16

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
dborth: I actually changed all UpdateRects to Flips. But, the point is, 
UpdateRects 
updates only PARTS of the screen, and Flip updates the entire screen. And 
imagine 
flipping 1024 times in a frame.

Original comment by [email protected] on 2 Jul 2009 at 5:51

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
yes but with this implementation we're never going to let you update the screen 
directly, it has to work a bit different. it should only be drawn only once per 
frame, which I believe is what UpdateRects is supposed to be for, kind of 
the "equivalent" of the Flip() function, if you're using UpdateRect calls 
instead?

Original comment by [email protected] on 2 Jul 2009 at 6:04

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
With SuperTux it does update the screen tile by title using SDL_UpdateRect(). 
Basically I just changed this to SDL_Flip() which seems to work fine.  I'm 
really not
sure of the performance hit is though.

I think the simplest is to just flip instead.  It's probably what needs to 
happen to
blit the GX texture to the screen anyway.  The other option is to dynamically 
create
a GX texture per UpdateRect request which is probably much slower than doing a
straight flip.


Original comment by [email protected] on 2 Jul 2009 at 5:34

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
It is sometimes a big perfomance hit, especially if you do 50 updaterects/frame 
in 
comparison to 50 flips/frame which makes it 50 frames. Can't you just set up a 
thread that every 1/60th of a second (or 1/50th on PAL) flips? This is a 
workaround 
but a good one.

Original comment by [email protected] on 3 Jul 2009 at 2:01

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Well that's what I was thinking to do in UpdateRects(), but I guess maybe I 
can't do 
it there

Original comment by [email protected] on 3 Jul 2009 at 4:00

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
How about the following for implementing UpdateRects.

First spawn a thread during SetVideoMode that will take the current texture 
memory
and copy to the screen. Then when UpdateRects is called copy the specified 
pixels
into texture memory. Now text time the tread executes our display will be 
updated
with the correct image. FlipHWSurface can then just call UpdateRects with a 
rectangle
that specifies the entire screen.

Attached is a patch that actually implements this idea as well as includes 
support
for 32bit surfaces as well. It seemed to work reasonable well in my initial
testing.with my port of ONScripter


Original comment by [email protected] on 12 Jul 2009 at 5:21

Attachments:

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
The patch looks great, but it's a bit problematic in terms of performance. 
After a 
few changes, Super Mario War will run at about 90% speed on this patch. I'm not 
sure 
if it has to do with the video thread or the new conversion code (and switching 
from 
RGBA8 from 565), or something else...

Original comment by [email protected] on 15 Jul 2009 at 4:50

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Can't we just update the rect in texturemem and flip whole buffer to the 
screen. 
Maybe not optimal but it would not affect the performance of anything else and 
would
be faster that a complete blit as we'd only update the texturemem specified by 
the rect.


Original comment by [email protected] on 15 Jul 2009 at 7:02

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
The patch I posted does just update the specified rectangle in the texture 
memory and
then use a thread to continually blit the current texture to the screen. I can 
modify
it so that 8 or 16bit surfaces use RGB565 while 24/32bit ones use RGBA8 and see 
if
that helps the performance any.

Original comment by [email protected] on 16 Jul 2009 at 5:53

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
I've updated the previous patch to improve performance somewhat. 

* 8 and 16bit surfaces use RGB565, 24 and 32bit use RGBA8
* removed memcpy's from UpdateRect functions
* inlined both Set_RGBA8Pixel and Set_RGB565Pixel

Together with the increase of thread priority I am now able to get decent movie
playback using some code I'm working on to play movies using SDL YUVOverlays

Original comment by [email protected] on 16 Jul 2009 at 2:20

Attachments:

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
great, I will test this patch out when I get a chance.

Original comment by [email protected] on 16 Jul 2009 at 3:05

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Thanks for help, I may start finishing my ports now! :D

Original comment by [email protected] on 16 Jul 2009 at 3:07

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
ok, I've committed this patch (with a few small changes). there's still a 
slight 
performance decrease noticeable on Super Mario War, when compiled with this 
patch 
vs. without it.

Original comment by [email protected] on 23 Jul 2009 at 6:26

  • Changed state: Fixed

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
hmm actually I spoke too soon. Something's wonky still, on dosbox the bottom 
part of 
the screen is partly cropped. also the performance hit is even more noticeable 
there. I'm going to roll back until we work out the bugs.

Original comment by [email protected] on 23 Jul 2009 at 7:08

  • Changed state: Started

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
ok, I've combined the submitted patch with the current codebase, UpdateRect is 
now 
supported.

Original comment by [email protected] on 4 Aug 2009 at 7:20

  • Changed state: Fixed

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024

Original comment by [email protected] on 4 Aug 2009 at 8:53

  • Changed state: Completed

from sdl-wii.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.