[vlc-devel] [PATCH] Direct3D shader support (HLSL)

Jean-Baptiste Kempf jb at videolan.org
Mon Aug 16 08:30:10 CEST 2010


On Sun, Aug 15, 2010 at 09:07:58PM -0700, Sasha Koruga wrote :
> +#include "hlsl.h"
What is this hlsl ?

> +    if(sys->hd3d9x_dll) {
> +        HRESULT (WINAPI * OurD3DXCreateEffectFromFileA)(
> +            LPDIRECT3DDEVICE9               pDevice,
> +            LPCSTR                          pSrcFile,
> +            CONST D3DXMACRO*                pDefines,
> +            LPD3DXINCLUDE                   pInclude,
> +            DWORD                           Flags,
> +            LPD3DXEFFECTPOOL                pPool,
> +            LPD3DXEFFECT*                   ppEffect,
> +            LPD3DXBUFFER*                   ppCompilationErrors);
> +
> +        OurD3DXCreateEffectFromFileA =
> (void*)GetProcAddress(sys->hd3d9x_dll,
> TEXT("D3DXCreateEffectFromFileA"));
Why A and not W?

> +            char fileLocation[512];
MAX_PATH or something?

> +            if(FAILED(hr)) {
> +               msg_Warn(vd, "D3DXCreateEffectFromFileA Error
> (hr=0x%lX) -- pixel shading will be disabled (pixelShader.fx possibly
> missing).", hr);
> +               if(buffer)
> +                   msg_Warn(vd, "HLSL Compilation Error: %s",
> (char*)buffer->lpVtbl->GetBufferPointer(buffer));
> +               sys->d3dxShader = NULL;
indentation here seems to be of 3 instead of 4

> +        const char * shaderStrings[SHADEROPTIONSCOUNT] =
> {"convertbt", "widen", "detect", "gamma18", "gamma22", "gammabt",
> "invert", "grayscale"};
What happens if there are other shaders in the .fx file?

> ((ID3DXEffect*)(sys->d3dxShader))->lpVtbl->SetBool(((ID3DXEffect*)(sys->d3dxShader)),
> shaderStrings[i], sys->shaderFXOption[i]);
Some Macros may make (ID3DXEffect*)(sys->d3dxShader) a bit more readable?

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/
+33 672 704 734



More information about the vlc-devel mailing list