[v3 PATCH] d3dx10: Add D3DXCpuOptimizations stub

Matteo Bruni matteo.mystral at gmail.com
Mon Jul 25 18:17:24 CDT 2016


2016-07-20 11:20 GMT+02:00 Alistair Leslie-Hughes <leslie_alistair at hotmail.com>:

Hi Alistair, I'm afraid this is going to be a bit nitpicky. It also
means the patch is mostly okay though.

> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
> ---
>  dlls/d3dx10_43/d3dx10_43.spec   |  2 +-
>  dlls/d3dx10_43/d3dx10_43_main.c | 11 +++++++--
>  include/Makefile.in             |  1 +
>  include/d3dx10.h                |  1 +
>  include/d3dx10math.h            | 49 +++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 61 insertions(+), 3 deletions(-)
>  create mode 100644 include/d3dx10math.h
>
> diff --git a/dlls/d3dx10_43/d3dx10_43.spec b/dlls/d3dx10_43/d3dx10_43.spec
> index ab696e8..f410be8 100644
> --- a/dlls/d3dx10_43/d3dx10_43.spec
> +++ b/dlls/d3dx10_43/d3dx10_43.spec
> @@ -70,7 +70,7 @@
>  @ stdcall D3DXColorAdjustSaturation(ptr ptr float) d3dx9_36.D3DXColorAdjustSaturation
>  @ stdcall D3DXComputeBoundingBox(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingBox
>  @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingSphere
> -@ stub D3DXCpuOptimizations(long)
> +@ stdcall D3DXCpuOptimizations(long)
>  @ stdcall D3DXCreateMatrixStack(long ptr) d3dx9_36.D3DXCreateMatrixStack
>  @ stdcall D3DXFloat16To32Array(ptr ptr long) d3dx9_36.D3DXFloat16To32Array
>  @ stdcall D3DXFloat32To16Array(ptr ptr long) d3dx9_36.D3DXFloat32To16Array
> diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c
> index 0c1ff80..408cf22 100644
> --- a/dlls/d3dx10_43/d3dx10_43_main.c
> +++ b/dlls/d3dx10_43/d3dx10_43_main.c
> @@ -34,8 +34,8 @@
>  #include "objbase.h"
>
>  #include "d3d10_1.h"
> -#include "d3dx10core.h"
> -#include "d3dx10tex.h"
> +#include "d3dx10.h"
> +
>
>  WINE_DEFAULT_DEBUG_CHANNEL(d3dx);

No reason to add double whitespace lines here.

>
> @@ -210,3 +210,10 @@ HRESULT WINAPI D3DX10GetImageInfoFromMemory(const void *src_data, SIZE_T src_dat
>
>      return E_NOTIMPL;
>  }
> +
> +D3DX_CPU_OPTIMIZATION WINAPI D3DXCpuOptimizations(BOOL enable)
> +{
> +    FIXME("enable %d stub.\n", enable);

Can you please use %#x when tracing BOOL arguments?

> +#include "d3dx10.h"
> +
> +/* This guard is the same as D3DX9 to prevent double-inclusion */
> +#ifndef __D3DX9MATH_H__
> +#define __D3DX9MATH_H__
> +
> +#include <math.h>
> +
> +
> +typedef enum _D3DX_CPU_OPTIMIZATION
> +{
> +    D3DX_NOT_OPTIMIZED   = 0,
> +    D3DX_3DNOW_OPTIMIZED = 1,
> +    D3DX_SSE2_OPTIMIZED  = 2,
> +    D3DX_SSE_OPTIMIZED   = 3
> +} D3DX_CPU_OPTIMIZATION;

I would go the other way and drop all the initializers instead. It's
fine either way though.
Also double whitespace again.

> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +D3DX_CPU_OPTIMIZATION WINAPI D3DXCpuOptimizations(BOOL enable);
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +
> +/*#include <d3dx10math.inl> */

I don't like this. Either introduce d3dx10math.inl and make this an
actual include (preferred) or just remove the line for the time being.



More information about the wine-devel mailing list