[Mesa-dev] Unknown Opcode 35

Gianluca Anzolin gianluca at sottospazio.it
Mon May 24 09:00:00 PDT 2010


Hello,

Yesterday I was trying to run an example taken from chapter 6 of the book OpenGl
Shading Language with the new gallium driver (I have a RV570 graphic card), but
I got this error when compiling the vertex shader: Unknown opcode 35.

Digging in the source code I found that the opcode 35 is for the > operator
between two vectors (RC_OPCODE_SGT). It's related to the following vertex
shader code:

    if (diffuse > 0.0)
    {
        spec = max(dot(reflectVec, viewVec), 0.0);
        spec = pow(spec, 16.0);
    }



When I changed the comparison to ">=" the problem disappeared. Infact there is
no switch case for RC_OPCODE_SGT in the file r3xx_vertprog.c. I added that case
to the switch statement (see the patch attached) and I got it working even with
the ">" operator.

I hope the patch is correct, if there is a better fix I'd really like to know.

Thanks,

Gianluca

-------------- next part --------------
A non-text attachment was scrubbed...
Name: opcode35.patch
Type: text/x-diff
Size: 877 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100524/48d93655/attachment-0001.patch>


More information about the mesa-dev mailing list