Dramatic performance fall when losing focus

Playing with music visualization here, did this really simple DX11.TextureFX that copy center line on right and left, till the focus is on the patch it works great:

but as soon as I focus on other windows, or even on the desktop, the performance (and also the visual result!) fall down in a terrible way

any idea why?

here you got the patch and the “HorizzDiffuse.tfx”

HorizzDiff.rar (527.0 kB)

yea, u need to change background FPS, add a MainLoop

ah ok, I need to sett the mainLoop maximum background fps, thanks antokio!

But, its really simple patch, now that it come in my mind… it isn’t enough 30 fps to have it work properly? perhaps the tfx is poor written?
Can someone have a look, please?

Texture2D tex0: PREVIOUS;
Texture2D tex1 <string uiname="Texture In 2";>;
SamplerState s0 <bool visible=false;string uiname="Sampler";> {Filter=MIN_MAG_MIP_LINEAR;AddressU=CLAMP;AddressV=CLAMP;};


cbuffer controls:register(b0){
	float Delta <float uimin=0.0; float uimax=1.0;> = 0.5;

float4 pSlideHorizontal(float4 PosWVP:SV_POSITION,float2 uv:TEXCOORD0):SV_Target{
	if ( (uv.x<.5+Delta/2) && (uv.x>.5-Delta/2) ){
		//uv.x += Delta;
		return tex0.SampleLevel(s0, uv, 0);
	} else { 
		if (uv.x<(.5-Delta/2)) {
			uv.x += Delta;
			return tex1.SampleLevel(s0, uv, 0);
		} else {
			uv.x -= Delta;
			return tex1.SampleLevel(s0, uv, 0);


There is no performance bummer in your patch and shader. I managed to run it even 500fps on a laptop with gtx765m.