Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
72 user(s) are online (61 user(s) are browsing Forums)

Members: 1
Guests: 71

Tijatjj, more...
Support us!
Recent OS4 Files
OS4Depot.net



« 1 ... 34 35 36 (37)


Re: SDL2
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5136
@Capehill
About iconification snapshooting issue, i just change OS4_GetDiskObject() in the SDL_os4window.c as Trixie suggest and it works indeed. Just in case i set it to fallback one as well (to avoid problems when default on snapshoted somehow different too). There is:

static struct DiskObject*
OS4_GetDiskObject(_THIS)
{
    
SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
    
struct DiskObject *diskObject NULL;

    if (
videodata->appName) {
        
BPTR oldDir IDOS->SetCurrentDir(IDOS->GetProgramDir());
        
diskObject IIcon->GetDiskObject(videodata->appName);
        
diskObject->do_CurrentX NO_ICON_POSITION;
        
diskObject->do_CurrentY NO_ICON_POSITION;
        
IDOS->SetCurrentDir(oldDir);
    }

    if (!
diskObject) {
        
CONST_STRPTR fallbackIconName "ENVARC:Sys/def_window";
        
dprintf("Falling back to '%s'n"fallbackIconName);
        
diskObject IIcon->GetDiskObjectNew(fallbackIconName);
        
diskObject->do_CurrentX NO_ICON_POSITION;
        
diskObject->do_CurrentY NO_ICON_POSITION;

    }

    return 
diskObject;
}


I added that info to the ticket as well

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: SDL2
Just can't stay away
Joined:
2009/5/1 17:57
From Czech Republic
Posts: 1007
@kas1e

Yes but this piece of code doesn't look very safe:

diskObject IIcon->GetDiskObject(videodata->appName);
diskObject->do_CurrentX NO_ICON_POSITION;
diskObject->do_CurrentY NO_ICON_POSITION;

GetDiskObject() can easily fail with a NULL return value, so the two assignments will poke into invalid memory! You should change it to

diskObject IIcon->GetDiskObject(videodata->appName);         
if (
diskObject)
 {
  
diskObject->do_CurrentX NO_ICON_POSITION;         
  
diskObject->do_CurrentY NO_ICON_POSITION;
 }





_________________
Smoke me a kipper, I'll be back for breakfast!

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
   Report Go to top

Re: SDL2
Not too shy to talk
Joined:
2007/2/6 13:57
From Donostia (SPAIN)
Posts: 399
@kas1e

Maybe you can try 'GetIconTags()' as it loads a default icon if none found.
...
//diskObject = IIcon->GetDiskObject(videodata->appName);
diskObject = IIcon->GetIconTags(videodata->appName, ICONGETA_FailIfUnavailable,FALSE, TAG_END);
...

   Report Go to top

Re: SDL2
Just can't stay away
Joined:
2009/5/1 17:57
From Czech Republic
Posts: 1007
@jabirulo

Quote:
Maybe you can try 'GetIconTags()' as it loads a default icon if none found.

So does GetDiskIconNew(), by the way. The code kas1e has posted can surely be rewritten/improved in several ways, but I think the simplest edit is the safety check I've suggested above.

_________________
Smoke me a kipper, I'll be back for breakfast!

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
   Report Go to top

Re: SDL2
Quite a regular
Joined:
2007/7/14 20:30
From Lothric
Posts: 635
@trixie

Yeah, NULL checks are required. I would propose to patch it here (only one branch):

https://github.com/AmigaPorts/SDL/blob ... os4/SDL_os4window.c#L1042

   Report Go to top

Re: SDL2
Quite a regular
Joined:
2007/7/14 20:30
From Lothric
Posts: 635
@kas1e

About testdraw2, two things that might simplify the test case:

1) Reduce number of objects

https://github.com/AmigaPorts/SDL/blob/master/test/testdraw2.c#L25

2) Remove some primitive forms (try only lines, points or rectangles, for example)

https://github.com/AmigaPorts/SDL/blob/master/test/testdraw2.c#L195

   Report Go to top

Re: SDL2
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5136
@Capehill
Quote:

Reduce number of objects


Tried with 20 instead of 100 : same crash.

Quote:

Remove some primitive forms (try only lines, points or rectangles, for example)


Only points: crash
Only lines: crash
Only rects: crash

Its like just whole "batching" thing broken for ogles2.

Btw, what i also notice, is that when it only rects, then graphics library give 4330 fps, opengl one 1910fps, and ogles2 2100fps. So in case with just rects, ogles2 version is faster a little. But when it come to lines and dots, it slower a lot.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: SDL2
Quite a regular
Joined:
2007/7/14 20:30
From Lothric
Posts: 635
@kas1e

testdraw2 still works for me, using ogles2.library 2.6. What is the md5sum of your ogles2.library?

   Report Go to top

Re: SDL2
Just popping in
Joined:
2015/6/11 8:51
From Cologne
Posts: 235
@Capehill
There was another bug in ogles2 which indeed caused testdraw2 with env-var SDL_RENDER_BATCHING 1 to produce undefined behaviour. On my FTP there's a wip-version of ogles2 2.7 which among many other stuff also contains a fix for that one.

_________________
[Facebook] [YouTube Channel]
   Report Go to top

Re: SDL2
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5136
@Daniel
Yeah, can confirm that 2.7 fix the SDL_RENDER_BATCHING thing.

@Capehill
Now when SDL_RENDER_BATCHING enabled, we have 207fps for ogles2 rendering, which indeed about 7 times faster than without, but render via pure opengl (minigl) give us 411fps.

So with batching it much better indeed, but still slower than opengl one.

I also notice, that in "fix-opengles2-renderer" branch, you rewrite a bit fragment shader (to map ARGB colors), but should't we just report issue to Hans, so he will made it works the same as on all other platforms ?

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: SDL2
Quite a regular
Joined:
2007/7/14 20:30
From Lothric
Posts: 635
@kas1e

I removed angle/center stuff from the vertex shader (which are not used for point/line/rects) and also the glPointSize, and ran testdraw2 few times: for me, OGLES2 is faster that MiniGL in rects and lines. MiniGL is 2x faster in points.

Regarding fragment shader: SDL2 tells OpenGL all textures are internally GL_RGBA. Now, we have ARGB texture in memory and so I believe we need to reorder the color channels so that OpenGL gets what it was promised. This actually works (try testscale, for example). However target textures are partially broken: the smiley face (testrendercopyex) clearly suffers from wrong color channels. However, the background doesn't, so it seems strange to me. Their texture format is identical.

   Report Go to top

Re: SDL2
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5136
@Capehill
Tested your way of fixing NO_ICON_POSITION stuff, and yes, all fine as well, closed the ticket.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top


« 1 ... 34 35 36 (37)



[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project