Skip to main content
gamedev.net
🔒 Locked

debug ps

Started by derek7 Aug 1, 2006 at 9:32 PM 0 replies 600+ views
Original Post
derek7
derek7

//
// Main
//

PS_OUTPUT Main(PS_INPUT input)
{
    // zero out members of output
    PS_OUTPUT output = (PS_OUTPUT)0;
	float i = 0.0f;
	i++;

    // sample appropriate textures

    vector s = tex2D(SpotLightTex, input.spotlight);
    vector t = tex2D(StringTex,    input.text);

    // combine texel colors
    vector c = b * s + t;

    // increase the intensity of the pixel slightly
    c += 0.1f;

    // save the resulting pixel color
    output.diffuse = c;

    return output;
}

when I debug it,show i is array , and i++ has no effect.
jollyjeffers
jollyjeffers
From the looks of that fragment you dont use 'i' anywhere else thus it should be dead-code eliminated by the compiler (provided you have optimization enabled).

If you're using the shader debugger built into VStudio then it is prone to getting debugging information a bit wrong. Due to optimization the assembly doesn't always map to the original HLSL such that the debugger gets confused and outputs the wrong information. Its best to force no optimization when compiling the effect/shader, but that isn't always workable within the shader model restrictions.

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.