View Single Post
Old 13 January 2017, 20:27   #10
Registered User
rsn8887's Avatar
Join Date: Oct 2006
Location: USA
Posts: 782
Toni is it possible to add SOURCEDIMS and TARGETDIMS also to the post filter that uses the _winuae.fx? That way I can find out what's going on by playing with _winuae.fx

Its SOURCEDIMS vary depending on whether there is a "0" shader selected or not. I think its targetdims are always window_w and window_h.

From direct3d.cpp SOURCEDIMS and TARGETDIMS for that shader should be set somehow like this around line 3055 in direct3d.cpp:

if (FAILED (hr = postEffect->SetTexture (postSourceTextureHandle, srctex)))
			write_log (_T("%s: SetTexture(srctex) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr));

D3DXVECTOR2 fDimsSource, fDimsTarget;
srctex->GetLevelDesc (0, &Desc);
fDimsSource.x = (FLOAT) Desc.Width;
fDimsSource.y = (FLOAT) Desc.Height;
fDimsTarget.x = (FLOAT) window_w;
fDimsTarget.y = (FLOAT) window_h;

hr = posteffect->SetVector(posteffect->m_SourceDimsEffectHandle, &fDimsSource);
		if (FAILED(hr)) {
			write_log(_T("%s: SetTextures:SetVector:Source %s\n"), D3DHEAD, D3D_ErrorString(hr));
			return 0;
hr = posteffect->SetVector(posteffect->m_TargetDimsEffectHandle, &fDimsTarget);
		if (FAILED(hr)) {
			write_log(_T("%s: SetTextures:SetVector:Source %s\n"), D3DHEAD, D3D_ErrorString(hr));
			return 0;

		if (after >= 0) {
			if (FAILED (hr = d3ddev->GetRenderTarget (0, &lpRenderTarget)))
				write_log (_T("%s: GetRenderTarget: %s\n"), D3DHEAD, D3D_ErrorString (hr));
			if (FAILED (hr = lpPostTempTexture->GetSurfaceLevel (0, &lpNewRenderTarget)))
				write_log (_T("%s: GetSurfaceLevel: %s\n"), D3DHEAD, D3D_ErrorString (hr));
			if (FAILED (hr = d3ddev->SetRenderTarget (0, lpNewRenderTarget)))
				write_log (_T("%s: SetRenderTarget: %s\n"), D3DHEAD, D3D_ErrorString (hr));

		uPasses = 0;
		if (psEffect_Begin (psEffect_None, &uPasses, s)) {
			for (uPass = 0; uPass < uPasses; uPass++) {
				if (psEffect_BeginPass (postEffect, uPass)) {
					if (FAILED (hr = d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 0, 2)))
						write_log (_T("%s: Post DrawPrimitive failed: %s\n"), D3DHEAD, D3D_ErrorString (hr));
					psEffect_EndPass (postEffect);
			psEffect_End (postEffect);
rsn8887 is offline  
Page generated in 0.05005 seconds with 10 queries