D44.03 shader code

Discussion in 'Architecture and Products' started by BoardBonobo, May 28, 2003.

  1. OpenGL guy

    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    2,357
    Likes Received:
    28
    Let's not go there :)
    In my previous post I mentioned that I thought they could be shader replacements, but after thinking about it on the way home from work I've decided that's not a good guess. For example, if you wanted to replace an incoming shader with a new shader, why not just replace it with fully compiled/optimized machine code? Unless people think nvidia chips can parse text :?: Anyway, my current thought is they are text versions of shaders being detected.
     
  2. RussSchultz

    RussSchultz Professional Malcontent
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    2,855
    Likes Received:
    55
    Location:
    HTTP 404
    A reasonable option, though it seems to me if they're going to store the shaders are tokens, why don't they detect them in that form, also?

    Recognizing tokens seems like a more foolproof way to defeat folks like futuremark who would attempt to bypass the shader detection--white space, and capitolization and/or comments wouldn't matter anymore.
     
  3. DemoCoder

    Veteran

    Joined:
    Feb 9, 2002
    Messages:
    4,733
    Likes Received:
    81
    Location:
    California
    Detecting via absolute textual representation of the shader wouldn't make sense either, since even white space could throw it off.

    If you were going to do detection that way, you wouldn't store the text, you'd store a HASH of the text (but even better, a code based on the parse tree representation) and compare hash codes, similar to the way virus segments are detected. Or, you'd atleast use regular expressions.

    Is it possible these are some kind of "warmup" shaders that the driver executes before doing the real workload to prime caches or pipelines?

    Or even more mundane, is it possible they are leftovers from debugging modes?
     
  4. DemoCoder

    Veteran

    Joined:
    Feb 9, 2002
    Messages:
    4,733
    Likes Received:
    81
    Location:
    California
    Detecting via absolute textual representation of the shader wouldn't make sense either, since even white space could throw it off.

    If you were going to do detection that way, you wouldn't store the text, you'd store a HASH of the text (but even better, a code based on the parse tree representation) and compare hash codes, similar to the way virus segments are detected. Or, you'd atleast use regular expressions.

    Is it possible these are some kind of "warmup" shaders that the driver executes before doing the real workload to prime caches or pipelines?

    Or even more mundane, is it possible they are leftovers from debugging modes?

    I noticed that the ATI drivers for example still continue some symbolic information like references to c:\work\377area\mai\377driver...
     
  5. OpenGL guy

    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    2,357
    Likes Received:
    28
    As mentioned previously, these are apparently OpenGL shaders. In D3D, the driver doesn't get the text version of the shader, but in OpenGL the shader is coming directly from the application so it should be in text form.
     
  6. Typedef Enum

    Regular

    Joined:
    Feb 10, 2002
    Messages:
    457
    Likes Received:
    0
    Doom III?

    Maybe that's why John said he didn't like nVidia's benchmark configuration.
     
  7. jjayb

    Regular

    Joined:
    Feb 13, 2002
    Messages:
    358
    Likes Received:
    1
    Doom 3 is already optimized for the fx cards though. I don't see why they would need to put in any more optimizations for it.
     
  8. Arun

    Arun Unknown.
    Legend

    Joined:
    Aug 28, 2002
    Messages:
    5,023
    Likes Received:
    302
    Location:
    UK
    I'm perfectly aware that FX12 is not sufficent for transforming vertices :)
    I think I said it somewhere else, sadly forgot to say it here I believe: My guess is that those FX12 units are used exclusively for the lighting. Not for the transforms.

    Yes, I've got that nasty habit of including both transform & lighting in "geometry"... Sorry for the confusion!


    Uttar
     
  9. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    If it doesn't work for transform, why would it work for lighting? It's even more floating point intensive.
     
  10. Kombatant

    Regular

    Joined:
    May 29, 2003
    Messages:
    639
    Likes Received:
    19
    Location:
    Milton Keynes, UK
    It's usually "the more the merrier" and you know it ;)
     
  11. digitalwanderer

    digitalwanderer Dangerously Mirthful
    Legend

    Joined:
    Feb 19, 2002
    Messages:
    18,992
    Likes Received:
    3,532
    Location:
    Winfield, IN USA
    Could it be optimizations aimed at the Q3 engines?
     
  12. Tridam

    Regular Subscriber

    Joined:
    Apr 14, 2003
    Messages:
    541
    Likes Received:
    47
    Location:
    Louvain-la-Neuve, Belgium
    It could be the case for an engine or another.

    Optimizations for an engine are good optimizations if they don't kill quality.

    But optimizations for a demo that run on an engine like Q3 one's is bad optimizations. It's just cheating.
     
  13. RussSchultz

    RussSchultz Professional Malcontent
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    2,855
    Likes Received:
    55
    Location:
    HTTP 404
    Sure, a text compare would be the easiest method--but its also easily detected and easily thwarted. I'd hope they'd be able to cover their tracks easier than that. ;)
     
  14. Colourless

    Colourless Monochrome wench
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,274
    Likes Received:
    30
    Location:
    Somewhere in outback South Australia
    What is it easiest to write shaderes in? Text or an array of possibly variable sized opcodes? The text of course.

    Nvidia need not be doing text compares. They could be compiling these shaders, and comparing the compled shaders, not the text shaders. This would be a more reliable method.
     
  15. Kombatant

    Regular

    Joined:
    May 29, 2003
    Messages:
    639
    Likes Received:
    19
    Location:
    Milton Keynes, UK
  16. darkblu

    Veteran

    Joined:
    Feb 7, 2002
    Messages:
    2,642
    Likes Received:
    22
    i absolutely agree with you. YET keep in mind you compare a hash derived from the parse tree generated in the context of given parser, namely the parser in the present drivers. so you may also want to make sure that that present parser is properly factored in in the comparison as well. IOW, if you want to detect a particular shader A, you have best chances to detect shader A if you pass its 'reference' source through the present parser, compute the hash from the resulting token tree, then check if the user's shader under scrutiny happens to produce the same token tree hash-wise under the present parser. i hope i'm making enough sense (had too long a workday)

    [edit] i see colourless is on the same track of thinking as me [/edit]

    apropos, as long as that's not symbolic info about locals or publics it doesn't matter that much - some compilers like storing sources locations in the objects for peculiar reasons.
     
  17. Arun

    Arun Unknown.
    Legend

    Joined:
    Aug 28, 2002
    Messages:
    5,023
    Likes Received:
    302
    Location:
    UK
    I recieved an interesting e-mail yesterday.
    That person investigated multiple other driver revisions, and while he did not give further information, after personally looking at it, it seems fairly obvious the Detonators 40 introduced *most* of the shader code.

    I don't have access to FTP here ( and probably won't for a few days, managed to burn 768MB of RAM in a day and I'm not on my primary computer ) - so I'll simply put one of the multiple driver revisions he sent me here:

    The 40.71 files seem fairly identical to the current ones ( didn't look at the details though, but the length sure is roughly the same )

    Now, considering nVidia's claim of performance boost in the case of the Detonators 40 was mostly shader-related, does anyone have an idea about this?


    Uttar
     
  18. Popnfresh

    Newcomer

    Joined:
    Mar 8, 2003
    Messages:
    19
    Likes Received:
    0
    All the shaders posted -- with the exception of the first incomplete fragment and the last simple pass-throughs -- are just subtle variations on figuring out the size of a point sprite aka. 'billboarded polygon'.

    The three in Uttar's message about all are exactly the same except for where they get thier fogging value from.

    The first:
    Code:
    MOV o[FOGC],v[4].w;
    takes the fog value from the alpha of the specular channel.

    The second
    Code:
    MOV o[FOGC],R1.z;
    takes it from the Z of the vertex position.

    The third
    Code:
    MOV o[FOGC],R1.w;
    takes it from the W coordinate of the vertex postion.


    None of the code fragments even do anything so complex as transforming the vertex by a matrix - you couldn't use them for normal geometry. They don't even do hardware transform and lighting.

    You may all now ignore this post and go back to your random speculation.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...