]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Framecounter shader variable fix.
authorToni Wilen <twilen@winuae.net>
Sun, 8 Feb 2015 14:15:01 +0000 (16:15 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 8 Feb 2015 14:15:01 +0000 (16:15 +0200)
od-win32/direct3d.cpp

index c84b0710e877339c57b50247f2ce7e77ec672c62..3ae8d875c28cf3ae317d0a50d828c2dd77c9afbd 100644 (file)
@@ -90,6 +90,8 @@ struct shaderdata
        // Masks
        LPDIRECT3DTEXTURE9 masktexture;
        int masktexture_w, masktexture_h;
+       // Stuff
+       D3DXHANDLE framecounterHandle;
 };
 static LPDIRECT3DTEXTURE9 lpPostTempTexture;
 
@@ -385,6 +387,7 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX
                        write_log (_T("GetParameterDescParm(%d) failed: %s\n"), D3DHEAD, iParam, D3DX_ErrorString (hr, NULL));
                        return 0;
                }
+               s->framecounterHandle = effect->GetParameterByName (NULL, "framecounter");
                hr = S_OK;
                if(ParamDesc.Semantic != NULL) {
                        if(ParamDesc.Class == D3DXPC_MATRIX_ROWS || ParamDesc.Class == D3DXPC_MATRIX_COLUMNS) {
@@ -1065,6 +1068,8 @@ static int psEffect_SetTextures (LPDIRECT3DTEXTURE9 lpSource, struct shaderdata
                        return 0;
                }
        }
+       if (s->framecounterHandle)
+               s->pEffect->SetFloat(s->framecounterHandle, timeframes);
 
        return 1;
 }