ReactOS  0.4.15-dev-3291-gea4c1a0
effect.c File Reference
#include <stdio.h>
#include <assert.h>
#include "d3dx9_private.h"
#include "d3dcompiler.h"
#include "winternl.h"
#include "wine/list.h"
Include dependency graph for effect.c:

Go to the source code of this file.

Classes

struct  d3dx_object
 
struct  d3dx_state
 
struct  d3dx_sampler
 
struct  d3dx_pass
 
struct  d3dx_technique
 
struct  d3dx_parameter_block
 
struct  d3dx_recorded_parameter
 
struct  d3dx_effect
 
struct  d3dx_effect_pool
 
struct  ID3DXEffectCompilerImpl
 

Macros

#define INT_FLOAT_MULTI   255.0f
 
#define INT_FLOAT_MULTI_INVERSE   (1/INT_FLOAT_MULTI)
 
#define PARAMETER_FLAG_SHARED   1
 
#define INITIAL_POOL_SIZE   16
 
#define INITIAL_PARAM_BLOCK_SIZE   1024
 
#define INITIAL_SHARED_DATA_SIZE   4
 
#define INITIAL_CONST_NAMES_SIZE   4
 

Typedefs

typedef BOOL(* walk_parameter_dep_func) (void *data, struct d3dx_parameter *param)
 

Enumerations

enum  STATE_CLASS {
  SC_LIGHTENABLE, SC_FVF, SC_LIGHT, SC_MATERIAL,
  SC_NPATCHMODE, SC_PIXELSHADER, SC_RENDERSTATE, SC_SETSAMPLER,
  SC_SAMPLERSTATE, SC_TEXTURE, SC_TEXTURESTAGE, SC_TRANSFORM,
  SC_VERTEXSHADER, SC_SHADERCONST, SC_UNKNOWN
}
 
enum  MATERIAL_TYPE {
  MT_DIFFUSE, MT_AMBIENT, MT_SPECULAR, MT_EMISSIVE,
  MT_POWER
}
 
enum  LIGHT_TYPE {
  LT_TYPE, LT_DIFFUSE, LT_SPECULAR, LT_AMBIENT,
  LT_POSITION, LT_DIRECTION, LT_RANGE, LT_FALLOFF,
  LT_ATTENUATION0, LT_ATTENUATION1, LT_ATTENUATION2, LT_THETA,
  LT_PHI
}
 
enum  SHADER_CONSTANT_TYPE {
  SCT_VSFLOAT, SCT_VSBOOL, SCT_VSINT, SCT_PSFLOAT,
  SCT_PSBOOL, SCT_PSINT
}
 
enum  STATE_TYPE { ST_CONSTANT, ST_PARAMETER, ST_FXLC, ST_ARRAY_SELECTOR }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3dx)
 
static HRESULT d3dx_parse_state (struct d3dx_effect *effect, struct d3dx_state *state, const char *data, const char **ptr, struct d3dx_object *objects)
 
static void free_parameter (struct d3dx_parameter *param, BOOL element, BOOL child)
 
static void read_dword (const char **ptr, DWORD *d)
 
static void skip_dword_unknown (const char **ptr, unsigned int count)
 
static D3DXHANDLE get_parameter_handle (struct d3dx_parameter *parameter)
 
static D3DXHANDLE get_technique_handle (struct d3dx_technique *technique)
 
static D3DXHANDLE get_pass_handle (struct d3dx_pass *pass)
 
static struct d3dx_techniqueget_technique_by_name (struct d3dx_effect *effect, const char *name)
 
static struct d3dx_techniqueget_valid_technique (struct d3dx_effect *effect, D3DXHANDLE technique)
 
static struct d3dx_passget_valid_pass (struct d3dx_effect *effect, D3DXHANDLE pass)
 
static struct d3dx_parameterget_valid_parameter (struct d3dx_effect *effect, D3DXHANDLE parameter)
 
static struct d3dx_parameter_blockget_valid_parameter_block (D3DXHANDLE handle)
 
static void free_state (struct d3dx_state *state)
 
static void free_object (struct d3dx_object *object)
 
static void free_sampler (struct d3dx_sampler *sampler)
 
static void d3dx_pool_release_shared_parameter (struct d3dx_top_level_parameter *param)
 
static void free_parameter_object_data (struct d3dx_parameter *param, const void *data, unsigned int bytes)
 
static void free_parameter_data (struct d3dx_parameter *param, BOOL child)
 
static void free_top_level_parameter (struct d3dx_top_level_parameter *param)
 
static void free_pass (struct d3dx_pass *pass)
 
static void free_technique (struct d3dx_technique *technique)
 
static unsigned int get_recorded_parameter_size (const struct d3dx_recorded_parameter *record)
 
static void free_parameter_block (struct d3dx_parameter_block *block)
 
static void d3dx_effect_cleanup (struct d3dx_effect *effect)
 
static void get_vector (struct d3dx_parameter *param, D3DXVECTOR4 *vector)
 
static void set_vector (struct d3dx_parameter *param, const D3DXVECTOR4 *vector, void *dst_data)
 
static void get_matrix (struct d3dx_parameter *param, D3DXMATRIX *matrix, BOOL transpose)
 
static void set_matrix (struct d3dx_parameter *param, const D3DXMATRIX *matrix, void *dst_data)
 
static void set_matrix_transpose (struct d3dx_parameter *param, const D3DXMATRIX *matrix, void *dst_data)
 
static HRESULT set_string (char **param_data, const char *string)
 
static HRESULT set_value (struct d3dx_parameter *param, const void *data, unsigned int bytes, void *dst_data)
 
static struct d3dx_parameterget_parameter_element_by_name (struct d3dx_effect *effect, struct d3dx_parameter *parameter, const char *name)
 
static struct d3dx_parameterget_annotation_by_name (struct d3dx_effect *effect, unsigned int count, struct d3dx_parameter *annotations, const char *name)
 
struct d3dx_parameterget_parameter_by_name (struct d3dx_effect *effect, struct d3dx_parameter *parameter, const char *name)
 
static DWORD d3dx9_effect_version (DWORD major, DWORD minor)
 
static HRESULT d3dx9_get_param_value_ptr (struct d3dx_pass *pass, struct d3dx_state *state, void **param_value, struct d3dx_parameter **out_param, BOOL update_all, BOOL *param_dirty)
 
static unsigned int get_annotation_from_object (struct d3dx_effect *effect, D3DXHANDLE object, struct d3dx_parameter **annotations)
 
static BOOL walk_parameter_tree (struct d3dx_parameter *param, walk_parameter_dep_func param_func, void *data)
 
static ULONG64get_version_counter_ptr (struct d3dx_effect *effect)
 
static ULONG64 next_effect_update_version (struct d3dx_effect *effect)
 
static voidrecord_parameter (struct d3dx_effect *effect, struct d3dx_parameter *param, unsigned int bytes)
 
static void set_dirty (struct d3dx_parameter *param)
 
static voidparam_get_data_and_dirtify (struct d3dx_effect *effect, struct d3dx_parameter *param, unsigned int bytes, BOOL value_changed)
 
static void d3dx9_set_light_parameter (enum LIGHT_TYPE op, D3DLIGHT9 *light, void *value)
 
static void d3dx9_set_material_parameter (enum MATERIAL_TYPE op, D3DMATERIAL9 *material, void *value)
 
static HRESULT d3dx_set_shader_const_state (struct d3dx_effect *effect, enum SHADER_CONSTANT_TYPE op, UINT index, struct d3dx_parameter *param, void *value_ptr)
 
static HRESULT d3dx9_apply_state (struct d3dx_effect *effect, struct d3dx_pass *pass, struct d3dx_state *state, unsigned int parent_index, BOOL update_all)
 
static HRESULT d3dx_set_shader_constants (struct d3dx_effect *effect, struct d3dx_pass *pass, struct d3dx_parameter *param, BOOL vs, BOOL update_all)
 
static HRESULT d3dx9_apply_pass_states (struct d3dx_effect *effect, struct d3dx_pass *pass, BOOL update_all)
 
static void param_set_data_pointer (struct d3dx_parameter *param, unsigned char *data, BOOL child, BOOL free_data)
 
static BOOL is_same_parameter (void *param1_, struct d3dx_parameter *param2)
 
static HRESULT d3dx_pool_sync_shared_parameter (struct d3dx_effect_pool *pool, struct d3dx_top_level_parameter *param)
 
static BOOL param_zero_data_func (void *dummy, struct d3dx_parameter *param)
 
static struct d3dx_effect_poolimpl_from_ID3DXEffectPool (ID3DXEffectPool *iface)
 
static struct d3dx_effect_poolunsafe_impl_from_ID3DXEffectPool (ID3DXEffectPool *iface)
 
static struct d3dx_effectimpl_from_ID3DXEffect (ID3DXEffect *iface)
 
static HRESULT WINAPI d3dx_effect_QueryInterface (ID3DXEffect *iface, REFIID riid, void **object)
 
static ULONG WINAPI d3dx_effect_AddRef (ID3DXEffect *iface)
 
static ULONG WINAPI d3dx_effect_Release (ID3DXEffect *iface)
 
static HRESULT WINAPI d3dx_effect_GetDesc (ID3DXEffect *iface, D3DXEFFECT_DESC *desc)
 
static HRESULT WINAPI d3dx_effect_GetParameterDesc (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXPARAMETER_DESC *desc)
 
static HRESULT WINAPI d3dx_effect_GetTechniqueDesc (ID3DXEffect *iface, D3DXHANDLE technique, D3DXTECHNIQUE_DESC *desc)
 
static HRESULT WINAPI d3dx_effect_GetPassDesc (ID3DXEffect *iface, D3DXHANDLE pass_handle, D3DXPASS_DESC *desc)
 
static HRESULT WINAPI d3dx_effect_GetFunctionDesc (ID3DXEffect *iface, D3DXHANDLE shader, D3DXFUNCTION_DESC *desc)
 
static D3DXHANDLE WINAPI d3dx_effect_GetParameter (ID3DXEffect *iface, D3DXHANDLE parameter, UINT index)
 
static D3DXHANDLE WINAPI d3dx_effect_GetParameterByName (ID3DXEffect *iface, D3DXHANDLE parameter, const char *name)
 
static D3DXHANDLE WINAPI d3dx_effect_GetParameterBySemantic (ID3DXEffect *iface, D3DXHANDLE parameter, const char *semantic)
 
static D3DXHANDLE WINAPI d3dx_effect_GetParameterElement (ID3DXEffect *iface, D3DXHANDLE parameter, UINT index)
 
static D3DXHANDLE WINAPI d3dx_effect_GetTechnique (ID3DXEffect *iface, UINT index)
 
static D3DXHANDLE WINAPI d3dx_effect_GetTechniqueByName (ID3DXEffect *iface, const char *name)
 
static D3DXHANDLE WINAPI d3dx_effect_GetPass (ID3DXEffect *iface, D3DXHANDLE technique, UINT index)
 
static D3DXHANDLE WINAPI d3dx_effect_GetPassByName (ID3DXEffect *iface, D3DXHANDLE technique, const char *name)
 
static D3DXHANDLE WINAPI d3dx_effect_GetFunction (ID3DXEffect *iface, UINT index)
 
static D3DXHANDLE WINAPI d3dx_effect_GetFunctionByName (ID3DXEffect *iface, const char *name)
 
static D3DXHANDLE WINAPI d3dx_effect_GetAnnotation (ID3DXEffect *iface, D3DXHANDLE object, UINT index)
 
static D3DXHANDLE WINAPI d3dx_effect_GetAnnotationByName (ID3DXEffect *iface, D3DXHANDLE object, const char *name)
 
static HRESULT WINAPI d3dx_effect_SetValue (ID3DXEffect *iface, D3DXHANDLE parameter, const void *data, UINT bytes)
 
static HRESULT WINAPI d3dx_effect_GetValue (ID3DXEffect *iface, D3DXHANDLE parameter, void *data, UINT bytes)
 
static HRESULT WINAPI d3dx_effect_SetBool (ID3DXEffect *iface, D3DXHANDLE parameter, BOOL b)
 
static HRESULT WINAPI d3dx_effect_GetBool (ID3DXEffect *iface, D3DXHANDLE parameter, BOOL *b)
 
static HRESULT WINAPI d3dx_effect_SetBoolArray (ID3DXEffect *iface, D3DXHANDLE parameter, const BOOL *b, UINT count)
 
static HRESULT WINAPI d3dx_effect_GetBoolArray (ID3DXEffect *iface, D3DXHANDLE parameter, BOOL *b, UINT count)
 
static HRESULT WINAPI d3dx_effect_SetInt (ID3DXEffect *iface, D3DXHANDLE parameter, INT n)
 
static HRESULT WINAPI d3dx_effect_GetInt (ID3DXEffect *iface, D3DXHANDLE parameter, INT *n)
 
static HRESULT WINAPI d3dx_effect_SetIntArray (ID3DXEffect *iface, D3DXHANDLE parameter, const INT *n, UINT count)
 
static HRESULT WINAPI d3dx_effect_GetIntArray (ID3DXEffect *iface, D3DXHANDLE parameter, INT *n, UINT count)
 
static HRESULT WINAPI d3dx_effect_SetFloat (ID3DXEffect *iface, D3DXHANDLE parameter, float f)
 
static HRESULT WINAPI d3dx_effect_GetFloat (ID3DXEffect *iface, D3DXHANDLE parameter, float *f)
 
static HRESULT WINAPI d3dx_effect_SetFloatArray (ID3DXEffect *iface, D3DXHANDLE parameter, const float *f, UINT count)
 
static HRESULT WINAPI d3dx_effect_GetFloatArray (ID3DXEffect *iface, D3DXHANDLE parameter, float *f, UINT count)
 
static HRESULT WINAPI d3dx_effect_SetVector (ID3DXEffect *iface, D3DXHANDLE parameter, const D3DXVECTOR4 *vector)
 
static HRESULT WINAPI d3dx_effect_GetVector (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXVECTOR4 *vector)
 
static HRESULT WINAPI d3dx_effect_SetVectorArray (ID3DXEffect *iface, D3DXHANDLE parameter, const D3DXVECTOR4 *vector, UINT count)
 
static HRESULT WINAPI d3dx_effect_GetVectorArray (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXVECTOR4 *vector, UINT count)
 
static HRESULT WINAPI d3dx_effect_SetMatrix (ID3DXEffect *iface, D3DXHANDLE parameter, const D3DXMATRIX *matrix)
 
static HRESULT WINAPI d3dx_effect_GetMatrix (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXMATRIX *matrix)
 
static HRESULT WINAPI d3dx_effect_SetMatrixArray (ID3DXEffect *iface, D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count)
 
static HRESULT WINAPI d3dx_effect_GetMatrixArray (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXMATRIX *matrix, UINT count)
 
static HRESULT WINAPI d3dx_effect_SetMatrixPointerArray (ID3DXEffect *iface, D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count)
 
static HRESULT WINAPI d3dx_effect_GetMatrixPointerArray (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXMATRIX **matrix, UINT count)
 
static HRESULT WINAPI d3dx_effect_SetMatrixTranspose (ID3DXEffect *iface, D3DXHANDLE parameter, const D3DXMATRIX *matrix)
 
static HRESULT WINAPI d3dx_effect_GetMatrixTranspose (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXMATRIX *matrix)
 
static HRESULT WINAPI d3dx_effect_SetMatrixTransposeArray (ID3DXEffect *iface, D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count)
 
static HRESULT WINAPI d3dx_effect_GetMatrixTransposeArray (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXMATRIX *matrix, UINT count)
 
static HRESULT WINAPI d3dx_effect_SetMatrixTransposePointerArray (ID3DXEffect *iface, D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count)
 
static HRESULT WINAPI d3dx_effect_GetMatrixTransposePointerArray (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXMATRIX **matrix, UINT count)
 
static HRESULT WINAPI d3dx_effect_SetString (ID3DXEffect *iface, D3DXHANDLE parameter, const char *string)
 
static HRESULT WINAPI d3dx_effect_GetString (ID3DXEffect *iface, D3DXHANDLE parameter, const char **string)
 
static HRESULT WINAPI d3dx_effect_SetTexture (ID3DXEffect *iface, D3DXHANDLE parameter, IDirect3DBaseTexture9 *texture)
 
static HRESULT WINAPI d3dx_effect_GetTexture (ID3DXEffect *iface, D3DXHANDLE parameter, IDirect3DBaseTexture9 **texture)
 
static HRESULT WINAPI d3dx_effect_GetPixelShader (ID3DXEffect *iface, D3DXHANDLE parameter, IDirect3DPixelShader9 **shader)
 
static HRESULT WINAPI d3dx_effect_GetVertexShader (ID3DXEffect *iface, D3DXHANDLE parameter, IDirect3DVertexShader9 **shader)
 
static HRESULT WINAPI d3dx_effect_SetArrayRange (ID3DXEffect *iface, D3DXHANDLE parameter, UINT start, UINT end)
 
static HRESULT WINAPI d3dx_effect_GetPool (ID3DXEffect *iface, ID3DXEffectPool **pool)
 
static HRESULT WINAPI d3dx_effect_SetTechnique (ID3DXEffect *iface, D3DXHANDLE technique)
 
static D3DXHANDLE WINAPI d3dx_effect_GetCurrentTechnique (ID3DXEffect *iface)
 
static HRESULT WINAPI d3dx_effect_ValidateTechnique (ID3DXEffect *iface, D3DXHANDLE technique)
 
static HRESULT WINAPI d3dx_effect_FindNextValidTechnique (ID3DXEffect *iface, D3DXHANDLE technique, D3DXHANDLE *next_technique)
 
static BOOL walk_parameter_dep (struct d3dx_parameter *param, walk_parameter_dep_func param_func, void *data)
 
static BOOL walk_param_eval_dep (struct d3dx_param_eval *param_eval, walk_parameter_dep_func param_func, void *data)
 
static BOOL walk_state_dep (struct d3dx_state *state, walk_parameter_dep_func param_func, void *data)
 
static BOOL is_parameter_used (struct d3dx_parameter *param, struct d3dx_technique *tech)
 
static BOOL WINAPI d3dx_effect_IsParameterUsed (ID3DXEffect *iface, D3DXHANDLE parameter, D3DXHANDLE technique)
 
static HRESULT WINAPI d3dx_effect_Begin (ID3DXEffect *iface, UINT *passes, DWORD flags)
 
static HRESULT WINAPI d3dx_effect_BeginPass (ID3DXEffect *iface, UINT pass)
 
static HRESULT WINAPI d3dx_effect_CommitChanges (ID3DXEffect *iface)
 
static HRESULT WINAPI d3dx_effect_EndPass (ID3DXEffect *iface)
 
static HRESULT WINAPI d3dx_effect_End (ID3DXEffect *iface)
 
static HRESULT WINAPI d3dx_effect_GetDevice (ID3DXEffect *iface, struct IDirect3DDevice9 **device)
 
static BOOL param_on_lost_device (void *data, struct d3dx_parameter *param)
 
static HRESULT WINAPI d3dx_effect_OnLostDevice (ID3DXEffect *iface)
 
static HRESULT WINAPI d3dx_effect_OnResetDevice (ID3DXEffect *iface)
 
static HRESULT WINAPI d3dx_effect_SetStateManager (ID3DXEffect *iface, ID3DXEffectStateManager *manager)
 
static HRESULT WINAPI d3dx_effect_GetStateManager (ID3DXEffect *iface, ID3DXEffectStateManager **manager)
 
static HRESULT WINAPI d3dx_effect_BeginParameterBlock (ID3DXEffect *iface)
 
static D3DXHANDLE WINAPI d3dx_effect_EndParameterBlock (ID3DXEffect *iface)
 
static HRESULT WINAPI d3dx_effect_ApplyParameterBlock (ID3DXEffect *iface, D3DXHANDLE parameter_block)
 
static HRESULT WINAPI d3dx_effect_CloneEffect (ID3DXEffect *iface, IDirect3DDevice9 *device, ID3DXEffect **new_effect)
 
static struct ID3DXEffectCompilerImplimpl_from_ID3DXEffectCompiler (ID3DXEffectCompiler *iface)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_QueryInterface (ID3DXEffectCompiler *iface, REFIID riid, void **object)
 
static ULONG WINAPI ID3DXEffectCompilerImpl_AddRef (ID3DXEffectCompiler *iface)
 
static ULONG WINAPI ID3DXEffectCompilerImpl_Release (ID3DXEffectCompiler *iface)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetDesc (ID3DXEffectCompiler *iface, D3DXEFFECT_DESC *desc)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetParameterDesc (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, D3DXPARAMETER_DESC *desc)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetTechniqueDesc (ID3DXEffectCompiler *iface, D3DXHANDLE technique, D3DXTECHNIQUE_DESC *desc)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetPassDesc (ID3DXEffectCompiler *iface, D3DXHANDLE pass, D3DXPASS_DESC *desc)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetFunctionDesc (ID3DXEffectCompiler *iface, D3DXHANDLE shader, D3DXFUNCTION_DESC *desc)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetParameter (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, UINT index)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetParameterByName (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const char *name)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetParameterBySemantic (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const char *semantic)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetParameterElement (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, UINT index)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetTechnique (ID3DXEffectCompiler *iface, UINT index)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetTechniqueByName (ID3DXEffectCompiler *iface, const char *name)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetPass (ID3DXEffectCompiler *iface, D3DXHANDLE technique, UINT index)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetPassByName (ID3DXEffectCompiler *iface, D3DXHANDLE technique, const char *name)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetFunction (ID3DXEffectCompiler *iface, UINT index)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetFunctionByName (ID3DXEffectCompiler *iface, const char *name)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetAnnotation (ID3DXEffectCompiler *iface, D3DXHANDLE object, UINT index)
 
static D3DXHANDLE WINAPI ID3DXEffectCompilerImpl_GetAnnotationByName (ID3DXEffectCompiler *iface, D3DXHANDLE object, const char *name)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetValue (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const void *data, UINT bytes)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetValue (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, void *data, UINT bytes)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetBool (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, BOOL b)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetBool (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, BOOL *b)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetBoolArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const BOOL *b, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetBoolArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, BOOL *b, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetInt (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, INT n)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetInt (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, INT *n)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetIntArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const INT *n, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetIntArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, INT *n, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetFloat (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, float f)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetFloat (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, float *f)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetFloatArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const float *f, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetFloatArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, float *f, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetVector (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const D3DXVECTOR4 *vector)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetVector (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, D3DXVECTOR4 *vector)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetVectorArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const D3DXVECTOR4 *vector, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetVectorArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, D3DXVECTOR4 *vector, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetMatrix (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const D3DXMATRIX *matrix)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetMatrix (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, D3DXMATRIX *matrix)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetMatrixArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetMatrixArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, D3DXMATRIX *matrix, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetMatrixPointerArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetMatrixPointerArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, D3DXMATRIX **matrix, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetMatrixTranspose (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const D3DXMATRIX *matrix)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetMatrixTranspose (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, D3DXMATRIX *matrix)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetMatrixTransposeArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetMatrixTransposeArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, D3DXMATRIX *matrix, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetMatrixTransposePointerArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetMatrixTransposePointerArray (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, D3DXMATRIX **matrix, UINT count)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetString (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const char *string)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetString (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, const char **string)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetTexture (struct ID3DXEffectCompiler *iface, D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetTexture (struct ID3DXEffectCompiler *iface, D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetPixelShader (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetVertexShader (struct ID3DXEffectCompiler *iface, D3DXHANDLE parameter, struct IDirect3DVertexShader9 **shader)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetArrayRange (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, UINT start, UINT end)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetLiteral (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, BOOL literal)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetLiteral (ID3DXEffectCompiler *iface, D3DXHANDLE parameter, BOOL *literal)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_CompileEffect (ID3DXEffectCompiler *iface, DWORD flags, ID3DXBuffer **effect, ID3DXBuffer **error_msgs)
 
static HRESULT WINAPI ID3DXEffectCompilerImpl_CompileShader (ID3DXEffectCompiler *iface, D3DXHANDLE function, const char *target, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_msgs, ID3DXConstantTable **constant_table)
 
static HRESULT d3dx_parse_sampler (struct d3dx_effect *effect, struct d3dx_sampler *sampler, const char *data, const char **ptr, struct d3dx_object *objects)
 
static HRESULT d3dx_parse_value (struct d3dx_effect *effect, struct d3dx_parameter *param, void *value, const char *data, const char **ptr, struct d3dx_object *objects)
 
static HRESULT d3dx_parse_init_value (struct d3dx_effect *effect, struct d3dx_parameter *param, const char *data, const char *ptr, struct d3dx_object *objects)
 
static HRESULT d3dx9_parse_name (char **name, const char *ptr)
 
static HRESULT d3dx9_copy_data (struct d3dx_effect *effect, unsigned int object_id, const char **ptr)
 
static void param_set_magic_number (struct d3dx_parameter *param)
 
static int param_rb_compare (const void *key, const struct wine_rb_entry *entry)
 
static void add_param_to_tree (struct d3dx_effect *effect, struct d3dx_parameter *param, struct d3dx_parameter *parent, char separator, unsigned int element)
 
static HRESULT d3dx_parse_effect_typedef (struct d3dx_effect *effect, struct d3dx_parameter *param, const char *data, const char **ptr, struct d3dx_parameter *parent, UINT flags)
 
static HRESULT d3dx_parse_effect_annotation (struct d3dx_effect *effect, struct d3dx_parameter *anno, const char *data, const char **ptr, struct d3dx_object *objects)
 
static HRESULT d3dx_parse_effect_parameter (struct d3dx_effect *effect, struct d3dx_top_level_parameter *param, const char *data, const char **ptr, struct d3dx_object *objects)
 
static HRESULT d3dx_parse_effect_pass (struct d3dx_effect *effect, struct d3dx_pass *pass, const char *data, const char **ptr, struct d3dx_object *objects)
 
static HRESULT d3dx_parse_effect_technique (struct d3dx_effect *effect, struct d3dx_technique *technique, const char *data, const char **ptr, struct d3dx_object *objects)
 
static HRESULT d3dx9_create_object (struct d3dx_effect *effect, struct d3dx_object *object)
 
static HRESULT d3dx_parse_array_selector (struct d3dx_effect *effect, struct d3dx_state *state, const char **skip_constants, unsigned int skip_constants_count)
 
static HRESULT d3dx_parse_resource (struct d3dx_effect *effect, const char *data, const char **ptr, const char **skip_constants, unsigned int skip_constants_count)
 
static BOOL param_set_top_level_param (void *top_level_param, struct d3dx_parameter *param)
 
static HRESULT d3dx_parse_effect (struct d3dx_effect *effect, const char *data, UINT data_size, DWORD start, const char **skip_constants, unsigned int skip_constants_count)
 
static charnext_valid_constant_name (char **string)
 
static const char ** parse_skip_constants_string (char *skip_constants_string, unsigned int *names_count)
 
static HRESULT d3dx9_effect_init (struct d3dx_effect *effect, struct IDirect3DDevice9 *device, const char *data, SIZE_T data_size, const D3D_SHADER_MACRO *defines, ID3DInclude *include, UINT eflags, ID3DBlob **errors, struct ID3DXEffectPool *pool, const char *skip_constants_string)
 
HRESULT WINAPI D3DXCreateEffectEx (struct IDirect3DDevice9 *device, const void *srcdata, UINT srcdatalen, const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skip_constants, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilation_errors)
 
HRESULT WINAPI D3DXCreateEffect (struct IDirect3DDevice9 *device, const void *srcdata, UINT srcdatalen, const D3DXMACRO *defines, struct ID3DXInclude *include, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilation_errors)
 
static HRESULT d3dx9_effect_compiler_init (struct ID3DXEffectCompilerImpl *compiler, const char *data, SIZE_T data_size, const D3D_SHADER_MACRO *defines, ID3DInclude *include, UINT eflags, ID3DBlob **error_messages)
 
HRESULT WINAPI D3DXCreateEffectCompiler (const char *srcdata, UINT srcdatalen, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **compiler, ID3DXBuffer **parse_errors)
 
static HRESULT WINAPI d3dx_effect_pool_QueryInterface (ID3DXEffectPool *iface, REFIID riid, void **object)
 
static ULONG WINAPI d3dx_effect_pool_AddRef (ID3DXEffectPool *iface)
 
static void free_effect_pool (struct d3dx_effect_pool *pool)
 
static ULONG WINAPI d3dx_effect_pool_Release (ID3DXEffectPool *iface)
 
HRESULT WINAPI D3DXCreateEffectPool (ID3DXEffectPool **pool)
 
HRESULT WINAPI D3DXCreateEffectFromFileExW (struct IDirect3DDevice9 *device, const WCHAR *srcfile, const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skipconstants, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
 
HRESULT WINAPI D3DXCreateEffectFromFileExA (struct IDirect3DDevice9 *device, const char *srcfile, const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skipconstants, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
 
HRESULT WINAPI D3DXCreateEffectFromFileW (struct IDirect3DDevice9 *device, const WCHAR *srcfile, const D3DXMACRO *defines, struct ID3DXInclude *include, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
 
HRESULT WINAPI D3DXCreateEffectFromFileA (struct IDirect3DDevice9 *device, const char *srcfile, const D3DXMACRO *defines, struct ID3DXInclude *include, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
 
HRESULT WINAPI D3DXCreateEffectFromResourceExW (struct IDirect3DDevice9 *device, HMODULE srcmodule, const WCHAR *srcresource, const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skipconstants, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
 
HRESULT WINAPI D3DXCreateEffectFromResourceExA (struct IDirect3DDevice9 *device, HMODULE srcmodule, const char *srcresource, const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skipconstants, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
 
HRESULT WINAPI D3DXCreateEffectFromResourceW (struct IDirect3DDevice9 *device, HMODULE srcmodule, const WCHAR *srcresource, const D3DXMACRO *defines, struct ID3DXInclude *include, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
 
HRESULT WINAPI D3DXCreateEffectFromResourceA (struct IDirect3DDevice9 *device, HMODULE srcmodule, const char *srcresource, const D3DXMACRO *defines, struct ID3DXInclude *include, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
 
HRESULT WINAPI D3DXCreateEffectCompilerFromFileW (const WCHAR *srcfile, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors)
 
HRESULT WINAPI D3DXCreateEffectCompilerFromFileA (const char *srcfile, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors)
 
HRESULT WINAPI D3DXCreateEffectCompilerFromResourceA (HMODULE srcmodule, const char *srcresource, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors)
 
HRESULT WINAPI D3DXCreateEffectCompilerFromResourceW (HMODULE srcmodule, const WCHAR *srcresource, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors)
 
HRESULT WINAPI D3DXDisassembleEffect (ID3DXEffect *effect, BOOL enable_color_code, ID3DXBuffer **disassembly)
 

Variables

static const char parameter_magic_string [4] = {'@', '!', '#', '\xFF'}
 
static const char parameter_block_magic_string [4] = {'@', '!', '#', '\xFE'}
 
struct {
   enum STATE_CLASS   class
 
   UINT   op
 
   const char *   name
 
state_table []
 
static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl
 
static const struct ID3DXEffectCompilerVtbl ID3DXEffectCompiler_Vtbl
 
static const struct ID3DXEffectPoolVtbl ID3DXEffectPool_Vtbl
 

Macro Definition Documentation

◆ INITIAL_CONST_NAMES_SIZE

#define INITIAL_CONST_NAMES_SIZE   4

Definition at line 6339 of file effect.c.

◆ INITIAL_PARAM_BLOCK_SIZE

#define INITIAL_PARAM_BLOCK_SIZE   1024

Definition at line 43 of file effect.c.

◆ INITIAL_POOL_SIZE

#define INITIAL_POOL_SIZE   16

Definition at line 42 of file effect.c.

◆ INITIAL_SHARED_DATA_SIZE

#define INITIAL_SHARED_DATA_SIZE   4

Definition at line 208 of file effect.c.

◆ INT_FLOAT_MULTI

#define INT_FLOAT_MULTI   255.0f

Definition at line 34 of file effect.c.

◆ INT_FLOAT_MULTI_INVERSE

#define INT_FLOAT_MULTI_INVERSE   (1/INT_FLOAT_MULTI)

Definition at line 35 of file effect.c.

◆ PARAMETER_FLAG_SHARED

#define PARAMETER_FLAG_SHARED   1

Definition at line 40 of file effect.c.

Typedef Documentation

◆ walk_parameter_dep_func

typedef BOOL(* walk_parameter_dep_func) (void *data, struct d3dx_parameter *param)

Definition at line 231 of file effect.c.

Enumeration Type Documentation

◆ LIGHT_TYPE

Enumerator
LT_TYPE 
LT_DIFFUSE 
LT_SPECULAR 
LT_AMBIENT 
LT_POSITION 
LT_DIRECTION 
LT_RANGE 
LT_FALLOFF 
LT_ATTENUATION0 
LT_ATTENUATION1 
LT_ATTENUATION2 
LT_THETA 
LT_PHI 

Definition at line 75 of file effect.c.

◆ MATERIAL_TYPE

Enumerator
MT_DIFFUSE 
MT_AMBIENT 
MT_SPECULAR 
MT_EMISSIVE 
MT_POWER 

Definition at line 66 of file effect.c.

67 {
68  MT_DIFFUSE,
69  MT_AMBIENT,
72  MT_POWER,
73 };

◆ SHADER_CONSTANT_TYPE

Enumerator
SCT_VSFLOAT 
SCT_VSBOOL 
SCT_VSINT 
SCT_PSFLOAT 
SCT_PSBOOL 
SCT_PSINT 

Definition at line 92 of file effect.c.

93 {
95  SCT_VSBOOL,
96  SCT_VSINT,
98  SCT_PSBOOL,
99  SCT_PSINT,
100 };

◆ STATE_CLASS

Enumerator
SC_LIGHTENABLE 
SC_FVF 
SC_LIGHT 
SC_MATERIAL 
SC_NPATCHMODE 
SC_PIXELSHADER 
SC_RENDERSTATE 
SC_SETSAMPLER 
SC_SAMPLERSTATE 
SC_TEXTURE 
SC_TEXTURESTAGE 
SC_TRANSFORM 
SC_VERTEXSHADER 
SC_SHADERCONST 
SC_UNKNOWN 

Definition at line 47 of file effect.c.

◆ STATE_TYPE

Enumerator
ST_CONSTANT 
ST_PARAMETER 
ST_FXLC 
ST_ARRAY_SELECTOR 

Definition at line 102 of file effect.c.

103 {
104  ST_CONSTANT,
105  ST_PARAMETER,
106  ST_FXLC,
108 };

Function Documentation

◆ add_param_to_tree()

static void add_param_to_tree ( struct d3dx_effect effect,
struct d3dx_parameter param,
struct d3dx_parameter parent,
char  separator,
unsigned int  element 
)
static

Definition at line 5266 of file effect.c.

5268 {
5269  const char *parent_name = parent ? parent->full_name : NULL;
5270  unsigned int i;
5271 
5272  TRACE("Adding parameter %p (%s - parent %p, element %u) to the rbtree.\n",
5273  param, debugstr_a(param->name), parent, element);
5274 
5275  if (parent_name)
5276  {
5277  unsigned int parent_name_len = strlen(parent_name);
5278  unsigned int name_len = strlen(param->name);
5279  unsigned int part_str_len;
5280  unsigned int len;
5281  char part_str[16];
5282 
5283  if (separator == '[')
5284  {
5285  sprintf(part_str, "[%u]", element);
5286  part_str_len = strlen(part_str);
5287  name_len = 0;
5288  }
5289  else
5290  {
5291  part_str[0] = separator;
5292  part_str[1] = 0;
5293  part_str_len = 1;
5294  }
5295  len = parent_name_len + part_str_len + name_len + 1;
5296 
5297  if (!(param->full_name = heap_alloc(len)))
5298  {
5299  ERR("Out of memory.\n");
5300  return;
5301  }
5302 
5303  memcpy(param->full_name, parent_name, parent_name_len);
5304  memcpy(param->full_name + parent_name_len, part_str, part_str_len);
5305  memcpy(param->full_name + parent_name_len + part_str_len, param->name, name_len);
5306  param->full_name[len - 1] = 0;
5307  }
5308  else
5309  {
5310  unsigned int len = strlen(param->name) + 1;
5311 
5312  if (!(param->full_name = heap_alloc(len)))
5313  {
5314  ERR("Out of memory.\n");
5315  return;
5316  }
5317 
5318  memcpy(param->full_name, param->name, len);
5319  }
5320  TRACE("Full name is %s.\n", param->full_name);
5321  wine_rb_put(&effect->param_tree, param->full_name, &param->rb_entry);
5322 
5324  for (i = 0; i < param->top_level_param->annotation_count; ++i)
5325  add_param_to_tree(effect, &param->top_level_param->annotations[i], param, '@', 0);
5326 
5327  if (param->element_count)
5328  for (i = 0; i < param->element_count; ++i)
5329  add_param_to_tree(effect, &param->members[i], param, '[', i);
5330  else
5331  for (i = 0; i < param->member_count; ++i)
5332  add_param_to_tree(effect, &param->members[i], param, '.', 0);
5333 }
static const WCHAR separator[]
Definition: asmname.c:65
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static BOOL is_top_level_parameter(struct d3dx_parameter *param)
struct wine_rb_tree param_tree
Definition: effect.c:186
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2944
#define debugstr_a
Definition: kernel32.h:31
static void add_param_to_tree(struct d3dx_effect *effect, struct d3dx_parameter *param, struct d3dx_parameter *parent, char separator, unsigned int element)
Definition: effect.c:5266
GLfloat param
Definition: glext.h:5796
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
#define NULL
Definition: types.h:112

Referenced by d3dx_parse_effect().

◆ d3dx9_apply_pass_states()

static HRESULT d3dx9_apply_pass_states ( struct d3dx_effect effect,
struct d3dx_pass pass,
BOOL  update_all 
)
static

Definition at line 1731 of file effect.c.

1732 {
1733  unsigned int i;
1734  HRESULT ret;
1735  HRESULT hr;
1736  ULONG64 new_update_version = next_effect_update_version(effect);
1737 
1738  TRACE("effect %p, pass %p, state_count %u.\n", effect, pass, pass->state_count);
1739 
1740  ret = D3D_OK;
1741  for (i = 0; i < pass->state_count; ++i)
1742  {
1743  if (FAILED(hr = d3dx9_apply_state(effect, pass, &pass->states[i], ~0u, update_all)))
1744  {
1745  WARN("Error applying state, hr %#x.\n", hr);
1746  ret = hr;
1747  }
1748  }
1749 
1750  if (effect->light_updated)
1751  {
1752  for (i = 0; i < ARRAY_SIZE(effect->current_light); ++i)
1753  {
1754  if ((effect->light_updated & (1u << i))
1755  && FAILED(hr = SET_D3D_STATE(effect, SetLight, i, &effect->current_light[i])))
1756  {
1757  WARN("Error setting light, hr %#x.\n", hr);
1758  ret = hr;
1759  }
1760  }
1761  effect->light_updated = 0;
1762  }
1763 
1764  if (effect->material_updated
1765  && FAILED(hr = SET_D3D_STATE(effect, SetMaterial, &effect->current_material)))
1766  {
1767  WARN("Error setting material, hr %#x.\n", hr);
1768  ret = hr;
1769  }
1770  effect->material_updated = FALSE;
1771 
1772  pass->update_version = new_update_version;
1773  return ret;
1774 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:112
#define SET_D3D_STATE(base_effect, args...)
pass
Definition: typegen.h:24
#define FALSE
Definition: types.h:117
D3DMATERIAL9 current_material
Definition: effect.c:201
unsigned int light_updated
Definition: effect.c:200
#define TRACE(s)
Definition: solgame.cpp:4
BOOL material_updated
Definition: effect.c:202
LONG HRESULT
Definition: typedefs.h:79
unsigned __int64 ULONG64
Definition: imports.h:198
int ret
static ULONG64 next_effect_update_version(struct d3dx_effect *effect)
Definition: effect.c:1276
static HRESULT d3dx9_apply_state(struct d3dx_effect *effect, struct d3dx_pass *pass, struct d3dx_state *state, unsigned int parent_index, BOOL update_all)
Definition: effect.c:1595
D3DLIGHT9 current_light[8]
Definition: effect.c:199
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by d3dx_effect_Begin(), d3dx_effect_BeginPass(), and d3dx_effect_CommitChanges().

◆ d3dx9_apply_state()

static HRESULT d3dx9_apply_state ( struct d3dx_effect effect,
struct d3dx_pass pass,
struct d3dx_state state,
unsigned int  parent_index,
BOOL  update_all 
)
static

Definition at line 1595 of file effect.c.

1597 {
1598  struct d3dx_parameter *param;
1599  void *param_value;
1600  BOOL param_dirty;
1601  HRESULT hr;
1602 
1603  TRACE("operation %u, index %u, type %u.\n", state->operation, state->index, state->type);
1604 
1605  if (FAILED(hr = d3dx9_get_param_value_ptr(pass, state, &param_value, &param,
1606  update_all, &param_dirty)))
1607  {
1608  if (!update_all && hr == E_FAIL)
1609  {
1610  /* Native d3dx9 returns D3D_OK from CommitChanges() involving
1611  * out of bounds array access and does not touch the affected
1612  * states. */
1613  WARN("Returning D3D_OK on out of bounds array access.\n");
1614  return D3D_OK;
1615  }
1616  return hr;
1617  }
1618 
1619  if (!(update_all || param_dirty
1620  || state_table[state->operation].class == SC_VERTEXSHADER
1621  || state_table[state->operation].class == SC_PIXELSHADER
1622  || state_table[state->operation].class == SC_SETSAMPLER))
1623  return D3D_OK;
1624 
1625  switch (state_table[state->operation].class)
1626  {
1627  case SC_RENDERSTATE:
1628  TRACE("%s, operation %u, value %u.\n", state_table[state->operation].name,
1629  state_table[state->operation].op, *(DWORD *)param_value);
1630  return SET_D3D_STATE(effect, SetRenderState, state_table[state->operation].op, *(DWORD *)param_value);
1631  case SC_FVF:
1632  TRACE("%s, value %#x.\n", state_table[state->operation].name, *(DWORD *)param_value);
1633  return SET_D3D_STATE(effect, SetFVF, *(DWORD *)param_value);
1634  case SC_TEXTURE:
1635  {
1636  UINT unit;
1637 
1638  unit = parent_index == ~0u ? state->index : parent_index;
1639  TRACE("%s, unit %u, value %p.\n", state_table[state->operation].name, unit,
1640  *(IDirect3DBaseTexture9 **)param_value);
1641  return SET_D3D_STATE(effect, SetTexture, unit, *(IDirect3DBaseTexture9 **)param_value);
1642  }
1643  case SC_TEXTURESTAGE:
1644  TRACE("%s, stage %u, value %u.\n", state_table[state->operation].name, state->index, *(DWORD *)param_value);
1645  return SET_D3D_STATE(effect, SetTextureStageState, state->index,
1646  state_table[state->operation].op, *(DWORD *)param_value);
1647  case SC_SETSAMPLER:
1648  {
1649  struct d3dx_sampler *sampler;
1650  HRESULT ret, hr;
1651  unsigned int i;
1652 
1653  sampler = (struct d3dx_sampler *)param_value;
1654  TRACE("%s, sampler %u, applying %u states.\n", state_table[state->operation].name, state->index,
1655  sampler->state_count);
1656  ret = D3D_OK;
1657  for (i = 0; i < sampler->state_count; i++)
1658  {
1659  if (FAILED(hr = d3dx9_apply_state(effect, pass, &sampler->states[i], state->index, update_all)))
1660  ret = hr;
1661  }
1662  return ret;
1663  }
1664  case SC_SAMPLERSTATE:
1665  {
1666  UINT sampler;
1667 
1668  sampler = parent_index == ~0u ? state->index : parent_index;
1669  TRACE("%s, sampler %u, value %u.\n", state_table[state->operation].name, sampler, *(DWORD *)param_value);
1670  return SET_D3D_STATE(effect, SetSamplerState, sampler, state_table[state->operation].op,
1671  *(DWORD *)param_value);
1672  }
1673  case SC_VERTEXSHADER:
1674  TRACE("%s, shader %p.\n", state_table[state->operation].name, *(IDirect3DVertexShader9 **)param_value);
1675  if ((update_all || param_dirty)
1676  && FAILED(hr = SET_D3D_STATE(effect, SetVertexShader,
1677  *(IDirect3DVertexShader9 **)param_value)))
1678  ERR("Could not set vertex shader, hr %#x.\n", hr);
1679  else if (*(IDirect3DVertexShader9 **)param_value)
1680  hr = d3dx_set_shader_constants(effect, pass, param, TRUE, update_all || param_dirty);
1681  return hr;
1682  case SC_PIXELSHADER:
1683  TRACE("%s, shader %p.\n", state_table[state->operation].name, *(IDirect3DPixelShader9 **)param_value);
1684  if ((update_all || param_dirty)
1685  && FAILED(hr = SET_D3D_STATE(effect, SetPixelShader,
1686  *(IDirect3DPixelShader9 **)param_value)))
1687  ERR("Could not set pixel shader, hr %#x.\n", hr);
1688  else if (*(IDirect3DPixelShader9 **)param_value)
1689  hr = d3dx_set_shader_constants(effect, pass, param, FALSE, update_all || param_dirty);
1690  return hr;
1691  case SC_TRANSFORM:
1692  TRACE("%s, state %u.\n", state_table[state->operation].name, state->index);
1693  return SET_D3D_STATE(effect, SetTransform, state_table[state->operation].op + state->index,
1694  (D3DMATRIX *)param_value);
1695  case SC_LIGHTENABLE:
1696  TRACE("%s, index %u, value %u.\n", state_table[state->operation].name, state->index, *(BOOL *)param_value);
1697  return SET_D3D_STATE(effect, LightEnable, state->index, *(BOOL *)param_value);
1698  case SC_LIGHT:
1699  {
1700  TRACE("%s, index %u, op %u.\n", state_table[state->operation].name, state->index,
1701  state_table[state->operation].op);
1703  &effect->current_light[state->index], param_value);
1704  effect->light_updated |= 1u << state->index;
1705  return D3D_OK;
1706  }
1707  case SC_MATERIAL:
1708  {
1709  TRACE("%s, index %u, op %u.\n", state_table[state->operation].name, state->index,
1710  state_table[state->operation].op);
1712  &effect->current_material, param_value);
1713  effect->material_updated = TRUE;
1714  return D3D_OK;
1715  }
1716  case SC_NPATCHMODE:
1717  TRACE("%s, nsegments %f.\n", state_table[state->operation].name, *(float *)param_value);
1718  return SET_D3D_STATE(effect, SetNPatchMode, *(float *)param_value);
1719  case SC_SHADERCONST:
1720  TRACE("%s, index %u, op %u.\n", state_table[state->operation].name, state->index,
1721  state_table[state->operation].op);
1722  return d3dx_set_shader_const_state(effect, state_table[state->operation].op, state->index,
1723  param, param_value);
1724  default:
1725  FIXME("%s not handled.\n", state_table[state->operation].name);
1726  break;
1727  }
1728  return D3D_OK;
1729 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
#define SET_D3D_STATE(base_effect, args...)
#define E_FAIL
Definition: ddrawi.h:102
static HRESULT d3dx_set_shader_constants(struct d3dx_effect *effect, struct d3dx_pass *pass, struct d3dx_parameter *param, BOOL vs, BOOL update_all)
Definition: effect.c:1549
pass
Definition: typegen.h:24
#define FALSE
Definition: types.h:117
D3DMATERIAL9 current_material
Definition: effect.c:201
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned int light_updated
Definition: effect.c:200
static HRESULT d3dx_set_shader_const_state(struct d3dx_effect *effect, enum SHADER_CONSTANT_TYPE op, UINT index, struct d3dx_parameter *param, void *value_ptr)
Definition: effect.c:1451
#define FIXME(fmt,...)
Definition: debug.h:111
png_const_structrp png_const_inforp int * unit
Definition: png.h:2161
#define TRACE(s)
Definition: solgame.cpp:4
BOOL material_updated
Definition: effect.c:202
LONG HRESULT
Definition: typedefs.h:79
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static HRESULT d3dx9_get_param_value_ptr(struct d3dx_pass *pass, struct d3dx_state *state, void **param_value, struct d3dx_parameter **out_param, BOOL update_all, BOOL *param_dirty)
Definition: effect.c:1119
static int state
Definition: maze.c:121
Definition: effect.c:50
static HRESULT d3dx9_apply_state(struct d3dx_effect *effect, struct d3dx_pass *pass, struct d3dx_state *state, unsigned int parent_index, BOOL update_all)
Definition: effect.c:1595
D3DLIGHT9 current_light[8]
Definition: effect.c:199
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
static void d3dx9_set_light_parameter(enum LIGHT_TYPE op, D3DLIGHT9 *light, void *value)
Definition: effect.c:1341
static void d3dx9_set_material_parameter(enum MATERIAL_TYPE op, D3DMATERIAL9 *material, void *value)
Definition: effect.c:1408
static const struct @234 state_table[]
GLuint sampler
Definition: glext.h:7283

Referenced by d3dx9_apply_pass_states(), and d3dx_set_shader_constants().

◆ d3dx9_copy_data()

static HRESULT d3dx9_copy_data ( struct d3dx_effect effect,
unsigned int  object_id,
const char **  ptr 
)
static

Definition at line 5217 of file effect.c.

5218 {
5219  struct d3dx_object *object = &effect->objects[object_id];
5220 
5221  if (object->size || object->data)
5222  {
5223  if (object_id)
5224  FIXME("Overwriting object id %u!\n", object_id);
5225  else
5226  TRACE("Overwriting object id 0.\n");
5227 
5228  HeapFree(GetProcessHeap(), 0, object->data);
5229  object->data = NULL;
5230  }
5231 
5232  read_dword(ptr, &object->size);
5233  TRACE("Data size: %#x.\n", object->size);
5234 
5235  if (!object->size)
5236  return D3D_OK;
5237 
5238  object->data = HeapAlloc(GetProcessHeap(), 0, object->size);
5239  if (!object->data)
5240  {
5241  ERR("Failed to allocate object memory.\n");
5242  return E_OUTOFMEMORY;
5243  }
5244 
5245  TRACE("Data: %s.\n", debugstr_an(*ptr, object->size));
5246  memcpy(object->data, *ptr, object->size);
5247 
5248  *ptr += ((object->size + 3) & ~3);
5249 
5250  return D3D_OK;
5251 }
struct d3dx_object * objects
Definition: effect.c:183
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:111
static PVOID ptr
Definition: dispmode.c:27
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
static void read_dword(const char **ptr, DWORD *d)
Definition: effect.c:436
#define NULL
Definition: types.h:112
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by d3dx_parse_effect(), and d3dx_parse_resource().

◆ d3dx9_create_object()

static HRESULT d3dx9_create_object ( struct d3dx_effect effect,
struct d3dx_object object 
)
static

Definition at line 5901 of file effect.c.

5902 {
5903  struct d3dx_parameter *param = object->param;
5904  IDirect3DDevice9 *device = effect->device;
5905  HRESULT hr;
5906 
5907  if (*(char **)param->data)
5908  ERR("Parameter data already allocated.\n");
5909 
5910  switch (param->type)
5911  {
5912  case D3DXPT_STRING:
5913  *(char **)param->data = HeapAlloc(GetProcessHeap(), 0, object->size);
5914  if (!*(char **)param->data)
5915  {
5916  ERR("Out of memory.\n");
5917  return E_OUTOFMEMORY;
5918  }
5919  memcpy(*(char **)param->data, object->data, object->size);
5920  break;
5921  case D3DXPT_VERTEXSHADER:
5923  (IDirect3DVertexShader9 **)param->data)))
5924  {
5925  WARN("Failed to create vertex shader.\n");
5926  object->creation_failed = TRUE;
5927  }
5928  break;
5929  case D3DXPT_PIXELSHADER:
5931  (IDirect3DPixelShader9 **)param->data)))
5932  {
5933  WARN("Failed to create pixel shader.\n");
5934  object->creation_failed = TRUE;
5935  }
5936  break;
5937  default:
5938  break;
5939  }
5940  return D3D_OK;
5941 }
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
#define IDirect3DDevice9_CreateVertexShader(p, a, b)
Definition: d3d9.h:1598
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:79
GLfloat param
Definition: glext.h:5796
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define IDirect3DDevice9_CreatePixelShader(p, a, b)
Definition: d3d9.h:1613
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
struct IDirect3DDevice9 * device
Definition: effect.c:191

Referenced by d3dx_parse_effect(), and d3dx_parse_resource().

◆ d3dx9_effect_compiler_init()

static HRESULT d3dx9_effect_compiler_init ( struct ID3DXEffectCompilerImpl compiler,
const char data,
SIZE_T  data_size,
const D3D_SHADER_MACRO defines,
ID3DInclude include,
UINT  eflags,
ID3DBlob **  error_messages 
)
static

Definition at line 6611 of file effect.c.

6614 {
6615  TRACE("compiler %p, data %p, data_size %lu, defines %p, include %p, eflags %#x, error_messages %p.\n",
6616  compiler, data, data_size, defines, include, eflags, error_messages);
6617 
6619  compiler->ref = 1;
6620 
6621  FIXME("ID3DXEffectCompiler implementation is only a stub.\n");
6622 
6623  return D3D_OK;
6624 }
#define FIXME(fmt,...)
Definition: debug.h:111
static const struct ID3DXEffectCompilerVtbl ID3DXEffectCompiler_Vtbl
Definition: effect.c:4925
ID3DXEffectCompiler ID3DXEffectCompiler_iface
Definition: effect.c:223
#define TRACE(s)
Definition: solgame.cpp:4
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define D3D_OK
Definition: d3d.h:106
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30

Referenced by D3DXCreateEffectCompiler().

◆ d3dx9_effect_init()

static HRESULT d3dx9_effect_init ( struct d3dx_effect effect,
struct IDirect3DDevice9 *  device,
const char data,
SIZE_T  data_size,
const D3D_SHADER_MACRO defines,
ID3DInclude include,
UINT  eflags,
ID3DBlob **  errors,
struct ID3DXEffectPool *  pool,
const char skip_constants_string 
)
static

Definition at line 6394 of file effect.c.

6397 {
6398 #if D3DX_SDK_VERSION <= 36
6400 #else
6401  UINT compile_flags = 0;
6402 #endif
6403  ID3DBlob *bytecode = NULL, *temp_errors = NULL;
6404  unsigned int skip_constants_count = 0;
6405  char *skip_constants_buffer = NULL;
6406  const char **skip_constants = NULL;
6407  const char *ptr = data;
6408  DWORD tag, offset;
6409  unsigned int i, j;
6410  HRESULT hr;
6411 
6412  TRACE("effect %p, device %p, data %p, data_size %lu, defines %p, include %p, eflags %#x, errors %p, "
6413  "pool %p, skip_constants %s.\n",
6414  effect, device, data, data_size, defines, include, eflags, errors, pool,
6415  debugstr_a(skip_constants_string));
6416 
6417  effect->ID3DXEffect_iface.lpVtbl = &ID3DXEffect_Vtbl;
6418  effect->ref = 1;
6419 
6420  if (pool)
6421  {
6423  pool->lpVtbl->AddRef(pool);
6424  }
6425 
6427  effect->device = device;
6428 
6429  effect->flags = eflags;
6430 
6431  list_init(&effect->parameter_block_list);
6432 
6433  read_dword(&ptr, &tag);
6434  TRACE("Tag: %x\n", tag);
6435 
6436  if (tag != d3dx9_effect_version(9, 1))
6437  {
6438  TRACE("HLSL ASCII effect, trying to compile it.\n");
6439  hr = D3DCompile(data, data_size, NULL, defines, include,
6440  NULL, "fx_2_0", compile_flags, eflags, &bytecode, &temp_errors);
6441  if (FAILED(hr))
6442  {
6443  WARN("Failed to compile ASCII effect.\n");
6444  if (bytecode)
6445  ID3D10Blob_Release(bytecode);
6446  if (temp_errors)
6447  {
6448  const char *error_string = ID3D10Blob_GetBufferPointer(temp_errors);
6449  const char *string_ptr;
6450 
6451  while (*error_string)
6452  {
6453  string_ptr = error_string;
6454  while (*string_ptr && *string_ptr != '\n' && *string_ptr != '\r'
6455  && string_ptr - error_string < 80)
6456  ++string_ptr;
6457  TRACE("%s\n", debugstr_an(error_string, string_ptr - error_string));
6458  error_string = string_ptr;
6459  while (*error_string == '\n' || *error_string == '\r')
6460  ++error_string;
6461  }
6462  }
6463  if (errors)
6464  *errors = temp_errors;
6465  else if (temp_errors)
6466  ID3D10Blob_Release(temp_errors);
6467  return hr;
6468  }
6469  if (!bytecode)
6470  {
6471  FIXME("No output from effect compilation.\n");
6472  return D3DERR_INVALIDCALL;
6473  }
6474  if (errors)
6475  *errors = temp_errors;
6476  else if (temp_errors)
6477  ID3D10Blob_Release(temp_errors);
6478 
6479  ptr = ID3D10Blob_GetBufferPointer(bytecode);
6480  read_dword(&ptr, &tag);
6481  TRACE("Tag: %x\n", tag);
6482  }
6483 
6484  if (skip_constants_string)
6485  {
6486  skip_constants_buffer = HeapAlloc(GetProcessHeap(), 0,
6487  sizeof(*skip_constants_buffer) * (strlen(skip_constants_string) + 1));
6488  if (!skip_constants_buffer)
6489  {
6490  if (bytecode)
6491  ID3D10Blob_Release(bytecode);
6492  return E_OUTOFMEMORY;
6493  }
6494  strcpy(skip_constants_buffer, skip_constants_string);
6495 
6496  if (!(skip_constants = parse_skip_constants_string(skip_constants_buffer, &skip_constants_count)))
6497  {
6498  HeapFree(GetProcessHeap(), 0, skip_constants_buffer);
6499  if (bytecode)
6500  ID3D10Blob_Release(bytecode);
6501  return E_OUTOFMEMORY;
6502  }
6503  }
6504  read_dword(&ptr, &offset);
6505  TRACE("Offset: %x\n", offset);
6506 
6507  hr = d3dx_parse_effect(effect, ptr, data_size, offset, skip_constants, skip_constants_count);
6508  if (bytecode)
6509  ID3D10Blob_Release(bytecode);
6510  if (hr != D3D_OK)
6511  {
6512  FIXME("Failed to parse effect.\n");
6513  HeapFree(GetProcessHeap(), 0, skip_constants_buffer);
6514  HeapFree(GetProcessHeap(), 0, skip_constants);
6515  return hr;
6516  }
6517 
6518  for (i = 0; i < skip_constants_count; ++i)
6519  {
6520  struct d3dx_parameter *param;
6521  param = get_parameter_by_name(effect, NULL, skip_constants[i]);
6522  if (param)
6523  {
6524  for (j = 0; j < effect->technique_count; ++j)
6525  {
6526  if (is_parameter_used(param, &effect->techniques[j]))
6527  {
6528  WARN("skip_constants parameter %s is used in technique %u.\n",
6529  debugstr_a(skip_constants[i]), j);
6530  HeapFree(GetProcessHeap(), 0, skip_constants_buffer);
6531  HeapFree(GetProcessHeap(), 0, skip_constants);
6532  return D3DERR_INVALIDCALL;
6533  }
6534  }
6535  }
6536  else
6537  {
6538  TRACE("skip_constants parameter %s not found.\n",
6539  debugstr_a(skip_constants[i]));
6540  }
6541  }
6542 
6543  HeapFree(GetProcessHeap(), 0, skip_constants_buffer);
6544  HeapFree(GetProcessHeap(), 0, skip_constants);
6545 
6546  /* initialize defaults - check because of unsupported ascii effects */
6547  if (effect->techniques)
6548  {
6549  effect->active_technique = &effect->techniques[0];
6550  effect->active_pass = NULL;
6551  }
6552 
6553  return D3D_OK;
6554 }
LOCAL struct eflags eflags[]
static BOOL is_parameter_used(struct d3dx_parameter *param, struct d3dx_technique *tech)
Definition: effect.c:3914
static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl
Definition: effect.c:4332
HRESULT hr
Definition: shlfolder.c:183
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
struct d3dx_effect_pool * pool
Definition: effect.c:192
#define WARN(fmt,...)
Definition: debug.h:112
struct d3dx_pass * active_pass
Definition: effect.c:194
#define D3DERR_INVALIDCALL
Definition: ecma_167.h:138
static struct d3dx_effect_pool * unsafe_impl_from_ID3DXEffectPool(ID3DXEffectPool *iface)
Definition: effect.c:6737
struct d3dx_technique * techniques
Definition: effect.c:182
static const char ** parse_skip_constants_string(char *skip_constants_string, unsigned int *names_count)
Definition: effect.c:6360
struct list parameter_block_list
Definition: effect.c:204
struct d3dx_technique * active_technique
Definition: effect.c:193
FxDevice * device
#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
Definition: d3dcompiler.h:51
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:111
static PVOID ptr
Definition: dispmode.c:27
static DWORD d3dx9_effect_version(DWORD major, DWORD minor)
Definition: effect.c:1114
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:79
GLintptr offset
Definition: glext.h:5920
GLfloat param
Definition: glext.h:5796
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:889
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
struct d3dx_parameter * get_parameter_by_name(struct d3dx_effect *effect, struct d3dx_parameter *parameter, const char *name)
Definition: effect.c:1026
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, UINT data_size, DWORD start, const char **skip_constants, unsigned int skip_constants_count)
Definition: effect.c:6187
#define D3D_OK
Definition: d3d.h:106
unsigned int technique_count
Definition: effect.c:179
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void read_dword(const char **ptr, DWORD *d)
Definition: effect.c:436
LONG ref
Definition: effect.c:176
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
ID3DXEffect ID3DXEffect_iface
Definition: effect.c:175
struct IDirect3DDevice9 * device
Definition: effect.c:191
DWORD flags
Definition: effect.c:184
#define HeapFree(x, y, z)
Definition: compat.h:594
char * tag
Definition: main.c:59

Referenced by D3DXCreateEffectEx().

◆ d3dx9_effect_version()

static DWORD d3dx9_effect_version ( DWORD  major,
DWORD  minor 
)
inlinestatic

Definition at line 1114 of file effect.c.

1115 {
1116  return (0xfeff0000 | ((major) << 8) | (minor));
1117 }
ULONG major
ULONG minor

Referenced by d3dx9_effect_init().

◆ d3dx9_get_param_value_ptr()

static HRESULT d3dx9_get_param_value_ptr ( struct d3dx_pass pass,
struct d3dx_state state,
void **  param_value,
struct d3dx_parameter **  out_param,
BOOL  update_all,
BOOL param_dirty 
)
static

Definition at line 1119 of file effect.c.

1122 {
1123  struct d3dx_parameter *param = &state->parameter;
1124 
1125  *param_value = NULL;
1126  *out_param = NULL;
1127  *param_dirty = FALSE;
1128 
1129  switch (state->type)
1130  {
1131  case ST_PARAMETER:
1132  param = state->referenced_param;
1133  *param_dirty = is_param_dirty(param, pass->update_version);
1134  /* fallthrough */
1135  case ST_CONSTANT:
1136  *out_param = param;
1137  *param_value = param->data;
1138  return D3D_OK;
1139  case ST_ARRAY_SELECTOR:
1140  {
1141  unsigned int array_idx;
1142  static const struct d3dx_parameter array_idx_param =
1143  {"", NULL, NULL, NULL, NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 0, 0, 0, sizeof(array_idx)};
1144  HRESULT hr;
1145  struct d3dx_parameter *ref_param, *selected_param;
1146 
1147  if (!param->param_eval)
1148  {
1149  FIXME("Preshader structure is null.\n");
1150  return D3DERR_INVALIDCALL;
1151  }
1152  /* We override with the update_version of the pass because we want
1153  * to force index recomputation and check for out of bounds. */
1154  if (is_param_eval_input_dirty(param->param_eval, pass->update_version))
1155  {
1156  if (FAILED(hr = d3dx_evaluate_parameter(param->param_eval, &array_idx_param, &array_idx)))
1157  return hr;
1158  }
1159  else
1160  {
1161  array_idx = state->index;
1162  }
1163  ref_param = state->referenced_param;
1164  TRACE("Array index %u, stored array index %u, element_count %u.\n", array_idx, state->index,
1165  ref_param->element_count);
1166  /* According to the tests, native d3dx handles the case of array index evaluated to -1
1167  * in a specific way, always selecting first array element and not returning error. */
1168  if (array_idx == ~0u)
1169  {
1170  WARN("Array index is -1, setting to 0.\n");
1171  array_idx = 0;
1172  }
1173 
1174  if (array_idx >= ref_param->element_count)
1175  {
1176  WARN("Computed array index %u is larger than array size %u.\n",
1177  array_idx, ref_param->element_count);
1178  return E_FAIL;
1179  }
1180  selected_param = &ref_param->members[array_idx];
1181  *param_dirty = state->index != array_idx || is_param_dirty(selected_param, pass->update_version);
1182  state->index = array_idx;
1183 
1184  *param_value = selected_param->data;
1185  *out_param = selected_param;
1186  return D3D_OK;
1187  }
1188  case ST_FXLC:
1189  if (param->param_eval)
1190  {
1191  *out_param = param;
1192  *param_value = param->data;
1193  /* We check with the update_version of the pass because the
1194  * same preshader might be used by both the vertex and the
1195  * pixel shader (that can happen e.g. for sampler states). */
1196  if (update_all || is_param_eval_input_dirty(param->param_eval, pass->update_version))
1197  {
1198  *param_dirty = TRUE;
1199  return d3dx_evaluate_parameter(param->param_eval, param, *param_value);
1200  }
1201  else
1202  return D3D_OK;
1203  }
1204  else
1205  {
1206  FIXME("No preshader for FXLC parameter.\n");
1207  return D3DERR_INVALIDCALL;
1208  }
1209  }
1210  return E_NOTIMPL;
1211 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
BOOL is_param_eval_input_dirty(struct d3dx_param_eval *peval, ULONG64 update_version) DECLSPEC_HIDDEN
Definition: preshader.c:1717
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
#define E_FAIL
Definition: ddrawi.h:102
pass
Definition: typegen.h:24
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
struct d3dx_parameter * members
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
GLfloat param
Definition: glext.h:5796
static BOOL is_param_dirty(struct d3dx_parameter *param, ULONG64 update_version)
static int state
Definition: maze.c:121
#define D3D_OK
Definition: d3d.h:106
HRESULT d3dx_evaluate_parameter(struct d3dx_param_eval *peval, const struct d3dx_parameter *param, void *param_value) DECLSPEC_HIDDEN
Definition: preshader.c:1723
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112

Referenced by d3dx9_apply_state(), d3dx_effect_GetPassDesc(), and d3dx_effect_ValidateTechnique().

◆ d3dx9_parse_name()

static HRESULT d3dx9_parse_name ( char **  name,
const char ptr 
)
static

Definition at line 5192 of file effect.c.

5193 {
5194  DWORD size;
5195 
5196  read_dword(&ptr, &size);
5197  TRACE("Name size: %#x\n", size);
5198 
5199  if (!size)
5200  {
5201  return D3D_OK;
5202  }
5203 
5204  *name = HeapAlloc(GetProcessHeap(), 0, size);
5205  if (!*name)
5206  {
5207  ERR("Failed to allocate name memory.\n");
5208  return E_OUTOFMEMORY;
5209  }
5210 
5211  TRACE("Name: %s.\n", debugstr_an(ptr, size));
5212  memcpy(*name, ptr, size);
5213 
5214  return D3D_OK;
5215 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static PVOID ptr
Definition: dispmode.c:27
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
static void read_dword(const char **ptr, DWORD *d)
Definition: effect.c:436
Definition: name.c:38

Referenced by d3dx_parse_effect_pass(), d3dx_parse_effect_technique(), and d3dx_parse_effect_typedef().

◆ d3dx9_set_light_parameter()

static void d3dx9_set_light_parameter ( enum LIGHT_TYPE  op,
D3DLIGHT9 light,
void value 
)
static

Definition at line 1341 of file effect.c.

1342 {
1343  static const struct
1344  {
1345  unsigned int offset;
1346  const char *name;
1347  }
1348  light_tbl[] =
1349  {
1350  {FIELD_OFFSET(D3DLIGHT9, Type), "LC_TYPE"},
1351  {FIELD_OFFSET(D3DLIGHT9, Diffuse), "LT_DIFFUSE"},
1352  {FIELD_OFFSET(D3DLIGHT9, Specular), "LT_SPECULAR"},
1353  {FIELD_OFFSET(D3DLIGHT9, Ambient), "LT_AMBIENT"},
1354  {FIELD_OFFSET(D3DLIGHT9, Position), "LT_POSITION"},
1355  {FIELD_OFFSET(D3DLIGHT9, Direction), "LT_DIRECTION"},
1356  {FIELD_OFFSET(D3DLIGHT9, Range), "LT_RANGE"},
1357  {FIELD_OFFSET(D3DLIGHT9, Falloff), "LT_FALLOFF"},
1358  {FIELD_OFFSET(D3DLIGHT9, Attenuation0), "LT_ATTENUATION0"},
1359  {FIELD_OFFSET(D3DLIGHT9, Attenuation1), "LT_ATTENUATION1"},
1360  {FIELD_OFFSET(D3DLIGHT9, Attenuation2), "LT_ATTENUATION2"},
1361  {FIELD_OFFSET(D3DLIGHT9, Theta), "LT_THETA"},
1362  {FIELD_OFFSET(D3DLIGHT9, Phi), "LT_PHI"}
1363  };
1364  switch (op)
1365  {
1366  case LT_TYPE:
1367  TRACE("LT_TYPE %u.\n", *(D3DLIGHTTYPE *)value);
1368  light->Type = *(D3DLIGHTTYPE *)value;
1369  break;
1370  case LT_DIFFUSE:
1371  case LT_SPECULAR:
1372  case LT_AMBIENT:
1373  {
1375 
1376  TRACE("%s (%.8e %.8e %.8e %.8e).\n", light_tbl[op].name, c.r, c.g, c.b, c.a);
1377  *(D3DCOLORVALUE *)((BYTE *)light + light_tbl[op].offset) = c;
1378  break;
1379  }
1380  case LT_POSITION:
1381  case LT_DIRECTION:
1382  {
1383  D3DVECTOR v = *(D3DVECTOR *)value;
1384 
1385  TRACE("%s (%.8e %.8e %.8e).\n", light_tbl[op].name, v.x, v.y, v.z);
1386  *(D3DVECTOR *)((BYTE *)light + light_tbl[op].offset) = v;
1387  break;
1388  }
1389  case LT_RANGE:
1390  case LT_FALLOFF:
1391  case LT_ATTENUATION0:
1392  case LT_ATTENUATION1:
1393  case LT_ATTENUATION2:
1394  case LT_THETA:
1395  case LT_PHI:
1396  {
1397  float v = *(float *)value;
1398  TRACE("%s %.8e.\n", light_tbl[op].name, v);
1399  *(float *)((BYTE *)light + light_tbl[op].offset) = v;
1400  break;
1401  }
1402  default:
1403  WARN("Unknown light parameter %u.\n", op);
1404  break;
1405  }
1406 }
Definition: pdh_main.c:93
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
static COORD Position
Definition: mouse.c:34
#define WARN(fmt,...)
Definition: debug.h:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
D3DLIGHTTYPE
Definition: d3dtypes.h:554
#define TRACE(s)
Definition: solgame.cpp:4
GLintptr offset
Definition: glext.h:5920
const GLubyte * c
Definition: glext.h:8905
Type
Definition: Type.h:6
UINT op
Definition: effect.c:236
Definition: effect.c:77
Definition: range.c:39
unsigned char BYTE
Definition: xxhash.c:193
Definition: effect.c:89
const GLdouble * v
Definition: gl.h:2040
const char * name
Definition: effect.c:237
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
Definition: name.c:38

Referenced by d3dx9_apply_state().

◆ d3dx9_set_material_parameter()

static void d3dx9_set_material_parameter ( enum MATERIAL_TYPE  op,
D3DMATERIAL9 material,
void value 
)
static

Definition at line 1408 of file effect.c.

1409 {
1410  static const struct
1411  {
1412  unsigned int offset;
1413  const char *name;
1414  }
1415  material_tbl[] =
1416  {
1417  {FIELD_OFFSET(D3DMATERIAL9, Diffuse), "MT_DIFFUSE"},
1418  {FIELD_OFFSET(D3DMATERIAL9, Ambient), "MT_AMBIENT"},
1419  {FIELD_OFFSET(D3DMATERIAL9, Specular), "MT_SPECULAR"},
1420  {FIELD_OFFSET(D3DMATERIAL9, Emissive), "MT_EMISSIVE"},
1421  {FIELD_OFFSET(D3DMATERIAL9, Power), "MT_POWER"}
1422  };
1423 
1424  switch (op)
1425  {
1426  case MT_POWER:
1427  {
1428  float v = *(float *)value;
1429 
1430  TRACE("%s %.8e.\n", material_tbl[op].name, v);
1431  material->Power = v;
1432  break;
1433  }
1434  case MT_DIFFUSE:
1435  case MT_AMBIENT:
1436  case MT_SPECULAR:
1437  case MT_EMISSIVE:
1438  {
1440 
1441  TRACE("%s, value (%.8e %.8e %.8e %.8e).\n", material_tbl[op].name, c.r, c.g, c.b, c.a);
1442  *(D3DCOLORVALUE *)((BYTE *)material + material_tbl[op].offset) = c;
1443  break;
1444  }
1445  default:
1446  WARN("Unknown material parameter %u.\n", op);
1447  break;
1448  }
1449 }
Definition: pdh_main.c:93
#define WARN(fmt,...)
Definition: debug.h:112
#define TRACE(s)
Definition: solgame.cpp:4
GLintptr offset
Definition: glext.h:5920
const GLubyte * c
Definition: glext.h:8905
UINT op
Definition: effect.c:236
unsigned char BYTE
Definition: xxhash.c:193
const GLdouble * v
Definition: gl.h:2040
const char * name
Definition: effect.c:237
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
Definition: name.c:38

Referenced by d3dx9_apply_state().

◆ d3dx_effect_AddRef()

static ULONG WINAPI d3dx_effect_AddRef ( ID3DXEffect *  iface)
static

Definition at line 1978 of file effect.c.

1979 {
1980  struct d3dx_effect *This = impl_from_ID3DXEffect(iface);
1981 
1982  TRACE("(%p)->(): AddRef from %u\n", This, This->ref);
1983 
1984  return InterlockedIncrement(&This->ref);
1985 }
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_ApplyParameterBlock()

static HRESULT WINAPI d3dx_effect_ApplyParameterBlock ( ID3DXEffect *  iface,
D3DXHANDLE  parameter_block 
)
static

Definition at line 4252 of file effect.c.

4253 {
4254  struct d3dx_parameter_block *block = get_valid_parameter_block(parameter_block);
4256 
4257  TRACE("iface %p, parameter_block %p.\n", iface, parameter_block);
4258 
4259  if (!block || !block->offset)
4260  return D3DERR_INVALIDCALL;
4261 
4262  record = (struct d3dx_recorded_parameter *)block->buffer;
4263  while ((BYTE *)record < block->buffer + block->offset)
4264  {
4265  set_value(record->param, record + 1, record->bytes,
4266  param_get_data_and_dirtify(block->effect, record->param, record->bytes, TRUE));
4268  }
4269  assert((BYTE *)record == block->buffer + block->offset);
4270  return D3D_OK;
4271 }
static unsigned int block
Definition: xmlmemory.c:118
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
#define TRUE
Definition: types.h:120
static struct d3dx_parameter_block * get_valid_parameter_block(D3DXHANDLE handle)
Definition: effect.c:527
#define D3DERR_INVALIDCALL
#define assert(x)
Definition: debug.h:53
static HRESULT set_value(struct d3dx_parameter *param, const void *data, unsigned int bytes, void *dst_data)
Definition: effect.c:889
static unsigned int get_recorded_parameter_size(const struct d3dx_recorded_parameter *record)
Definition: effect.c:722
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char BYTE
Definition: xxhash.c:193
#define D3D_OK
Definition: d3d.h:106
static void * param_get_data_and_dirtify(struct d3dx_effect *effect, struct d3dx_parameter *param, unsigned int bytes, BOOL value_changed)
Definition: effect.c:1330

◆ d3dx_effect_Begin()

static HRESULT WINAPI d3dx_effect_Begin ( ID3DXEffect *  iface,
UINT passes,
DWORD  flags 
)
static

Definition at line 3949 of file effect.c.

3950 {
3951  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
3952  struct d3dx_technique *technique = effect->active_technique;
3953 
3954  TRACE("iface %p, passes %p, flags %#x.\n", iface, passes, flags);
3955 
3956  if (technique)
3957  {
3959  WARN("Invalid flags (%#x) specified.\n", flags);
3960 
3962  {
3963  TRACE("State capturing disabled.\n");
3964  }
3965  else
3966  {
3967  HRESULT hr;
3968  unsigned int i;
3969 
3970  if (!technique->saved_state)
3971  {
3972  ID3DXEffectStateManager *manager;
3973 
3974  manager = effect->manager;
3975  effect->manager = NULL;
3977  ERR("BeginStateBlock failed, hr %#x.\n", hr);
3978  for (i = 0; i < technique->pass_count; i++)
3979  d3dx9_apply_pass_states(effect, &technique->passes[i], TRUE);
3980  if (FAILED(hr = IDirect3DDevice9_EndStateBlock(effect->device, &technique->saved_state)))
3981  ERR("EndStateBlock failed, hr %#x.\n", hr);
3982  effect->manager = manager;
3983  }
3985  ERR("StateBlock Capture failed, hr %#x.\n", hr);
3986  }
3987 
3988  if (passes)
3989  *passes = technique->pass_count;
3990  effect->started = TRUE;
3991  effect->begin_flags = flags;
3992 
3993  return D3D_OK;
3994  }
3995 
3996  WARN("Invalid argument supplied.\n");
3997 
3998  return D3DERR_INVALIDCALL;
3999 }
#define D3DXFX_DONOTSAVESHADERSTATE
Definition: d3dx9effect.h:25
struct ID3DXEffectStateManager * manager
Definition: effect.c:190
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
struct d3dx_technique * active_technique
Definition: effect.c:193
struct IDirect3DStateBlock9 * saved_state
Definition: effect.c:154
#define IDirect3DDevice9_BeginStateBlock(p)
Definition: d3d9.h:1567
UINT pass_count
Definition: effect.c:148
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define IDirect3DStateBlock9_Capture(p)
Definition: d3d9.h:1303
DWORD begin_flags
Definition: effect.c:196
GLbitfield flags
Definition: glext.h:7161
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static HRESULT d3dx9_apply_pass_states(struct d3dx_effect *effect, struct d3dx_pass *pass, BOOL update_all)
Definition: effect.c:1731
#define NULL
Definition: types.h:112
#define D3DXFX_DONOTSAVESAMPLERSTATE
Definition: d3dx9effect.h:26
struct IDirect3DDevice9 * device
Definition: effect.c:191
struct d3dx_pass * passes
Definition: effect.c:152
#define D3DXFX_DONOTSAVESTATE
Definition: d3dx9effect.h:24
#define IDirect3DDevice9_EndStateBlock(p, a)
Definition: d3d9.h:1568
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955
BOOL started
Definition: effect.c:195

◆ d3dx_effect_BeginParameterBlock()

static HRESULT WINAPI d3dx_effect_BeginParameterBlock ( ID3DXEffect *  iface)
static

Definition at line 4210 of file effect.c.

4211 {
4212  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
4213 
4214  TRACE("iface %p.\n", iface);
4215 
4216  if (effect->current_parameter_block)
4217  {
4218  WARN("Parameter block is already started.\n");
4219  return D3DERR_INVALIDCALL;
4220  }
4221 
4222  effect->current_parameter_block = heap_alloc_zero(sizeof(*effect->current_parameter_block));
4225  effect->current_parameter_block->effect = effect;
4226 
4227  return D3D_OK;
4228 }
static const char parameter_block_magic_string[4]
Definition: effect.c:38
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define D3D_OK
Definition: d3d.h:106
struct d3dx_parameter_block * current_parameter_block
Definition: effect.c:205
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_BeginPass()

static HRESULT WINAPI d3dx_effect_BeginPass ( ID3DXEffect *  iface,
UINT  pass 
)
static

Definition at line 4001 of file effect.c.

4002 {
4003  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
4004  struct d3dx_technique *technique = effect->active_technique;
4005 
4006  TRACE("iface %p, pass %u\n", effect, pass);
4007 
4008  if (technique && pass < technique->pass_count && !effect->active_pass)
4009  {
4010  HRESULT hr;
4011 
4012  memset(effect->current_light, 0, sizeof(effect->current_light));
4013  memset(&effect->current_material, 0, sizeof(effect->current_material));
4014 
4015  if (SUCCEEDED(hr = d3dx9_apply_pass_states(effect, &technique->passes[pass], TRUE)))
4016  effect->active_pass = &technique->passes[pass];
4017  return hr;
4018  }
4019 
4020  WARN("Invalid argument supplied.\n");
4021 
4022  return D3DERR_INVALIDCALL;
4023 }
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
struct d3dx_pass * active_pass
Definition: effect.c:194
#define D3DERR_INVALIDCALL
struct d3dx_technique * active_technique
Definition: effect.c:193
pass
Definition: typegen.h:24
D3DMATERIAL9 current_material
Definition: effect.c:201
if SUCCEEDED(hr)
UINT pass_count
Definition: effect.c:148
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
D3DLIGHT9 current_light[8]
Definition: effect.c:199
static HRESULT d3dx9_apply_pass_states(struct d3dx_effect *effect, struct d3dx_pass *pass, BOOL update_all)
Definition: effect.c:1731
struct d3dx_pass * passes
Definition: effect.c:152
#define memset(x, y, z)
Definition: compat.h:39
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_cleanup()

static void d3dx_effect_cleanup ( struct d3dx_effect effect)
static

Definition at line 746 of file effect.c.

747 {
749  ID3DXEffectPool *pool;
750  unsigned int i;
751 
752  TRACE("effect %p.\n", effect);
753 
754  free_parameter_block(effect->current_parameter_block);
755  LIST_FOR_EACH_ENTRY_SAFE(block, cursor, &effect->parameter_block_list, struct d3dx_parameter_block, entry)
756  {
757  list_remove(&block->entry);
759  }
760 
761  heap_free(effect->full_name_tmp);
762 
763  if (effect->parameters)
764  {
765  for (i = 0; i < effect->parameter_count; ++i)
766  free_top_level_parameter(&effect->parameters[i]);
767  heap_free(effect->parameters);
768  }
769 
770  if (effect->techniques)
771  {
772  for (i = 0; i < effect->technique_count; ++i)
773  free_technique(&effect->techniques[i]);
774  heap_free(effect->techniques);
775  }
776 
777  if (effect->objects)
778  {
779  for (i = 0; i < effect->object_count; ++i)
780  free_object(&effect->objects[i]);
781  heap_free(effect->objects);
782  }
783 
784  if (effect->pool)
785  {
786  pool = &effect->pool->ID3DXEffectPool_iface;
787  pool->lpVtbl->Release(pool);
788  }
789 
790  if (effect->manager)
791  IUnknown_Release(effect->manager);
792 
794  heap_free(effect);
795 }
static unsigned int block
Definition: xmlmemory.c:118
static void free_top_level_parameter(struct d3dx_top_level_parameter *param)
Definition: effect.c:644
struct d3dx_effect * effect
Definition: effect.c:160
#define IDirect3DDevice9_Release(p)
Definition: d3d9.h:1508
static void free_parameter_block(struct d3dx_parameter_block *block)
Definition: effect.c:727
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
static void free_technique(struct d3dx_technique *technique)
Definition: effect.c:687
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
const char cursor[]
Definition: icontest.c:13
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void free_object(struct d3dx_object *object)
Definition: effect.c:540
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by d3dx_effect_Release(), and D3DXCreateEffectEx().

◆ d3dx_effect_CloneEffect()

static HRESULT WINAPI d3dx_effect_CloneEffect ( ID3DXEffect *  iface,
IDirect3DDevice9 *  device,
ID3DXEffect **  new_effect 
)
static

Definition at line 4300 of file effect.c.

4302 {
4303  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
4304 
4305  FIXME("iface %p, device %p, new_effect %p stub.\n", effect, device, new_effect);
4306 
4307  if (!new_effect)
4308  return D3DERR_INVALIDCALL;
4309 
4310  if (effect->flags & D3DXFX_NOT_CLONEABLE)
4311  return E_FAIL;
4312 
4313  if (!device)
4314  return D3DERR_INVALIDCALL;
4315 
4316  iface->lpVtbl->AddRef(iface);
4317  *new_effect = iface;
4318  return S_OK;
4319 }
#define D3DERR_INVALIDCALL
#define E_FAIL
Definition: ddrawi.h:102
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:111
#define S_OK
Definition: intsafe.h:52
DWORD flags
Definition: effect.c:184
#define D3DXFX_NOT_CLONEABLE
Definition: d3dx9effect.h:27
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_CommitChanges()

static HRESULT WINAPI d3dx_effect_CommitChanges ( ID3DXEffect *  iface)
static

Definition at line 4025 of file effect.c.

4026 {
4027  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
4028 
4029  TRACE("iface %p.\n", iface);
4030 
4031  if (!effect->active_pass)
4032  {
4033  WARN("Called without an active pass.\n");
4034  return D3D_OK;
4035  }
4036  return d3dx9_apply_pass_states(effect, effect->active_pass, FALSE);
4037 }
#define WARN(fmt,...)
Definition: debug.h:112
struct d3dx_pass * active_pass
Definition: effect.c:194
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
static HRESULT d3dx9_apply_pass_states(struct d3dx_effect *effect, struct d3dx_pass *pass, BOOL update_all)
Definition: effect.c:1731
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_End()

static HRESULT WINAPI d3dx_effect_End ( ID3DXEffect *  iface)
static

Definition at line 4056 of file effect.c.

4057 {
4058  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
4059  struct d3dx_technique *technique = effect->active_technique;
4060 
4061  TRACE("iface %p.\n", iface);
4062 
4063  if (!effect->started)
4064  return D3D_OK;
4065 
4066  if (effect->begin_flags & D3DXFX_DONOTSAVESTATE)
4067  {
4068  TRACE("State restoring disabled.\n");
4069  }
4070  else
4071  {
4072  HRESULT hr;
4073 
4074  if (technique && technique->saved_state)
4075  {
4076  if (FAILED(hr = IDirect3DStateBlock9_Apply(technique->saved_state)))
4077  ERR("State block apply failed, hr %#x.\n", hr);
4078  }
4079  else
4080  ERR("No saved state.\n");
4081  }
4082 
4083  effect->started = FALSE;
4084 
4085  return D3D_OK;
4086 }
HRESULT hr
Definition: shlfolder.c:183
#define IDirect3DStateBlock9_Apply(p)
Definition: d3d9.h:1304
struct d3dx_technique * active_technique
Definition: effect.c:193
#define FALSE
Definition: types.h:117
struct IDirect3DStateBlock9 * saved_state
Definition: effect.c:154
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
DWORD begin_flags
Definition: effect.c:196
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
#define D3DXFX_DONOTSAVESTATE
Definition: d3dx9effect.h:24
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955
BOOL started
Definition: effect.c:195

◆ d3dx_effect_EndParameterBlock()

static D3DXHANDLE WINAPI d3dx_effect_EndParameterBlock ( ID3DXEffect *  iface)
static

Definition at line 4230 of file effect.c.

4231 {
4232  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
4233  struct d3dx_parameter_block *ret;
4234 
4235  TRACE("iface %p.\n", iface);
4236 
4237  if (!effect->current_parameter_block)
4238  {
4239  WARN("No active parameter block.\n");
4240  return NULL;
4241  }
4242  ret = effect->current_parameter_block;
4243 
4244  ret->buffer = heap_realloc(ret->buffer, ret->offset);
4245  ret->size = ret->offset;
4246 
4247  effect->current_parameter_block = NULL;
4248  list_add_tail(&effect->parameter_block_list, &ret->entry);
4249  return (D3DXHANDLE)ret;
4250 }
const char * D3DXHANDLE
Definition: d3dx9shader.h:48
#define WARN(fmt,...)
Definition: debug.h:112
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
struct d3dx_effect * effect
Definition: effect.c:160
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define NULL
Definition: types.h:112
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_EndPass()

static HRESULT WINAPI d3dx_effect_EndPass ( ID3DXEffect *  iface)
static

Definition at line 4039 of file effect.c.

4040 {
4041  struct d3dx_effect *This = impl_from_ID3DXEffect(iface);
4042 
4043  TRACE("iface %p\n", This);
4044 
4045  if (This->active_pass)
4046  {
4047  This->active_pass = NULL;
4048  return D3D_OK;
4049  }
4050 
4051  WARN("Invalid call.\n");
4052 
4053  return D3DERR_INVALIDCALL;
4054 }
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
#define NULL
Definition: types.h:112
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_FindNextValidTechnique()

static HRESULT WINAPI d3dx_effect_FindNextValidTechnique ( ID3DXEffect *  iface,
D3DXHANDLE  technique,
D3DXHANDLE next_technique 
)
static

Definition at line 3784 of file effect.c.

3786 {
3787  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
3788  struct d3dx_technique *prev_tech, *tech;
3789  unsigned int i;
3790 
3791  TRACE("iface %p, technique %p, next_technique %p.\n", iface, technique, next_technique);
3792 
3793  if (technique)
3794  {
3795  if (!(prev_tech = get_valid_technique(effect, technique)))
3796  return D3DERR_INVALIDCALL;
3797 
3798  for (i = 0; i < effect->technique_count; ++i)
3799  {
3800  tech = &effect->techniques[i];
3801  if (tech == prev_tech)
3802  {
3803  ++i;
3804  break;
3805  }
3806  }
3807  }
3808  else
3809  {
3810  i = 0;
3811  }
3812 
3813  for (; i < effect->technique_count; ++i)
3814  {
3815  tech = &effect->techniques[i];
3817  {
3818  *next_technique = get_technique_handle(tech);
3819  return D3D_OK;
3820  }
3821  }
3822 
3823  *next_technique = get_technique_handle(&effect->techniques[0]);
3824  return S_FALSE;
3825 }
#define D3DERR_INVALIDCALL
static struct d3dx_technique * get_valid_technique(struct d3dx_effect *effect, D3DXHANDLE technique)
Definition: effect.c:485
struct d3dx_technique * techniques
Definition: effect.c:182
if SUCCEEDED(hr)
#define S_FALSE
Definition: winerror.h:2357
static HRESULT WINAPI d3dx_effect_ValidateTechnique(ID3DXEffect *iface, D3DXHANDLE technique)
Definition: effect.c:3737
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
unsigned int technique_count
Definition: effect.c:179
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static D3DXHANDLE get_technique_handle(struct d3dx_technique *technique)
Definition: effect.c:460
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetAnnotation()

static D3DXHANDLE WINAPI d3dx_effect_GetAnnotation ( ID3DXEffect *  iface,
D3DXHANDLE  object,
UINT  index 
)
static

Definition at line 2370 of file effect.c.

2371 {
2372  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
2373  struct d3dx_parameter *annotations = NULL;
2374  unsigned int annotation_count;
2375 
2376  TRACE("iface %p, object %p, index %u.\n", iface, object, index);
2377 
2378  annotation_count = get_annotation_from_object(effect, object, &annotations);
2379 
2380  if (index < annotation_count)
2381  {
2382  TRACE("Returning parameter %p\n", &annotations[index]);
2383  return get_parameter_handle(&annotations[index]);
2384  }
2385 
2386  WARN("Annotation not found.\n");
2387 
2388  return NULL;
2389 }
#define WARN(fmt,...)
Definition: debug.h:112
static unsigned int get_annotation_from_object(struct d3dx_effect *effect, D3DXHANDLE object, struct d3dx_parameter **annotations)
Definition: effect.c:1213
GLuint index
Definition: glext.h:6031
static D3DXHANDLE get_parameter_handle(struct d3dx_parameter *parameter)
Definition: effect.c:455
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetAnnotationByName()

static D3DXHANDLE WINAPI d3dx_effect_GetAnnotationByName ( ID3DXEffect *  iface,
D3DXHANDLE  object,
const char name 
)
static

Definition at line 2391 of file effect.c.

2393 {
2394  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
2395  struct d3dx_parameter *annotation = NULL;
2396  struct d3dx_parameter *annotations = NULL;
2397  unsigned int annotation_count;
2398 
2399  TRACE("iface %p, object %p, name %s.\n", iface, object, debugstr_a(name));
2400 
2401  if (!name)
2402  {
2403  WARN("Invalid argument specified\n");
2404  return NULL;
2405  }
2406 
2407  annotation_count = get_annotation_from_object(effect, object, &annotations);
2408 
2409  annotation = get_annotation_by_name(effect, annotation_count, annotations, name);
2410  if (annotation)
2411  {
2412  TRACE("Returning parameter %p\n", annotation);
2414  }
2415 
2416  WARN("Annotation not found.\n");
2417 
2418  return NULL;
2419 }
#define WARN(fmt,...)
Definition: debug.h:112
static unsigned int get_annotation_from_object(struct d3dx_effect *effect, D3DXHANDLE object, struct d3dx_parameter **annotations)
Definition: effect.c:1213
static D3DXHANDLE get_parameter_handle(struct d3dx_parameter *parameter)
Definition: effect.c:455
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
static struct d3dx_parameter * get_annotation_by_name(struct d3dx_effect *effect, unsigned int count, struct d3dx_parameter *annotations, const char *name)
Definition: effect.c:982
#define NULL
Definition: types.h:112
Definition: name.c:38
#define annotation(x)
Definition: dispex.idl:19
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetBool()

static HRESULT WINAPI d3dx_effect_GetBool ( ID3DXEffect *  iface,
D3DXHANDLE  parameter,
BOOL b 
)
static

Definition at line 2532 of file effect.c.

2533 {
2534  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
2535  struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
2536 
2537  TRACE("iface %p, parameter %p, b %p.\n", iface, parameter, b);
2538 
2539  if (b && param && !param->element_count && param->rows == 1 && param->columns == 1)
2540  {
2541  set_number(b, D3DXPT_BOOL, param->data, param->type);
2542  TRACE("Returning %s\n", *b ? "TRUE" : "FALSE");
2543  return D3D_OK;
2544  }
2545 
2546  WARN("Parameter not found.\n");
2547 
2548  return D3DERR_INVALIDCALL;
2549 }
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
static struct d3dx_parameter * get_valid_parameter(struct d3dx_effect *effect, D3DXHANDLE parameter)
Definition: effect.c:516
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat param
Definition: glext.h:5796
static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
Definition: effect.c:101
#define D3D_OK
Definition: d3d.h:106
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetBoolArray()

static HRESULT WINAPI d3dx_effect_GetBoolArray ( ID3DXEffect *  iface,
D3DXHANDLE  parameter,
BOOL b,
UINT  count 
)
static

Definition at line 2593 of file effect.c.

2594 {
2595  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
2596  struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
2597 
2598  TRACE("iface %p, parameter %p, b %p, count %u.\n", iface, parameter, b, count);
2599 
2600  if (b && param && (param->class == D3DXPC_SCALAR
2601  || param->class == D3DXPC_VECTOR
2602  || param->class == D3DXPC_MATRIX_ROWS
2603  || param->class == D3DXPC_MATRIX_COLUMNS))
2604  {
2605  unsigned int i, size = min(count, param->bytes / sizeof(DWORD));
2606 
2607  for (i = 0; i < size; ++i)
2608  {
2609  set_number(&b[i], D3DXPT_BOOL, (DWORD *)param->data + i, param->type);
2610  }
2611  return D3D_OK;
2612  }
2613 
2614  WARN("Parameter not found.\n");
2615 
2616  return D3DERR_INVALIDCALL;
2617 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
static struct d3dx_parameter * get_valid_parameter(struct d3dx_effect *effect, D3DXHANDLE parameter)
Definition: effect.c:516
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
Definition: effect.c:101
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define min(a, b)
Definition: monoChain.cc:55
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetCurrentTechnique()

static D3DXHANDLE WINAPI d3dx_effect_GetCurrentTechnique ( ID3DXEffect *  iface)
static

Definition at line 3728 of file effect.c.

3729 {
3730  struct d3dx_effect *This = impl_from_ID3DXEffect(iface);
3731 
3732  TRACE("iface %p\n", This);
3733 
3734  return get_technique_handle(This->active_technique);
3735 }
#define TRACE(s)
Definition: solgame.cpp:4
static D3DXHANDLE get_technique_handle(struct d3dx_technique *technique)
Definition: effect.c:460
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetDesc()

static HRESULT WINAPI d3dx_effect_GetDesc ( ID3DXEffect *  iface,
D3DXEFFECT_DESC desc 
)
static

Definition at line 2001 of file effect.c.

2002 {
2003  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
2004 
2005  FIXME("iface %p, desc %p partial stub.\n", iface, desc);
2006 
2007  if (!desc)
2008  {
2009  WARN("Invalid argument specified.\n");
2010  return D3DERR_INVALIDCALL;
2011  }
2012 
2013  /* TODO: add creator and function count. */
2014  desc->Creator = NULL;
2015  desc->Functions = 0;
2016  desc->Parameters = effect->parameter_count;
2017  desc->Techniques = effect->technique_count;
2018 
2019  return D3D_OK;
2020 }
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
static const WCHAR desc[]
Definition: protectdata.c:36
#define FIXME(fmt,...)
Definition: debug.h:111
#define D3D_OK
Definition: d3d.h:106
unsigned int technique_count
Definition: effect.c:179
unsigned int parameter_count
Definition: effect.c:178
#define NULL
Definition: types.h:112
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetDevice()

static HRESULT WINAPI d3dx_effect_GetDevice ( ID3DXEffect *  iface,
struct IDirect3DDevice9 **  device 
)
static

Definition at line 4088 of file effect.c.

4089 {
4090  struct d3dx_effect *This = impl_from_ID3DXEffect(iface);
4091 
4092  TRACE("iface %p, device %p\n", This, device);
4093 
4094  if (!device)
4095  {
4096  WARN("Invalid argument supplied.\n");
4097  return D3DERR_INVALIDCALL;
4098  }
4099 
4100  IDirect3DDevice9_AddRef(This->device);
4101 
4102  *device = This->device;
4103 
4104  TRACE("Returning device %p\n", *device);
4105 
4106  return S_OK;
4107 }
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
#define S_OK
Definition: intsafe.h:52
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetFloat()

static HRESULT WINAPI d3dx_effect_GetFloat ( ID3DXEffect *  iface,
D3DXHANDLE  parameter,
float f 
)
static

Definition at line 2788 of file effect.c.

2789 {
2790  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
2791  struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
2792 
2793  TRACE("iface %p, parameter %p, f %p.\n", iface, parameter, f);
2794 
2795  if (f && param && !param->element_count && param->columns == 1 && param->rows == 1)
2796  {
2797  set_number(f, D3DXPT_FLOAT, (DWORD *)param->data, param->type);
2798  TRACE("Returning %f.\n", *f);
2799  return D3D_OK;
2800  }
2801 
2802  WARN("Parameter not found.\n");
2803 
2804  return D3DERR_INVALIDCALL;
2805 }
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
GLfloat f
Definition: glext.h:7540
static struct d3dx_parameter * get_valid_parameter(struct d3dx_effect *effect, D3DXHANDLE parameter)
Definition: effect.c:516
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
Definition: effect.c:101
#define D3D_OK
Definition: d3d.h:106
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetFloatArray()

static HRESULT WINAPI d3dx_effect_GetFloatArray ( ID3DXEffect *  iface,
D3DXHANDLE  parameter,
float f,
UINT  count 
)
static

Definition at line 2847 of file effect.c.

2848 {
2849  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
2850  struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
2851 
2852  TRACE("iface %p, parameter %p, f %p, count %u.\n", iface, parameter, f, count);
2853 
2854  if (f && param && (param->class == D3DXPC_SCALAR
2855  || param->class == D3DXPC_VECTOR
2856  || param->class == D3DXPC_MATRIX_ROWS
2857  || param->class == D3DXPC_MATRIX_COLUMNS))
2858  {
2859  unsigned int i, size = min(count, param->bytes / sizeof(DWORD));
2860 
2861  for (i = 0; i < size; ++i)
2862  set_number(&f[i], D3DXPT_FLOAT, (DWORD *)param->data + i, param->type);
2863  return D3D_OK;
2864  }
2865 
2866  WARN("Parameter not found.\n");
2867 
2868  return D3DERR_INVALIDCALL;
2869 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
GLfloat f
Definition: glext.h:7540
static struct d3dx_parameter * get_valid_parameter(struct d3dx_effect *effect, D3DXHANDLE parameter)
Definition: effect.c:516
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
Definition: effect.c:101
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define min(a, b)
Definition: monoChain.cc:55
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetFunction()

static D3DXHANDLE WINAPI d3dx_effect_GetFunction ( ID3DXEffect *  iface,
UINT  index 
)
static

Definition at line 2356 of file effect.c.

2357 {
2358  FIXME("iface %p, index %u stub.\n", iface, index);
2359 
2360  return NULL;
2361 }
#define FIXME(fmt,...)
Definition: debug.h:111
GLuint index
Definition: glext.h:6031
#define NULL
Definition: types.h:112

◆ d3dx_effect_GetFunctionByName()

static D3DXHANDLE WINAPI d3dx_effect_GetFunctionByName ( ID3DXEffect *  iface,
const char name 
)
static

Definition at line 2363 of file effect.c.

2364 {
2365  FIXME("iface %p, name %s stub.\n", iface, debugstr_a(name));
2366 
2367  return NULL;
2368 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_a
Definition: kernel32.h:31
#define NULL
Definition: types.h:112
Definition: name.c:38

◆ d3dx_effect_GetFunctionDesc()

static HRESULT WINAPI d3dx_effect_GetFunctionDesc ( ID3DXEffect *  iface,
D3DXHANDLE  shader,
D3DXFUNCTION_DESC desc 
)
static

Definition at line 2124 of file effect.c.

2126 {
2127  FIXME("iface %p, shader %p, desc %p stub.\n", iface, shader, desc);
2128 
2129  return E_NOTIMPL;
2130 }
static const WCHAR desc[]
Definition: protectdata.c:36
#define FIXME(fmt,...)
Definition: debug.h:111
GLuint shader
Definition: glext.h:6030
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx_effect_GetInt()

static HRESULT WINAPI d3dx_effect_GetInt ( ID3DXEffect *  iface,
D3DXHANDLE  parameter,
INT n 
)
static

Definition at line 2665 of file effect.c.

2666 {
2667  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
2668  struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
2669 
2670  TRACE("iface %p, parameter %p, n %p.\n", iface, parameter, n);
2671 
2672  if (n && param && !param->element_count)
2673  {
2674  if (param->columns == 1 && param->rows == 1)
2675  {
2676  set_number(n, D3DXPT_INT, param->data, param->type);
2677  TRACE("Returning %d.\n", *n);
2678  return D3D_OK;
2679  }
2680 
2681  if (param->type == D3DXPT_FLOAT &&
2682  ((param->class == D3DXPC_VECTOR && param->columns != 2)
2683  || (param->class == D3DXPC_MATRIX_ROWS && param->rows != 2 && param->columns == 1)))
2684  {
2685  TRACE("Vector fixup.\n");
2686 
2687  *n = min(max(0.0f, *((float *)param->data + 2)), 1.0f) * INT_FLOAT_MULTI;
2688  *n += ((int)(min(max(0.0f, *((float *)param->data + 1)), 1.0f) * INT_FLOAT_MULTI)) << 8;
2689  *n += ((int)(min(max(0.0f, *((float *)param->data + 0)), 1.0f) * INT_FLOAT_MULTI)) << 16;
2690  if (param->columns * param->rows > 3)
2691  *n += ((int)(min(max(0.0f, *((float *)param->data + 3)), 1.0f) * INT_FLOAT_MULTI)) << 24;
2692 
2693  TRACE("Returning %d.\n", *n);
2694  return D3D_OK;
2695  }
2696  }
2697 
2698  WARN("Parameter not found.\n");
2699 
2700  return D3DERR_INVALIDCALL;
2701 }
#define max(a, b)
Definition: svc.c:63
#define WARN(fmt,...)
Definition: debug.h:112
GLdouble n
Definition: glext.h:7729
#define D3DERR_INVALIDCALL
#define INT_FLOAT_MULTI
Definition: effect.c:34
GLfloat f
Definition: glext.h:7540
static struct d3dx_parameter * get_valid_parameter(struct d3dx_effect *effect, D3DXHANDLE parameter)
Definition: effect.c:516
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat param
Definition: glext.h:5796
static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
Definition: effect.c:101
#define D3D_OK
Definition: d3d.h:106
#define min(a, b)
Definition: monoChain.cc:55
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ d3dx_effect_GetIntArray()

static HRESULT WINAPI d3dx_effect_GetIntArray ( ID3DXEffect *  iface,
D3DXHANDLE  parameter,
INT n,
UINT  count 
)
static

Definition at line 2742 of file effect.c.

2743 {
2744  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
2745  struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
2746 
2747  TRACE("iface %p, parameter %p, n %p, count %u.\n", iface, parameter, n, count);
2748 
2749  if (n && param && (param->class == D3DXPC_SCALAR
2750  || param->class == D3DXPC_VECTOR
2751  || param->class == D3DXPC_MATRIX_ROWS
2752  || param->class == D3DXPC_MATRIX_COLUMNS))
2753  {
2754  unsigned int i, size = min(count, param->bytes / sizeof(DWORD));
2755 
2756  for (i = 0; i < size; ++i)
2757  set_number(&n[i], D3DXPT_INT, (DWORD *)param->data + i, param->type);
2758  return D3D_OK;
2759  }
2760 
2761  WARN("Parameter not found.\n");
2762 
2763  return D3DERR_INVALIDCALL;
2764 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:112
GLdouble n
Definition: glext.h:7729
#define D3DERR_INVALIDCALL
static struct d3dx_parameter * get_valid_parameter(struct d3dx_effect *effect, D3DXHANDLE parameter)
Definition: effect.c:516
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
Definition: effect.c:101
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define min(a, b)
Definition: monoChain.cc:55
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetMatrix()

static HRESULT WINAPI d3dx_effect_GetMatrix ( ID3DXEffect *  iface,
D3DXHANDLE  parameter,
D3DXMATRIX matrix 
)
static

Definition at line 3101 of file effect.c.

3102 {
3103  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
3104  struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
3105 
3106  TRACE("iface %p, parameter %p, matrix %p.\n", iface, parameter, matrix);
3107 
3108  if (matrix && param && !param->element_count)
3109  {
3110  TRACE("Class %s.\n", debug_d3dxparameter_class(param->class));
3111 
3112  switch (param->class)
3113  {
3114  case D3DXPC_MATRIX_ROWS:
3116  return D3D_OK;
3117 
3118  case D3DXPC_SCALAR:
3119  case D3DXPC_VECTOR:
3120  case D3DXPC_OBJECT:
3121  case D3DXPC_STRUCT:
3122  break;
3123 
3124  default:
3125  FIXME("Unhandled class %s.\n", debug_d3dxparameter_class(param->class));
3126  break;
3127  }
3128  }
3129 
3130  WARN("Parameter not found.\n");
3131 
3132  return D3DERR_INVALIDCALL;
3133 }
const char * debug_d3dxparameter_class(D3DXPARAMETER_CLASS c) DECLSPEC_HIDDEN
Definition: util.c:237
GLuint GLenum matrix
Definition: glext.h:9407
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
static void get_matrix(struct d3dx_parameter *param, D3DXMATRIX *matrix, BOOL transpose)
Definition: effect.c:818
static struct d3dx_parameter * get_valid_parameter(struct d3dx_effect *effect, D3DXHANDLE parameter)
Definition: effect.c:516
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat param
Definition: glext.h:5796
#define D3D_OK
Definition: d3d.h:106
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetMatrixArray()

static HRESULT WINAPI d3dx_effect_GetMatrixArray ( ID3DXEffect *  iface,
D3DXHANDLE  parameter,
D3DXMATRIX matrix,
UINT  count 
)
static

Definition at line 3179 of file effect.c.

3181 {
3182  struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
3183  struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
3184 
3185  TRACE("iface %p, parameter %p, matrix %p, count %u.\n", iface, parameter, matrix, count);
3186 
3187  if (!count)
3188  return D3D_OK;
3189 
3191  {
3192  unsigned int i;
3193 
3194  TRACE("Class %s.\n", debug_d3dxparameter_class(param->class));
3195 
3196  switch (param->class)
3197  {
3198  case D3DXPC_MATRIX_ROWS:
3199  for (i = 0; i < count; ++i)
3200  get_matrix(&param->members[i], &matrix[i], FALSE);
3201  return D3D_OK;
3202 
3203  case D3DXPC_SCALAR:
3204  case D3DXPC_VECTOR:
3205  case D3DXPC_OBJECT:
3206  case D3DXPC_STRUCT:
3207  break;
3208 
3209  default:
3210  FIXME("Unhandled class %s.\n", debug_d3dxparameter_class(param->class));
3211  break;
3212  }
3213  }
3214 
3215  WARN("Parameter not found.\n");
3216 
3217  return D3DERR_INVALIDCALL;
3218 }
const char * debug_d3dxparameter_class(D3DXPARAMETER_CLASS c) DECLSPEC_HIDDEN
Definition: util.c:237
GLuint GLenum matrix
Definition: glext.h:9407
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
static void get_matrix(struct d3dx_parameter *param, D3DXMATRIX *matrix, BOOL transpose)
Definition: effect.c:818
static struct d3dx_parameter * get_valid_parameter(struct d3dx_effect *effect, D3DXHANDLE parameter)
Definition: effect.c:516
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat param
Definition: glext.h:5796
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static struct d3dx_effect * impl_from_ID3DXEffect(ID3DXEffect *iface)
Definition: effect.c:1955

◆ d3dx_effect_GetMatrixPointerArray()

static HRESULT WINAPI d3dx_effect_GetMatrixPointerArray ( ID3DXEffect *  iface,
D3DXHANDLE  parameter,