Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ Nvidia Cg question
    primarykey
    data
    text
    <p>I started using <code>Nvidia Cg</code> shaders recently and everything looks and works fine if I'm doing it on the <code>Nvidia GPU</code> (<code>GTS250</code> in my case).</p> <p>I tried launching the same (my own test application) on <code>ATI HD4650</code> and saw no output. Right after that I started experimenting with test examples (provided with <code>Nvidia Cg 3.0</code>) and 6/7 work, but the first one <em>(which seems to be the simpliest)</em> doesn't.</p> <p><strong><em>Here is the shader code:</em></strong></p> <pre><code>// This is C2E1v_green from "The Cg Tutorial" (Addison-Wesley, ISBN // 0321194969) by Randima Fernando and Mark J. Kilgard. See page 38. struct C2E1v_Output { float4 position : POSITION; float3 color : COLOR; }; C2E1v_Output C2E1v_green(float2 position : POSITION) { C2E1v_Output OUT; OUT.position = float4(position,0,1); OUT.color = float3(0,1,0); return OUT; } </code></pre> <p><em>I have no ideas why doesn't this simple shader work, while for example the same shader <strong>paired</strong> with the following passthru-shader does work (example 2 from the <code>Nvidia Cg SDK</code>):</em></p> <pre><code>// This is C2E2f_passthru from "The Cg Tutorial" (Addison-Wesley, ISBN // 0321194969) by Randima Fernando and Mark J. Kilgard. See page 53. struct C2E2f_Output { float4 color : COLOR; }; C2E2f_Output C2E2f_passthru(float4 color : COLOR) { C2E2f_Output OUT; OUT.color = color; return OUT; } </code></pre> <p><strong><em>Did someone face the same troubles? Any ideas?</em></strong></p> <p>Thank you.</p> <hr> <p><strong>Update here:</strong> Turning on maximum debug output made the problem obvious:</p> <pre><code>vs_3_0 shader executed in hardware vertex processing mode can only be paired with at least a ps_3_0 shader </code></pre> <p>The first example in that package was the only one which had ONLY vertex shader in it, without any (even simple passthrough) pixel shader. I have no idea why does Nvidia Cg runtime generates incompatible shader in this case, but it obviously failed only on a somewhat old GPU (<code>ATI HD4650</code>).</p> <p><em>Anyway, I was stupid enough to work without turning the debug output on.</em></p> <p><strong>2 Alex Farber:</strong> I guess you can post a dummy answer, so that I can award bounty to you, because you helped me realize that I forgot to turn debugging on. Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload