Sign in to follow this  

DX11 different results from VS debugger with debug device and normal device

This topic is 475 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

 

i have a serious problem with my engine, but i dont know where to locate the problem. The actual problem is that when I create a dx11 device context normally, my font rendering is messed up an looks ugly (see attached pictures) but when I run the vs graphic debugger with my engine, the engine is unnormal slow (in the past is was not so slow while debugging, now it's times 100 slower) but shows correct results (see attached pictures). So now i am a bit lost to find the reason for this behaviour, since the debug results look correct?! Does someone have hint where to look for this problem?

 

And i should mention that, the graphics debugger does not output any warnings or errors, everything runs just fine, like the other effects in the engine.

 

thx Moritz

 

worse.jpg

good.jpg

Edited by MoeTM

Share this post


Link to post
Share on other sites

although its very rare, VS is known to occasionally not work the same in debug as release mode. i first got bit by this some time back in the early to mid '90's. as a result i now develop exclusively in release mode only. i hear of someone with this issue about once every 5 years or so. so like i said, its pretty rare. if you can find no other explanation, then this might be the cause.  but odds are its your code - not debug mode messing up again.

Share this post


Link to post
Share on other sites

although its very rare, VS is known to occasionally not work the same in debug as release mode. i first got bit by this some time back in the early to mid '90's. as a result i now develop exclusively in release mode only. i hear of someone with this issue about once every 5 years or so. so like i said, its pretty rare. if you can find no other explanation, then this might be the cause.  but odds are its your code - not debug mode messing up again.

 

yes I think that the debugger that a bit more security layers than the release/normal mode. The thing is i change some thinks around the font rendering e.g. texture loading, the graphic context generation etc. but the rendering itself, is unchanged and worked some time ago in release mode as well. So i think i might have corruped some memory or i have some state corruption, but I dont know how to find out where :( I already have simplyfied my code a lot but the problem remains. Are there debug features from dx which are normally not activated, like an security mode or something?

 

Also you can see strong arifacts, which are only in y direction, this looks really strange to me?!

Edited by MoeTM

Share this post


Link to post
Share on other sites

That looks like anti-aliasing is disabled to me. That'd make sense, since the graphics debugger probably disables AA in order to be able to read contents more easily.

 

Actually just realized your problem is running without the debugger, so maybe it's not that...

 

Have you tried using a different GPU? Maybe WARP for example?

Edited by Jesse Natalie

Share this post


Link to post
Share on other sites
Have you tried using a different GPU? Maybe WARP for example?

Okey i tried on my onboard intel chip and it works :D, now the question is what causes it on the nvidia card not to work :D Also my shaders are all with these flags compiled:  D3DCOMPILE_IEEE_STRICTNESS | D3DCOMPILE_ENABLE_STRICTNESS | D3DCOMPILE_WARNINGS_ARE_ERRORS | D3DCOMPILE_DEBUG;

 

I made some tests and i think this behaviour is somehow caused by the ddx and ddy and fwidth functions, could that be possible?

 

Okay i solve the problem by myself, somehow the ddx and ddy used internally (i guess) the ddx_coarse and ddy_coarse, but i  use ddx_fine and ddy_fine, it works fine :D. Can i somehow force the shader compilation to pick ddx_fine and ddy_fine?

Edited by MoeTM

Share this post


Link to post
Share on other sites

This topic is 475 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Forum Statistics

    • Total Topics
      628698
    • Total Posts
      2984275
  • Similar Content

    • By mister345
      Hi, I'm building a game engine using DirectX11 in c++.
      I need a basic physics engine to handle collisions and motion, and no time to write my own.
      What is the easiest solution for this? Bullet and PhysX both seem too complicated and would still require writing my own wrapper classes, it seems. 
      I found this thing called PAL - physics abstraction layer that can support bullet, physx, etc, but it's so old and no info on how to download or install it.
      The simpler the better. Please let me know, thanks!
    • By Hexaa
      I try to draw lines with different thicknesses using the geometry shader approach from here:
      https://forum.libcinder.org/topic/smooth-thick-lines-using-geometry-shader
      It seems to work great on my development machine (some Intel HD). However, if I try it on my target (Nvidia NVS 300, yes it's old) I get different results. See the attached images. There
      seem to be gaps in my sine signal that the NVS 300 device creates, the intel does what I want and expect in the other picture.
      It's a shame, because I just can't figure out why. I expect it to be the same. I get no Error in the debug output, with enabled native debugging. I disabled culling with CullMode.None. Could it be some z-fighting? I have little clue about it but I tested to play around with the RasterizerStateDescription and DepthBias properties with no success, no change at all. Maybe I miss something there?
      I develop the application with SharpDX btw.
      Any clues or help is very welcome
       


    • By Beny Benz
      Hi,
      I'm currently trying to write a shader which shoud compute a fast fourier transform of some data, manipulating the transformed data, do an inverse FFT an then displaying the result as vertex offset and color. I use Unity3d and HLSL as shader language. One of the main problems is that the data should not be passed from CPU to GPU for every frame if possible. My original plan was to use a vertex shader and do the fft there, but I fail to find out how to store changing data betwen shader calls/passes. I found a technique called ping-ponging which seems to be based on writing and exchangeing render targets, but I couldn't find an example for HLSL as a vertex shader yet.
      I found https://social.msdn.microsoft.com/Forums/en-US/c79a3701-d028-41d9-ad74-a2b3b3958383/how-to-render-to-multiple-render-targets-in-hlsl?forum=xnaframework
      which seem to use COLOR0 and COLOR1 as such render targets.
      Is it even possible to do such calculations on the gpu only? (/in this shader stage?, because I need the result of the calculation to modify the vertex offsets there)
      I also saw the use of compute shaders in simmilar projects (ocean wave simulation), do they realy copy data between CPU / GPU for every frame?
      How does this ping-ponging / rendertarget switching technique work in HLSL?
      Have you seen an example of usage?
      Any answer would be helpfull.
      Thank you
      appswert
    • By ADDMX
      Hi
      Just a simple question about compute shaders (CS5, DX11).
      Do the atomic operations (InterlockedAdd in my case) should work without any issues on RWByteAddressBuffer and be globaly coherent ?
      I'v come back from CUDA world and commited fairly simple kernel that does some job, the pseudo-code is as follows:
      (both kernels use that same RWByteAddressBuffer)
      first kernel does some job and sets Result[0] = 0;
      (using Result.Store(0, 0))
      I'v checked with debugger, and indeed the value stored at dword 0 is 0
      now my second kernel
      RWByteAddressBuffer Result;  [numthreads(8, 8, 8)] void main() {     for (int i = 0; i < 5; i++)     {         uint4 v0 = DoSomeCalculations1();         uint4 v1 = DoSomeCalculations2();         uint4 v2 = DoSomeCalculations3();                  if (v0.w == 0 && v1.w == 0 && v2.w)             continue;         //    increment counter by 3, and get it previous value         // this should basically allocate space for 3 uint4 values in buffer         uint prev;         Result.InterlockedAdd(0, 3, prev);                  // this fills the buffer with 3 uint4 values (+1 is here as the first 16 bytes is occupied by DrawInstancedIndirect data)         Result.Store4((prev+0+1)*16, v0);         Result.Store4((prev+1+1)*16, v1);         Result.Store4((prev+2+1)*16, v2);     } } Now I invoke it with Dispatch(4,4,4)
      Now I use DrawInstancedIndirect to draw the buffer, but ocassionaly there is missed triangle here and there for a frame, as if the atomic counter does not work as expected
      do I need any additional synchronization there ?
      I'v tried 'AllMemoryBarrierWithGroupSync' at the end of kernel, but without effect.
      If I do not use atomic counter, and istead just output empty vertices (that will transform into degenerated triangles) the all is OK - as if I'm missing some form of synchronization, but I do not see such a thing in DX11.
      I'v tested on both old and new nvidia hardware (680M and 1080, the behaviour is that same).
       
    • By Doggolainen
      Hello, 
      I am, like many others before me, making a displacement map tesselator. I want render some terrain using a quad, a texture containing heightdata and the geometryshader/tesselator.
      So far, Ive managed the utilize the texture on the pixelshader (I return different colors depending on the height). I have also managed to tesselate my surface, i.e. subdivided my quad into lots of triangles .
       
      What doesnt work however is the sampling step on the domain shader. I want to offset the vertices using the heightmap.
      I tried calling the same function "textureMap.Sample(textureSampler, texcoord)" as on the pixelshader but got compiling errors. Instead I am now using the "SampleLevel" function to use the 0 mipmap version of the input texture.
      But yeah non of this seem to be working. I wont get anything except [0, 0, 0, 0] from my sampler.
      Below is some code: The working pixelshader, the broken domain shader where I want to sample, and the instanciations of the samplerstates on the CPU side.
      Been stuck on this for a while! Any help would be much appreciated!
       
       
      Texture2D textureMap: register(t0); SamplerState textureSampler : register(s0); //Pixel shader float4 PS(PS_IN input) : SV_TARGET {     float4 textureColor = textureMap.Sample(textureSampler, input.texcoord);     return textureColor; } GS_IN DS(HS_CONSTANT_DATA input, float3 uvwCoord : SV_DomainLocation, const OutputPatch<DS_IN, 3> patch) {     GS_IN output;     float2 texcoord = uvwCoord.x * patch[0].texcoord.xy + uvwCoord.y * patch[1].texcoord.xy + uvwCoord.z *                    patch[2].texcoord.xy;     float4 textureColor = textureMap.SampleLevel(textureSampler, texcoord.xy, 0);      //fill  and return output....  }             //Sampler             SharpDX.Direct3D11.SamplerStateDescription samplerDescription;             samplerDescription = SharpDX.Direct3D11.SamplerStateDescription.Default();             samplerDescription.Filter = SharpDX.Direct3D11.Filter.MinMagMipLinear;             samplerDescription.AddressU = SharpDX.Direct3D11.TextureAddressMode.Wrap;             samplerDescription.AddressV = SharpDX.Direct3D11.TextureAddressMode.Wrap;             this.samplerStateTextures = new SharpDX.Direct3D11.SamplerState(d3dDevice, samplerDescription);             d3dDeviceContext.PixelShader.SetSampler(0, samplerStateTextures);             d3dDeviceContext.VertexShader.SetSampler(0, samplerStateTextures);             d3dDeviceContext.HullShader.SetSampler(0, samplerStateTextures);             d3dDeviceContext.DomainShader.SetSampler(0, samplerStateTextures);             d3dDeviceContext.GeometryShader.SetSampler(0, samplerStateTextures);  
  • Popular Now