Jump to content

  • Log In with Google      Sign In   
  • Create Account

Mona2000

Member Since 08 Sep 2011
Online Last Active Today, 02:43 PM

#5301713 D3Dlock_Nooverwrite Erratic Flashing

Posted by Mona2000 on 21 July 2016 - 04:05 AM

Have you enabled the debug layer?

D3DLOCK_DISCARD together with D3DLOCK_NOOVERWRITE is nonsense. Either you use only discard to get a new buffer every time or you create a larger buffer, map a small part with nooverwrite and use it, map the next small part with nooverwrite and use it, map the next...




#5299871 [D3D12] SV_ClipDistance shader compile error

Posted by Mona2000 on 09 July 2016 - 06:25 AM

It means that the maximum is

float4 clipplanes0 : SV_ClipDistance0;
float4 clipplanes1 : SV_ClipDistance1;



#5299865 [D3D12] SV_ClipDistance shader compile error

Posted by Mona2000 on 09 July 2016 - 05:21 AM

MSDN says

The combined clip and cull distance values are at most D3D#_CLIP_OR_CULL_DISTANCE_COUNT components in at most D3D#_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT registers



#5298066 Is using one the switch statement better then using multiple if statements?

Posted by Mona2000 on 25 June 2016 - 08:32 PM

Modern compiles are not so stupid, however. Example: https://godbolt.org/g/i5NBKH Note that foo() and bar() are both compiled into jump tables despite one using a switch statement and the other an if-statement chain.

Doesn't seem to be the case for GCC and MSVC.


#5293800 [D3D12] Unbinding RTV and DSV

Posted by Mona2000 on 27 May 2016 - 08:46 AM

I am feeling really puzzled now :-)

 

No, you don't need to unbind them; you need to add a resource barrier to transition them from RTV to SRV.

Mona2000, are you saying that I can keep RTVs bound to the command list and bind their resource SRVs on the next draw call provided that the resources have been transitioned into shader read state? It really contradicts D3D11 way. Can you provide any pointers where this is described?

 

If you transition them to SRV you obviously can't render into them; the difference is that in D3D11 you had to explicitly unbind them (or bind some other RTV) before calling *SetShaderResourceView.




#5293762 [D3D12] Unbinding RTV and DSV

Posted by Mona2000 on 27 May 2016 - 03:56 AM

No, you don't need to unbind them; you need to add a resource barrier to transition them from RTV to SRV.




#5293599 How does hardware instancing work on the pixel shader level?

Posted by Mona2000 on 26 May 2016 - 09:07 AM

Maybe he put the ddx and ddy calls inside the loop?




#5292318 Pixel Shader 3 weirdness

Posted by Mona2000 on 18 May 2016 - 12:31 PM

Could it be because ps_3_0 requires a vs_3_0 vertex shader?




#5291914 What is this artifact in my shadow map?

Posted by Mona2000 on 16 May 2016 - 12:48 PM

" I'm using the tex2Dproj function to get a free hardware PCF filter"

 

I don't think that is exactly how it works. Besides, anything you do in a shader program is on the hardware, and it sure isn't free.

 

It does work like that (it's a D3D9 extension that every card supports nowadays), and the term is correct as the filtering is performed by the hardware and not by calculations in the shader (software).




#5291036 Clarification about shaders and Directx11

Posted by Mona2000 on 10 May 2016 - 03:52 PM

Just call ID3D11DeviceContext::VSGetShader or ID3D11DeviceContext::PSGetShader to see what shader is bound.




#5290719 Meshes rendered with the aid of shaders corrupted in windows 64 bit

Posted by Mona2000 on 08 May 2016 - 04:18 PM

I don't think reading from a region locked with D3DLOCK_DISCARD is a valid operation?

Edit: and obviously using that vertex buffer without writing anything into it after killing whatever was inside with D3DLOCK_DISCARD is unlikely to be correct.


#5290534 Is SetPrivateData only supposed to be called once?

Posted by Mona2000 on 07 May 2016 - 05:12 AM

It makes sense in some situations, like when you create a rasterizer state and name it, then somewhere else in the code you create another rasterizer state with the same values you will just get the same object from before and attempting to name it would overwrite the old name.


#5279582 Design question: Anti-aliasing and deferred rendering.

Posted by Mona2000 on 04 March 2016 - 06:47 PM

Yes, you should definitely implement the effect in your code. You don't need to use MSAA at all but FXAA tends to blur everything a bit and it doesn't work particularly well on UI so you might wanna use MSAA for that.




#5279581 Deferred Rendering and Particles

Posted by Mona2000 on 04 March 2016 - 06:41 PM

I don't think you need to render the particles to a separate texture. Just do the lighting passes and then render the particles into the HDR buffer.




#5279564 Design question: Anti-aliasing and deferred rendering.

Posted by Mona2000 on 04 March 2016 - 04:57 PM

If you want to remove aliasing from your opaque meshes then you need to make your GBuffer and light passes MSAA. Or use some kind of post processing filter like FXAA or SMAA.






PARTNERS