MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

CMPXCHG8B
MAME Fan
Reged: 08/24/11
Posts: 5
Send PM
HLSL versus GLSL?
02/04/12 10:53 AM


What does HLSL do that GLSL doesn't?

I'd read recently about HLSL being "backported" to SDLMAME (R. Belmont said it, I think over on forums.bannister.org). I'm kinda confused about this statement because I'm not entirely clear about what HLSL exactly is.

Is HLSL simply the equivalent of GLSL- albeit slightly more integrated (and thus static)- for MAME running under Windows and Direct X (D3D)? Or is there something more to it? The HLSL FX files seem to loosely approximate some sort of shader, but there's a heck of a lot of stuff baked into d3dhlsl.c that would imply that HLSL is far more rigid then something like GLSL.

Is there some reason why GLSL isn't up to the task of replicating HLSL's high-quality effects? cgwg seems to be doing a damned fine job of replicating some of the functionality of HLSL in GLSL, though I've noticed he has seemed to have hit a few snags that basically boil down to missing functionality in MAME and not GLSL (ie, an easy way to get the screen direction, stuff like that).

Would it not be better to simply implement a method of loading GLSL options from an INI file (rather then defining them in the shader itself), as well as a series of other options/functions that are essentially MAME specific that shaders can use as convenience to implement certain effects (ie, I'm pretty sure phosphor persistence would require the shaders to have access to the current colour of the fragment, and that requires code in the program itself to pass that information down to the shader- at least that's how I've seen it done elsewhere)? Of course someone would still have to write the GLSL shaders to recreate the HLSL functionality, but I don't see that as being very different from the HLSL *.fx files MAME already distributes.

Basically, I'm just wondering why we need HLSL on SDLMAME. It seems like the functionally could be implemented by a series of GLSL shaders combined with some changes to the way MAME handles INI files (similar to how it handles hlsl.ini) and some internal bits and bobs to allow for fancy things like phosphor persistence?

-CMPX







Entire thread
Subject Posted by Posted on
* HLSL versus GLSL? CMPXCHG8B 02/04/12 10:53 AM
. * Re: HLSL versus GLSL? R. Belmont  02/04/12 05:27 PM
. * Re: HLSL versus GLSL? etabeta  02/04/12 08:23 PM
. * Re: HLSL versus GLSL? R. Belmont  02/04/12 08:28 PM
. * Re: HLSL versus GLSL? CMPXCHG8B  02/05/12 06:35 AM
. * Re: HLSL versus GLSL? Heihachi_73  02/05/12 11:29 AM
. * Re: HLSL versus GLSL? CMPXCHG8B  02/05/12 12:07 PM
. * Re: HLSL versus GLSL? R. Belmont  02/06/12 03:21 AM
. * Re: HLSL versus GLSL? CMPXCHG8B  02/06/12 05:52 AM
. * Re: HLSL versus GLSL? StilettoAdministrator  02/06/12 06:17 AM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 207 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 6676