# No symbols have been loaded for this shader

**URL:** <https://forums.developer.nvidia.com/t/no-symbols-have-been-loaded-for-this-shader/30400>\
**Category:** Nsight Visual Studio Edition\
**Created:** [August 9, 2013, 4:10am UTC](https://forums.developer.nvidia.com/t/no-symbols-have-been-loaded-for-this-shader/30400 "2013-08-09T04:10:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Telanor](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Telanor](https://forums.developer.nvidia.com/u/Telanor)\
**Post date:** [August 9, 2013, 4:10am UTC](https://forums.developer.nvidia.com/t/no-symbols-have-been-loaded-for-this-shader/30400/1 "2013-08-09T04:10:52Z")

</div>

According to the help documentation, there are two ways of debugging a shader: loading it via D3DXCompileShader or compiling it offline with fxc and specifying /Gfp /Zi /Od. My application uses the 2nd method. All the shaders are compiled from a post-build batch file which looks like this:

```auto
@cd "%1"
for /r %%i in (*.fx) do call "%~d0%~p0\fxc.bat" /Tfx_5_0 /Od /Zi /Ges /Gfp /Fo "%~2%%~ni.fxo" "%%i"

```

Yet when I run Nsight, it just says “No symbols have been loaded for this shader” for all my shaders.  
How can I fix this? I’m using Nsight 3.1 and VS 2012.

---

<div class="post-metadata">

**Author:** ![Jeff\_Davis](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Jeff\_Davis](https://forums.developer.nvidia.com/u/Jeff_Davis)\
**Post date:** [August 14, 2013, 7:37pm UTC](https://forums.developer.nvidia.com/t/no-symbols-have-been-loaded-for-this-shader/30400/2 "2013-08-14T19:37:08Z")

</div>

Any chance we can see the source to one of the shaders?

---

<div class="post-metadata">

**Author:** ![Telanor](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Telanor](https://forums.developer.nvidia.com/u/Telanor)\
**Post date:** [August 17, 2013, 11:20pm UTC](https://forums.developer.nvidia.com/t/no-symbols-have-been-loaded-for-this-shader/30400/3 "2013-08-17T23:20:56Z")

</div>

Sure. Here you go:

```auto
float4x4 World;
float4x4 View;
float4x4 Projection;

Texture2D Map;
Texture2D Mask;

SamplerState linearSampler
{
	AddressU = CLAMP;
	AddressV = CLAMP;
	Filter = MIN_MAG_LINEAR_MIP_POINT;
};

struct VertexInput
{
	float3 Position : POSITION;
	float2 TexCoord : TEXCOORD0;
};

struct VertexOutput
{
	float4 Position : SV_POSITION;
	float2 TexCoord : TEXCOORD0;
};

VertexOutput Minimap_VS(VertexInput input)
{
	VertexOutput output = (VertexOutput)0;

	output.Position = float4(input.Position, 1);
	output.TexCoord = input.TexCoord;

	return output;
}

float4 Minimap_PS(VertexOutput input) : SV_TARGET
{
	float4 color = Map.Sample(linearSampler, input.TexCoord);
	float mask = Mask.Sample(linearSampler, input.TexCoord);

	color.a *= mask;

	return color;
}

VertexOutput Waypoint_VS(VertexInput input)
{
	VertexOutput output = (VertexOutput)0;

	float4 worldPosition = mul(float4(input.Position, 1), World);
	float4 cameraPosition = mul(worldPosition, View);
	float4 position = mul(cameraPosition, Projection);

	output.Position = position;
	output.TexCoord = input.TexCoord;

	return output;
}

float4 Waypoint_PS(VertexOutput input) : SV_TARGET
{
	return Map.Sample(linearSampler, input.TexCoord);
}

technique11 Minimap
{
	pass P0
	{
		SetVertexShader(CompileShader(vs_4_0, Minimap_VS()));
		SetPixelShader(CompileShader(ps_4_0, Minimap_PS()));
	}
}

technique11 Waypoint
{
	pass P0
	{
		SetVertexShader(CompileShader(vs_4_0, Waypoint_VS()));
		SetPixelShader(CompileShader(ps_4_0, Waypoint_PS()));
	}
}

```

I noticed in the ASM that it shows this:

#line 31 “D:\Documents\Visual Studio 2010\Projects\Craft\Craft\Content\Effects\Minimap.fx”

Which is indeed where the source code file is stored. But the application and compiled fxo are in a different directory (same drive though). Would that be an issue or will Nsight find the source just fine?

---

<div class="post-metadata">

**Author:** ![Jeff\_Davis](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Jeff\_Davis](https://forums.developer.nvidia.com/u/Jeff_Davis)\
**Post date:** [August 22, 2013, 6:29am UTC](https://forums.developer.nvidia.com/t/no-symbols-have-been-loaded-for-this-shader/30400/4 "2013-08-22T06:29:29Z")

</div>

My mistake, please disregard my last post. I noticed this in fx file. Nsight doesn’t support debugging .fx effects files. I would recommend switching to plain shaders.

---

<div class="post-metadata">

**Author:** ![cmartel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cmartel](https://forums.developer.nvidia.com/u/cmartel)\
**Post date:** [September 5, 2013, 9:09pm UTC](https://forums.developer.nvidia.com/t/no-symbols-have-been-loaded-for-this-shader/30400/5 "2013-09-05T21:09:03Z")

</div>

Before starting a new topic, I’d like to make a quick verification here since it’s on topic…

When you say Nsight doesn’t support debugging .fx files, do you mean Effects, i.e.: an effect file compiled against a fx\ __\__ target, or do you mean any file that follows the .fx syntax?

---

<div class="post-metadata">

**Author:** ![Jeff\_Davis](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Jeff\_Davis](https://forums.developer.nvidia.com/u/Jeff_Davis)\
**Post date:** [September 5, 2013, 10:52pm UTC](https://forums.developer.nvidia.com/t/no-symbols-have-been-loaded-for-this-shader/30400/6 "2013-09-05T22:52:09Z")

</div>

Yes, Effects–such as those compiled as a fx\_3\_0 target for instance, are not supported for debugging.

---

<div class="post-metadata">

**Author:** ![cmartel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cmartel](https://forums.developer.nvidia.com/u/cmartel)\
**Post date:** [September 6, 2013, 4:53pm UTC](https://forums.developer.nvidia.com/t/no-symbols-have-been-loaded-for-this-shader/30400/7 "2013-09-06T16:53:42Z")

</div>

Okay… then technically even if our shaders have the .fx extension, since we’re compiling each of them individually against vs\_5\_0, gs\_5\_0, ps\_5\_0, etc. targets, Nsight should be able to debug them?

The reason I’m asking is our engine compiles resources including shaders on a separate process, and I haven’t been able to get Nsight to see where the source is located. PIX has the same problem, the only thing that works is VS2012 simply because it asks where the source file is located. I’m thinking my best bet at this point would be to prepend generated shaders with #line directives, but release notes say this doesn’t play very well with Nsight.
