This check is essentially validating that the hardcoded state_table[]
has reasonable values for the shader constant states. Use ARRAY_SIZE()
to avoid warnings if the compiler chooses an unsigned integer to back
enum SHADER_CONSTANT_TYPE.
Based on an idea by Henri Verbeet.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
wine commit id
cfc533b40d2d1426a8f05501152b28aa1ec78f07 by Matteo Bruni <mbruni@codeweavers.com>
D3DXVECTOR4 value;
HRESULT ret;
- if (op < 0 || op > SCT_PSINT)
- {
- FIXME("Unknown op %u.\n", op);
- return D3DERR_INVALIDCALL;
- }
+ assert(op < ARRAY_SIZE(const_tbl));
element_count = param->bytes / const_tbl[op].elem_size;
TRACE("%s, index %u, element_count %u.\n", const_tbl[op].name, index, element_count);
if (param->type != const_tbl[op].type)
include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h: sdk/include/dxsdk/d3dx9of.h,
include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h: sdk/include/dxsdk/d3dx9shape.h,
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h: sdk/include/dxsdk/d3dx9xof.h}
-tags: {wine: 9796bdc966a89cd31829f3a094bb37ec71e21871}
+tags: {wine: cfc533b40d2d1426a8f05501152b28aa1ec78f07}