Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!

Jason Z

Member Since 04 Feb 2004
Offline Last Active Aug 18 2015 05:36 AM

Posts I've Made

In Topic: UpdateSubresource on StructuredBuffer

15 August 2015 - 06:48 AM

To follow on MJP's great advice, have you tried using the performance tools in the latest versions of Visual Studio?  They can show you a pretty good representation of the parallelism between the CPU and GPU, and will likely show you some insight into what is costing you time that stacks up in your overall frame time.

In Topic: handling DepthStencil / Blend / Rasterizer State dilemma...

15 August 2015 - 06:40 AM

That is more or less correct.  I have a structure that holds the references to the states (RenderEffect), and a material can reference a number of different RenderEffects for different situations.  The higher level rendering pass is actually controlled in a separate object called a SceneRenderTask.  This object is the one that sets up the pipeline outputs (i.e. render and depth targets) and provides whatever special logic is needed for that particular rendering pass.  In your example of a mirror, the stencil rendering would be done in one pass and the reflected scene would be a second SceneRenderTask. 


If you are interested in seeing how it works more closely, the whole engine is available as open source: Hieroglyph 3

In Topic: handling DepthStencil / Blend / Rasterizer State dilemma...

08 August 2015 - 10:09 AM

I use an object that represents the rendering state the drawing to be done.  This is contained within a material object, and each individual object in the scene can reference a material (via a smart pointer).  This lets you have a shared material when it makes sense, or you can just as easily duplicate a material for a special object that wants to mutate its material state.


In the methods you show above, you are limiting yourself to a fixed number of states - if you make them their own objects then you can have an unlimited number of states to use.

In Topic: Is there a reason why you cannot see the values of 1- and 2-letter variables...

27 July 2015 - 07:12 PM

Which version of Visual Studio were you using, and on which operating system?  Also, was there a particular type of variable that had the issue (i.e. local, a certain type, input/output registers, etc...)?  If you post a shader, we could try it out to see if it occurs the same on our end.

In Topic: How to synchronize in pixel shader with DeviceMemoryBarrier() function?

27 July 2015 - 07:07 PM

if (Fragment.ObjID == Objects[count].ObjID && Shaded[count] == 0)

Aren't you reading from the Shaded[] array without any protection here?  How do you ensure that Shaded is synchronized across all of the threads between when you read it and write it?  That is the issue - your method of synching right now is not correct.  You should test with the atomic InterlockedAdd, then determine if you should do the operation based on the old_val. 


Can you also show your declaration of the Shaded[] array?  Is it group shared, or is it device memory?