wined3d: Implement check for shader creation if hardware supports requested version.

Henri Verbeet hverbeet at
Wed Dec 17 06:38:55 CST 2008

2008/12/17 Pauli Nieminen <suokkos at>:
> +static inline BOOL is_pshader_version_supported(IWineD3DDeviceImpl *deviceImpl, const DWORD *byte_code)
> +{
> +    struct shader_caps shader_caps;
> +    const DWORD shader_version = *byte_code; /* First instruction should be shader version */
Please don't do that, use the reg_maps.shader_version instead.

> +    ERR("First instruction in shader isn't correct shader version for pixel shader. (0x%x)\n", shader_version);
ERR is for internal errors, this should be a WARN. You probably don't
need to print anything at all here though, doing it from the caller
makes more sense (and you've got a message there already anyway).

> +            ERR("No hardware support for pixel shader version (0x%x).\n",*pFunction);
Like above, this should be a WARN. That also means you can get rid of
the code to only print the message once.

More information about the wine-devel mailing list