I was asked to share the questions I asked here:
Number of HLSL and Pix Requests
I thought that two and three would correspond to the same question, since resolving one might help resolve the other. I am trying to debug a shader and it seems to run into problems. First off, the Pix seems to miss a lot of code when I run the analysis mode. This is an analysis of the F12 gripper experiment and the D3DX analysis is turned off. I have to disable it as I use XNA. Below is the shader code:
float4 PixelShaderFunction(float2 OriginalUV : TEXCOORD0) : COLOR0 { // Get the depth buffer value at this pixel. float4 color = float4 (0, 0,0,0); float4 finalColor = float4(0,0,0,0); float zOverW = tex2D(mySampler, OriginalUV); // H is the viewport position at this pixel in the range -1 to 1. float4 H = float4(OriginalUV.x * 2 - 1, (1 - OriginalUV.y) * 2 - 1, zOverW, 1); // Transform by the view-projection inverse. float4 D = mul(H, xViewProjectionInverseMatrix); // Divide by w to get the world position. float4 worldPos = D / Dw; // Current viewport position float4 currentPos = H; // Use the world position, and transform by the previous view- // projection matrix. float4 previousPos = mul(worldPos, xPreviousViewProjectionMatrix); // Convert to nonhomogeneous points [-1,1] by dividing by w. previousPos /= previousPos.w; // Use this frame position and last frame to compute the pixel // velocity. float2 velocity = (currentPos - previousPos)/2.f; // Get the initial color at this pixel. color = tex2D(sceneSampler, OriginalUV); OriginalUV += velocity; for(int i = 1; i < 1; ++i, OriginalUV += velocity) { // Sample the color buffer along the velocity vector. float4 currentColor = tex2D(sceneSampler, OriginalUV); // Add the current color to our color sum. color += currentColor; } // Average all of the samples to get the final blur color. finalColor = color / xNumSamples; return finalColor; }
With a captured frame and when debugging a pixel, I can only see two lines. These are color = tex2D (sceneSampler, OriginalUV) and finalColor = color / xNumSamples. The rest of this Pix is simply skipped or not.
Is it also possible to debug in real time using Pix? I am wondering if this method will reveal more information.
Greetings
source share