Patch for pixel-perfect scaling

Here you can discuss the development of patches.

Re: Patch for pixel-perfect scaling

Postby KainXVIII » 2017-8-12 @ 15:43

I use surfacenp sometimes, surfacenb - never, i think.
User avatar
KainXVIII
Member
 
Posts: 205
Joined: 2015-5-20 @ 15:04
Location: Yaroslavl

Re: Patch for pixel-perfect scaling

Postby Ant_222 » 2017-8-12 @ 15:51

KainXVIII wrote:I use surfacenp sometimes, surfacenb - never, i think.
Noted. Do you see the difference between ~np and ~nb at your resolution?

It turns out that I can make surfacepp 30% faster if I re-implement it as a separate function instead of the generic scaling routine that I have now. I can still do it and keep the existing modes, although it will be more work. Edit: 50% faster.
Ant_222
Member
 
Posts: 291
Joined: 2010-7-24 @ 21:29

Re: Patch for pixel-perfect scaling

Postby lukeman3000 » 2017-8-12 @ 16:56

Ant_222 wrote:
KainXVIII wrote:I use surfacenp sometimes, surfacenb - never, i think.
Noted. Do you see the difference between ~np and ~nb at your resolution?

It turns out that I can make surfacepp 30% faster if I re-implement it as a separate function instead of the generic scaling routine that I have now. I can still do it and keep the existing modes, although it will be more work. Edit: 50% faster.

Personally, I like surfacenb for when I want window sizes smaller than what works well with surfacepp (like 800x600'ish). So I still see surfacenb as useful (and prefer it over np because of the sharper image).

Making surfacepp 50% faster would be awesome!
lukeman3000
Member
 
Posts: 164
Joined: 2009-3-17 @ 00:59

Re: Patch for pixel-perfect scaling

Postby KainXVIII » 2017-8-12 @ 18:47

Ant_222 wrote:
KainXVIII wrote:I use surfacenp sometimes, surfacenb - never, i think.
Noted. Do you see the difference between ~np and ~nb at your resolution?

Definitely noticeable differences (especially on EGA Sierra games with lot of dithering). Dunno about optimizing surfacepp, its already fast enough on my pc (maybe apart from switching to fullscreen and out, it can be a little faster for my preferences :blush: ), unlike surfacenp :dead: But still good news if it will work even faster!
User avatar
KainXVIII
Member
 
Posts: 205
Joined: 2015-5-20 @ 15:04
Location: Yaroslavl

Re: Patch for pixel-perfect scaling

Postby lukeman3000 » 2017-8-12 @ 19:25

KainXVIII wrote:
Ant_222 wrote:
KainXVIII wrote:I use surfacenp sometimes, surfacenb - never, i think.
Noted. Do you see the difference between ~np and ~nb at your resolution?

Definitely noticeable differences (especially on EGA Sierra games with lot of dithering). Dunno about optimizing surfacepp, its already fast enough on my pc (maybe apart from switching to fullscreen and out, it can be a little faster for my preferences :blush: ), unlike surfacenp :dead: But still good news if it will work even faster!

surfacepp is definitely slower than other rendering modes like openglnb for example. Any kind of improvement would be great. Maybe the amount of slowdown is resoltion dependent, as I'm using 2560x1440?

I know I've mentioned this before, but I think it'd be cool if you could specify a "fallback" render mode when using surfacepp (such as surfacenb) which activates when the resolution is below threshold (which could be defined in the parameters). So something like

render: surfacepp
renderfallback: surfacenb
renderfallbackres: 1280x1024
lukeman3000
Member
 
Posts: 164
Joined: 2009-3-17 @ 00:59

Re: Patch for pixel-perfect scaling

Postby KainXVIII » 2017-8-12 @ 21:02

Maybe, my resolution is only 1080p.
User avatar
KainXVIII
Member
 
Posts: 205
Joined: 2015-5-20 @ 15:04
Location: Yaroslavl

Re: Patch for pixel-perfect scaling

Postby Ant_222 » 2017-8-13 @ 11:36

Thank you for your feedback.
lukeman3000 wrote:surfacepp is definitely slower than other rendering modes like openglnb for example. Any kind of improvement would be great. Maybe the amount of slowdown is resoltion dependent, as I'm using 2560x1440?
It certainly is. My software scaler slows down in quadratic(!) proportion to the resolution because it handles an approximately constant amount of megapixels per second. The only solution is to make the scaler hardware-accelerated, but that will require SDL 2.0, which is used in unofficial branches only. If anybody knows how to use pixel shaders with opengl in SDL 1.2, will they please help me with a pixel-perfect scaler for the opengl output mode?

Another way out would be to use CPU parallelization, for example via the OpenMP framework, but is not as good as pure hardware acceleration.
I know I've mentioned this before, but I think it'd be cool if you could specify a "fallback" render mode when using surfacepp (such as surfacenb) which activates when the resolution is below threshold (which could be defined in the parameters). So something like
Code: Select all
render: surfacepp
renderfallback: surfacenb
renderfallbackres: 1280x1024
That is possible but not top-priority now. The developers have told me they are very conservative about adding new parameters to the config file, and I fear that I have added too many already. If my (or analogous) patch is not included into the official SVN, my work will be more or less wasted. By the way, it is better to decide whether to fallback based on the aspect-ratio error, is it not?

You said you find surfacenp useful—why not use openglnb instead? Is it not available on your system?
Ant_222
Member
 
Posts: 291
Joined: 2010-7-24 @ 21:29

Re: Patch for pixel-perfect scaling

Postby lukeman3000 » 2017-8-14 @ 05:44

Ant_222 wrote:Thank you for your feedback.
lukeman3000 wrote:surfacepp is definitely slower than other rendering modes like openglnb for example. Any kind of improvement would be great. Maybe the amount of slowdown is resoltion dependent, as I'm using 2560x1440?
It certainly is. My software scaler slows down in quadratic(!) proportion to the resolution because it handles an approximately constant amount of megapixels per second. The only solution is to make the scaler hardware-accelerated, but that will require SDL 2.0, which is used in unofficial branches only. If anybody knows how to use pixel shaders with opengl in SDL 1.2, will they please help me with a pixel-perfect scaler for the opengl output mode?

Another way out would be to use CPU parallelization, for example via the OpenMP framework, but is not as good as pure hardware acceleration.
I know I've mentioned this before, but I think it'd be cool if you could specify a "fallback" render mode when using surfacepp (such as surfacenb) which activates when the resolution is below threshold (which could be defined in the parameters). So something like
Code: Select all
render: surfacepp
renderfallback: surfacenb
renderfallbackres: 1280x1024
That is possible but not top-priority now. The developers have told me they are very conservative about adding new parameters to the config file, and I fear that I have added too many already. If my (or analogous) patch is not included into the official SVN, my work will be more or less wasted. By the way, it is better to decide whether to fallback based on the aspect-ratio error, is it not?

You said you find surfacenp useful—why not use openglnb instead? Is it not available on your system?

I do have access to openglnb, so they're the same? If so then I guess it doesn't matter (for me) since I don't use surfacenp.

Good question, whether to fall back based on aspect ratio error or a pre-determined resolution? I'm not sure. Seems like they may be kind of one and the same, because my goal of being able to fall back based on a pre-set resolution was based on the avoidance of a high aspect ratio error.
lukeman3000
Member
 
Posts: 164
Joined: 2009-3-17 @ 00:59

Re: Patch for pixel-perfect scaling

Postby gulikoza » 2017-8-15 @ 16:13

Ant_222 wrote:If anybody knows how to use pixel shaders with opengl in SDL 1.2, will they please help me with a pixel-perfect scaler for the opengl output mode?


3Dfx code uses pixel (fragment) shaders...even generates them dynamically based on (emulated) hw state.
Check the code (search for glCreateShaderObjectARB).
User avatar
gulikoza
Oldbie
 
Posts: 1698
Joined: 2004-6-25 @ 14:53

Previous

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 2 guests