Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


zipwax

Member Since 12 Mar 2012
Offline Last Active Jul 29 2014 02:31 PM

Topics I've Started

Order of calling for ReportLiveDeviceObjects (SharpDX)

29 July 2014 - 01:33 AM

I've seen tons of examples on the net about how to get a DebugDevice in SharpDX, and then how at the end, to call ReportLiveDeviceObjects( ). Yet every single example shows a stack of still-instantiated objects. The ID3D11Device always has at least 2 external refcounts on it, and the rest have internal refcounts, but no external refcounts... This seems unclean.

 

I'd like to know if there is *a* way to "clean up" the DebugDevice so that the DebugDevice knows that ALL of the D3D objects are gone and cleaned up. Kinda like a way to call DebugDevice.SetD3DDevice( null ), or DebugDevice.DisposeYourReferenceToD3D( ), and THEN call ReportLiveDeviceObjects( )! I want a clean log! I haven't seen one example where the log is clean.

 

I know enough to flush the context, and clear it's state, by the way. This still-having-entries log file is after doing all that.

 

Possible!?


How to use external variables in HLSL?

06 July 2014 - 08:12 PM

I'd like to have a master HLSL file, with some functions in it, but these functions require a lot of variables to be passed in. It'd be *nice*, but not absolutely necessary, if my master .fx file could reference "extern" variables, and at compile time, resolve those to the ones in my cbuffer in the non-master file. Is this possible?

 

to restate, I have two files, "master.hlsl" and let's say "blur.hlsl". I want blur.hlsl to reference master.hlsl with a #include. I want blur.hlsl to define a cbuffer  with some varaibles (let's say float fBlurSizeH and float fBlurSizeW), and inside master.hlsl, it defines these variables as "extern float fBlurSizeH" (etc)... Maybe I'd have a function like void DoBlur( Texture2D image ), which references fBlurSizeH. When I try this, it tells me my variable is defined twice. Stupid compiler! :-)

 

I don't see any reason why this couldn't happen, but I don't know the syntax of how to do it. It just seems cleaner.

 

One problem I have is that I have multiple HLSL files wanting to reference this master HLSL file, so I can't reference a specific constant buffer from within the master HLSL file, I need the variables it references to be "generic".

 

thanks

 


Animate to SwapChain or RenderTargets

07 June 2012 - 07:32 AM

I want to animate some synthetic video bits to fullscreen w/o tearing at a precise vertical HZ frequency. Can I set up D3D 9/10/11 in exclusive mode, and have it present a series of buffers that I'm writing to? I know how to copy system memory bits into a texture, then draw that texture as a fullscreen quad, but it seems like overkill. Why should I use the triangle rasterizer when I want to do something so simple?

I don't know what i'm doing, but all I want to do is set up a long (4-8 buffer) swapchain and set the bits of the back buffer that is about to be displayed. Or, I want to allocate 4-8 RenderTargets, and on each frame, copy the bits from system memory to the RenderTarget, then somehow, get that RenderTarget to display on the screen. I realize a RenderTarget is normally used to draw to as a pre-step then use it as a texture in a successive step.

Whatever the case, i want to blast system memory bits into "something that is about to be displayed next" and have D3D drawing one thing while I'm blasting bits to the next thing. I don't know why I should have to use the triangle rasterizer with so simple a task. I've never seen or heard about anybody doing this, but it seems it should be so dead simple!

thanks in advance...

Can I calculate 3 shadow maps at once in HLSL?

15 March 2012 - 10:23 AM

I need to calculate shadow maps for 3 lights at once. Instead of using 3 shadow maps, I'd like to calculate all of them in one pass, using one shadow map, each light stuffing it's depth value into a single R, G, or B channel. I know, this gives me only 256 bits of precision per channel. Is this even possible?

PARTNERS