Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 15 Sep 2011
Offline Last Active Jan 05 2014 03:30 PM

Posts I've Made

In Topic: Compute Shader execution time

02 August 2013 - 02:53 AM

@MJP: I tried some CopySubresourceRegion for dummy buffers between dispatches and driver is too smart for that. Inserting artificial synchronization points might work, but I won't do it until every other option fails. It seems nightmare to keep code understandable after that.


@ATEFred: Is it only when gpu must sync between them, or it always happens? It would be strange if gpu stalled on each dispatch with idle shading units.

In Topic: HLSL: Resource as function parameter

02 April 2013 - 05:04 AM


Exactly. Right now I just do what Jason wrote. I wondered if there is option to avoid code redundancy and duplicating same code for each resource and index. I would like to pass Nodes[i0].nodes[i1].data[1] as argument, not i0 and i1, same as in InterlockedCompareExchange.


void InterlockedAverage(uint i0, uint i1, float4 val)
	val.rgb *= 255.;
	uint nval = Float4ToUint(val);
	uint prev = 0;
	uint current;

	InterlockedCompareExchange(Nodes[i0].nodes[i1].data[1], prev, nval, current);
	while(prev != current)
		prev = current;
		float4 rval = UintToFloat4(current);
		rval.xyz *= rval.w;
		float4 curf = rval + val;
		curf.xyz /= curf.w;
		nval = Float4ToUint(curf);
		InterlockedCompareExchange(Nodes[i0].nodes[i1].data[1], prev, nval, current);

In Topic: Sampling texture in vertex shader

25 March 2012 - 02:33 AM

Well I do check errors, just stripped that here for clearer code. I use same texture and sampler in PS and I set them for both PS and VS. PS draws texture correctly, but VS just gives 0. I tried sampling at mipmap level 1, and scaling coordinates by texture size for Load. I tried also setting MipLevels for 0, but why would it help? Setting 0 just forces to generate whole chain of mipmaps. I have no idea what can cause it. Maybe there are some options that should, or shouldn't be set somewhere? But I don't think I made anything extraordinary.

Uff, why didn't I think earlier about drawing wireframes? Double bug in uv and positions caused texture to draw fine in PS, but sampled from bad coordinates in VS :D.

In Topic: Xna Math Performance

16 September 2011 - 01:09 PM

Does it help if you replace those for your subtractions and additions?

It helps. But still:

DX Math : 1.30931
Xna Math : 1.64447

I changed Normalize to NormalizeEst. Now it is:

DX Math : 1.30711
Xna Math : 1.36559