[vlc-devel] [PATCH] direct3d9: use the official ID3D10Blob interface rather than D3DXBUFFER

Steve Lhomme robux4 at gmail.com
Mon Aug 17 14:27:21 CEST 2015


Do not merge, MinGW has issues with d3d10.h stuff included from C files.

On Fri, Aug 14, 2015 at 9:23 AM, Steve Lhomme <robux4 at gmail.com> wrote:
> ---
>  modules/video_output/msw/direct3d9.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/modules/video_output/msw/direct3d9.c b/modules/video_output/msw/direct3d9.c
> index 7c0faa0..f32caea 100644
> --- a/modules/video_output/msw/direct3d9.c
> +++ b/modules/video_output/msw/direct3d9.c
> @@ -1275,8 +1275,8 @@ static int Direct3D9CompileShader(vout_display_t *vd, const char *shader_source,
>              LPCSTR pFunctionName,
>              LPCSTR pProfile,
>              DWORD Flags,
> -            LPD3DXBUFFER *ppShader,
> -            LPD3DXBUFFER *ppErrorMsgs,
> +            ID3D10Blob **ppShader,
> +            ID3D10Blob **ppErrorMsgs,
>              LPD3DXCONSTANTTABLE *ppConstantTable);
>
>      OurD3DXCompileShader = (void*)GetProcAddress(sys->hd3d9x_dll, "D3DXCompileShader");
> @@ -1285,8 +1285,8 @@ static int Direct3D9CompileShader(vout_display_t *vd, const char *shader_source,
>          return VLC_EGENERIC;
>      }
>
> -    LPD3DXBUFFER error_msgs = NULL;
> -    LPD3DXBUFFER compiled_shader = NULL;
> +    ID3D10Blob *error_msgs = NULL;
> +    ID3D10Blob *compiled_shader = NULL;
>
>      DWORD shader_flags = 0;
>      HRESULT hr = OurD3DXCompileShader(shader_source, source_length, NULL, NULL,
> @@ -1295,20 +1295,20 @@ static int Direct3D9CompileShader(vout_display_t *vd, const char *shader_source,
>      if (FAILED(hr)) {
>          msg_Warn(vd, "D3DXCompileShader Error (hr=0x%0lx)", hr);
>          if (error_msgs) {
> -            msg_Warn(vd, "HLSL Compilation Error: %s", (char*)ID3DXBuffer_GetBufferPointer(error_msgs));
> -            ID3DXBuffer_Release(error_msgs);
> +            msg_Warn(vd, "HLSL Compilation Error: %s", (char*)ID3D10Blob_GetBufferPointer(error_msgs));
> +            ID3D10Blob_Release(error_msgs);
>      }
>          return VLC_EGENERIC;
>      }
>
>      hr = IDirect3DDevice9_CreatePixelShader(sys->d3ddev,
> -            ID3DXBuffer_GetBufferPointer(compiled_shader),
> +            ID3D10Blob_GetBufferPointer(compiled_shader),
>              &sys->d3dx_shader);
>
>      if (compiled_shader)
> -        ID3DXBuffer_Release(compiled_shader);
> +        ID3D10Blob_Release(compiled_shader);
>      if (error_msgs)
> -        ID3DXBuffer_Release(error_msgs);
> +        ID3D10Blob_Release(error_msgs);
>
>      if (FAILED(hr)) {
>          msg_Warn(vd, "IDirect3DDevice9_CreatePixelShader error (hr=0x%0lx)", hr);
> --
> 2.5.0
>


More information about the vlc-devel mailing list