2008-10-20 15:28:08 +02:00
|
|
|
/*
|
2009-02-27 09:29:48 +01:00
|
|
|
* Copyright 2008-2009 Henri Verbeet for CodeWeavers
|
2008-10-20 15:28:08 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_D3D10_PRIVATE_H
|
|
|
|
#define __WINE_D3D10_PRIVATE_H
|
|
|
|
|
2019-05-30 09:13:25 +02:00
|
|
|
#include <math.h>
|
|
|
|
|
2008-10-20 15:28:08 +02:00
|
|
|
#include "wine/debug.h"
|
2009-09-08 16:38:00 +02:00
|
|
|
#include "wine/rbtree.h"
|
2018-02-01 00:37:36 +01:00
|
|
|
#include "wine/heap.h"
|
2008-10-20 15:28:08 +02:00
|
|
|
|
2008-10-20 15:28:09 +02:00
|
|
|
#define COBJMACROS
|
2008-10-20 15:28:08 +02:00
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "objbase.h"
|
|
|
|
|
|
|
|
#include "d3d10.h"
|
2010-08-26 17:17:38 +02:00
|
|
|
#include "d3dcompiler.h"
|
2008-10-20 15:28:08 +02:00
|
|
|
|
2010-04-07 18:34:24 +02:00
|
|
|
/*
|
|
|
|
* This doesn't belong here, but for some functions it is possible to return that value,
|
|
|
|
* see http://msdn.microsoft.com/en-us/library/bb205278%28v=VS.85%29.aspx
|
|
|
|
* The original definition is in D3DX10core.h.
|
|
|
|
*/
|
|
|
|
#define D3DERR_INVALIDCALL 0x8876086c
|
|
|
|
|
2021-08-20 21:24:52 +02:00
|
|
|
enum d3d10_effect_object_type_flags
|
|
|
|
{
|
|
|
|
D3D10_EOT_FLAG_GS_SO = 0x1,
|
|
|
|
};
|
|
|
|
|
2010-01-10 19:30:42 +01:00
|
|
|
enum d3d10_effect_object_operation
|
|
|
|
{
|
2021-10-01 08:14:00 +02:00
|
|
|
D3D10_EOO_CONST = 1,
|
|
|
|
D3D10_EOO_VAR = 2,
|
|
|
|
D3D10_EOO_CONST_INDEX = 3,
|
|
|
|
D3D10_EOO_VAR_INDEX = 4,
|
|
|
|
D3D10_EOO_INDEX_EXPRESSION = 5,
|
2021-11-19 15:52:45 +01:00
|
|
|
D3D10_EOO_VALUE_EXPRESSION = 6,
|
2010-01-10 19:30:42 +01:00
|
|
|
D3D10_EOO_ANONYMOUS_SHADER = 7,
|
|
|
|
};
|
|
|
|
|
2020-03-24 14:05:56 +01:00
|
|
|
struct d3d10_matrix
|
|
|
|
{
|
|
|
|
float m[4][4];
|
|
|
|
};
|
|
|
|
|
2020-03-24 14:07:41 +01:00
|
|
|
struct d3d10_effect_shader_resource
|
|
|
|
{
|
|
|
|
D3D10_SHADER_INPUT_TYPE in_type;
|
|
|
|
unsigned int bind_point;
|
|
|
|
unsigned int bind_count;
|
|
|
|
|
|
|
|
struct d3d10_effect_variable *variable;
|
|
|
|
};
|
|
|
|
|
2010-04-07 18:34:16 +02:00
|
|
|
struct d3d10_effect_shader_signature
|
|
|
|
{
|
|
|
|
char *signature;
|
|
|
|
UINT signature_size;
|
2010-04-07 18:34:24 +02:00
|
|
|
UINT element_count;
|
|
|
|
D3D10_SIGNATURE_PARAMETER_DESC *elements;
|
2010-04-07 18:34:16 +02:00
|
|
|
};
|
|
|
|
|
2009-03-03 09:03:46 +01:00
|
|
|
struct d3d10_effect_shader_variable
|
|
|
|
{
|
2021-08-23 10:23:03 +02:00
|
|
|
ID3D10ShaderReflection *reflection;
|
2021-08-23 10:23:06 +02:00
|
|
|
ID3D10Blob *input_signature;
|
2021-08-30 07:06:37 +02:00
|
|
|
ID3D10Blob *bytecode;
|
2009-03-06 08:43:48 +01:00
|
|
|
union
|
|
|
|
{
|
|
|
|
ID3D10VertexShader *vs;
|
|
|
|
ID3D10PixelShader *ps;
|
|
|
|
ID3D10GeometryShader *gs;
|
2021-10-28 09:46:38 +02:00
|
|
|
IUnknown *object;
|
2009-03-06 08:43:48 +01:00
|
|
|
} shader;
|
2020-03-24 14:07:41 +01:00
|
|
|
|
|
|
|
unsigned int resource_count;
|
|
|
|
struct d3d10_effect_shader_resource *resources;
|
2021-08-20 21:24:52 +02:00
|
|
|
char *stream_output_declaration;
|
2021-09-01 15:04:30 +02:00
|
|
|
unsigned int isinline : 1;
|
2009-02-27 09:29:48 +01:00
|
|
|
};
|
|
|
|
|
2021-11-01 11:51:52 +01:00
|
|
|
struct d3d10_effect_prop_dependencies
|
|
|
|
{
|
|
|
|
struct d3d10_effect_prop_dependency *entries;
|
|
|
|
SIZE_T count;
|
|
|
|
SIZE_T capacity;
|
|
|
|
};
|
|
|
|
|
2021-10-04 13:48:48 +02:00
|
|
|
struct d3d10_effect_sampler_desc
|
|
|
|
{
|
|
|
|
D3D10_SAMPLER_DESC desc;
|
|
|
|
struct d3d10_effect_variable *texture;
|
|
|
|
};
|
|
|
|
|
2012-09-26 10:12:12 +02:00
|
|
|
struct d3d10_effect_state_object_variable
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
D3D10_RASTERIZER_DESC rasterizer;
|
|
|
|
D3D10_DEPTH_STENCIL_DESC depth_stencil;
|
|
|
|
D3D10_BLEND_DESC blend;
|
2021-10-04 13:48:48 +02:00
|
|
|
struct d3d10_effect_sampler_desc sampler;
|
2012-09-26 10:12:12 +02:00
|
|
|
} desc;
|
2012-09-26 22:34:01 +02:00
|
|
|
union
|
|
|
|
{
|
2012-10-01 11:05:20 +02:00
|
|
|
ID3D10RasterizerState *rasterizer;
|
2012-10-01 11:05:19 +02:00
|
|
|
ID3D10DepthStencilState *depth_stencil;
|
2012-09-26 22:34:01 +02:00
|
|
|
ID3D10BlendState *blend;
|
2012-10-08 21:32:39 +02:00
|
|
|
ID3D10SamplerState *sampler;
|
2021-10-01 08:13:58 +02:00
|
|
|
IUnknown *object;
|
2012-09-26 22:34:01 +02:00
|
|
|
} object;
|
2021-11-01 11:51:52 +01:00
|
|
|
struct d3d10_effect_prop_dependencies dependencies;
|
2012-09-26 10:12:12 +02:00
|
|
|
};
|
|
|
|
|
2020-03-26 05:05:32 +01:00
|
|
|
struct d3d10_effect_resource_variable
|
|
|
|
{
|
|
|
|
ID3D10ShaderResourceView **srv;
|
|
|
|
BOOL parent;
|
|
|
|
};
|
|
|
|
|
2020-02-25 18:40:36 +01:00
|
|
|
struct d3d10_effect_buffer_variable
|
|
|
|
{
|
|
|
|
ID3D10Buffer *buffer;
|
|
|
|
ID3D10ShaderResourceView *resource_view;
|
|
|
|
|
|
|
|
BOOL changed;
|
|
|
|
BYTE *local_buffer;
|
|
|
|
};
|
|
|
|
|
2009-09-08 16:38:00 +02:00
|
|
|
/* ID3D10EffectType */
|
|
|
|
struct d3d10_effect_type
|
|
|
|
{
|
2011-06-02 11:19:38 +02:00
|
|
|
ID3D10EffectType ID3D10EffectType_iface;
|
2009-09-08 16:38:00 +02:00
|
|
|
|
2010-01-24 14:25:19 +01:00
|
|
|
char *name;
|
|
|
|
D3D10_SHADER_VARIABLE_TYPE basetype;
|
|
|
|
D3D10_SHADER_VARIABLE_CLASS type_class;
|
2021-08-20 21:24:52 +02:00
|
|
|
unsigned int flags;
|
2010-01-24 14:25:19 +01:00
|
|
|
|
2009-09-08 16:38:00 +02:00
|
|
|
DWORD id;
|
|
|
|
struct wine_rb_entry entry;
|
2009-09-30 11:42:14 +02:00
|
|
|
struct d3d10_effect *effect;
|
2009-09-08 16:38:01 +02:00
|
|
|
|
|
|
|
DWORD element_count;
|
|
|
|
DWORD size_unpacked;
|
|
|
|
DWORD stride;
|
|
|
|
DWORD size_packed;
|
|
|
|
DWORD member_count;
|
|
|
|
DWORD column_count;
|
|
|
|
DWORD row_count;
|
2009-10-21 22:59:46 +02:00
|
|
|
struct d3d10_effect_type *elementtype;
|
2009-09-30 11:42:14 +02:00
|
|
|
struct d3d10_effect_type_member *members;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct d3d10_effect_type_member
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
char *semantic;
|
|
|
|
DWORD buffer_offset;
|
|
|
|
struct d3d10_effect_type *type;
|
2009-09-08 16:38:00 +02:00
|
|
|
};
|
|
|
|
|
2021-10-08 07:13:32 +02:00
|
|
|
struct d3d10_effect_annotations
|
|
|
|
{
|
|
|
|
struct d3d10_effect_variable *elements;
|
|
|
|
unsigned int count;
|
|
|
|
};
|
|
|
|
|
2009-07-15 12:21:21 +02:00
|
|
|
/* ID3D10EffectVariable */
|
2009-07-15 12:21:20 +02:00
|
|
|
struct d3d10_effect_variable
|
|
|
|
{
|
2012-04-15 18:57:12 +02:00
|
|
|
ID3D10EffectVariable ID3D10EffectVariable_iface;
|
2009-07-15 12:21:21 +02:00
|
|
|
|
2009-09-30 11:40:38 +02:00
|
|
|
struct d3d10_effect_variable *buffer;
|
2010-01-10 19:30:36 +01:00
|
|
|
struct d3d10_effect_type *type;
|
2009-09-09 19:17:01 +02:00
|
|
|
|
2009-07-15 12:21:20 +02:00
|
|
|
char *name;
|
2009-09-10 21:00:22 +02:00
|
|
|
char *semantic;
|
2009-07-15 12:21:20 +02:00
|
|
|
DWORD buffer_offset;
|
2009-08-26 22:30:40 +02:00
|
|
|
DWORD flag;
|
2009-07-14 11:17:38 +02:00
|
|
|
DWORD data_size;
|
2021-08-26 07:32:13 +02:00
|
|
|
DWORD explicit_bind_point;
|
2010-01-24 14:25:19 +01:00
|
|
|
struct d3d10_effect *effect;
|
2009-10-21 22:59:46 +02:00
|
|
|
struct d3d10_effect_variable *elements;
|
2009-09-30 11:39:13 +02:00
|
|
|
struct d3d10_effect_variable *members;
|
2021-10-08 07:13:32 +02:00
|
|
|
struct d3d10_effect_annotations annotations;
|
2012-09-26 22:34:00 +02:00
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct d3d10_effect_state_object_variable state;
|
|
|
|
struct d3d10_effect_shader_variable shader;
|
2020-02-25 18:40:36 +01:00
|
|
|
struct d3d10_effect_buffer_variable buffer;
|
2020-03-26 05:05:32 +01:00
|
|
|
struct d3d10_effect_resource_variable resource;
|
2012-09-26 22:34:00 +02:00
|
|
|
} u;
|
2009-07-14 11:17:38 +02:00
|
|
|
};
|
|
|
|
|
2021-10-06 09:53:32 +02:00
|
|
|
struct d3d10_effect_pass_shader_desc
|
|
|
|
{
|
|
|
|
struct d3d10_effect_variable *shader;
|
|
|
|
unsigned int index;
|
|
|
|
};
|
|
|
|
|
2009-03-02 08:52:49 +01:00
|
|
|
/* ID3D10EffectPass */
|
2009-02-27 09:29:48 +01:00
|
|
|
struct d3d10_effect_pass
|
|
|
|
{
|
2011-06-03 11:13:06 +02:00
|
|
|
ID3D10EffectPass ID3D10EffectPass_iface;
|
2009-03-02 08:52:49 +01:00
|
|
|
|
2009-03-06 08:43:48 +01:00
|
|
|
struct d3d10_effect_technique *technique;
|
2009-02-27 09:29:48 +01:00
|
|
|
char *name;
|
2021-10-08 07:13:32 +02:00
|
|
|
struct d3d10_effect_annotations annotations;
|
2012-07-18 15:52:31 +02:00
|
|
|
|
2021-11-01 11:51:52 +01:00
|
|
|
struct d3d10_effect_prop_dependencies dependencies;
|
2021-10-06 09:53:32 +02:00
|
|
|
struct d3d10_effect_pass_shader_desc vs;
|
|
|
|
struct d3d10_effect_pass_shader_desc ps;
|
|
|
|
struct d3d10_effect_pass_shader_desc gs;
|
2021-10-06 09:53:35 +02:00
|
|
|
struct d3d10_effect_variable *rasterizer;
|
2021-10-06 09:53:36 +02:00
|
|
|
struct d3d10_effect_variable *depth_stencil;
|
2021-10-06 09:53:37 +02:00
|
|
|
struct d3d10_effect_variable *blend;
|
2012-07-18 15:52:33 +02:00
|
|
|
UINT stencil_ref;
|
2012-07-18 15:52:32 +02:00
|
|
|
UINT sample_mask;
|
2012-07-18 15:52:31 +02:00
|
|
|
float blend_factor[4];
|
2009-02-27 09:29:48 +01:00
|
|
|
};
|
|
|
|
|
2009-03-02 08:52:49 +01:00
|
|
|
/* ID3D10EffectTechnique */
|
2009-02-27 09:29:48 +01:00
|
|
|
struct d3d10_effect_technique
|
|
|
|
{
|
2011-06-03 11:14:35 +02:00
|
|
|
ID3D10EffectTechnique ID3D10EffectTechnique_iface;
|
2009-03-02 08:52:49 +01:00
|
|
|
|
2009-03-06 08:43:48 +01:00
|
|
|
struct d3d10_effect *effect;
|
2009-02-27 09:29:48 +01:00
|
|
|
char *name;
|
2021-10-08 07:13:32 +02:00
|
|
|
struct d3d10_effect_annotations annotations;
|
2009-02-27 09:29:48 +01:00
|
|
|
DWORD pass_count;
|
|
|
|
struct d3d10_effect_pass *passes;
|
|
|
|
};
|
|
|
|
|
2010-01-10 19:30:42 +01:00
|
|
|
struct d3d10_effect_anonymous_shader
|
|
|
|
{
|
|
|
|
struct d3d10_effect_variable shader;
|
|
|
|
struct d3d10_effect_type type;
|
|
|
|
};
|
|
|
|
|
2021-09-24 07:10:13 +02:00
|
|
|
enum d3d10_effect_flags
|
|
|
|
{
|
|
|
|
D3D10_EFFECT_OPTIMIZED = 0x1,
|
2021-10-01 08:13:56 +02:00
|
|
|
D3D10_EFFECT_IS_POOL = 0x2,
|
2021-09-24 07:10:13 +02:00
|
|
|
};
|
|
|
|
|
2009-02-26 09:00:01 +01:00
|
|
|
/* ID3D10Effect */
|
|
|
|
struct d3d10_effect
|
|
|
|
{
|
2011-06-03 11:15:47 +02:00
|
|
|
ID3D10Effect ID3D10Effect_iface;
|
2021-09-16 08:48:09 +02:00
|
|
|
ID3D10EffectPool ID3D10EffectPool_iface;
|
2009-02-26 09:00:01 +01:00
|
|
|
LONG refcount;
|
2009-02-27 09:29:48 +01:00
|
|
|
|
2009-03-06 08:43:48 +01:00
|
|
|
ID3D10Device *device;
|
2021-10-04 13:48:47 +02:00
|
|
|
struct d3d10_effect *pool;
|
2009-05-29 23:35:07 +02:00
|
|
|
DWORD version;
|
2009-07-14 11:17:38 +02:00
|
|
|
DWORD local_buffer_count;
|
2009-08-26 22:30:32 +02:00
|
|
|
DWORD variable_count;
|
2009-10-25 17:11:49 +01:00
|
|
|
DWORD local_variable_count;
|
2021-09-24 07:10:12 +02:00
|
|
|
DWORD shared_buffer_count;
|
2021-09-24 07:10:11 +02:00
|
|
|
DWORD shared_object_count;
|
2009-02-27 09:29:48 +01:00
|
|
|
DWORD technique_count;
|
|
|
|
DWORD index_offset;
|
2009-08-26 22:30:32 +02:00
|
|
|
DWORD texture_count;
|
2016-06-02 12:12:04 +02:00
|
|
|
DWORD depthstencilstate_count;
|
2009-02-27 09:29:48 +01:00
|
|
|
DWORD blendstate_count;
|
2009-05-29 23:35:07 +02:00
|
|
|
DWORD rasterizerstate_count;
|
|
|
|
DWORD samplerstate_count;
|
2009-08-26 22:30:32 +02:00
|
|
|
DWORD rendertargetview_count;
|
|
|
|
DWORD depthstencilview_count;
|
2010-04-07 18:34:24 +02:00
|
|
|
DWORD used_shader_count;
|
2010-01-10 19:30:42 +01:00
|
|
|
DWORD anonymous_shader_count;
|
2021-09-24 07:10:13 +02:00
|
|
|
DWORD flags;
|
2010-01-10 19:30:42 +01:00
|
|
|
|
2010-04-07 18:34:24 +02:00
|
|
|
DWORD used_shader_current;
|
2010-01-10 19:30:42 +01:00
|
|
|
DWORD anonymous_shader_current;
|
2009-07-14 11:17:38 +02:00
|
|
|
|
2009-09-08 16:38:00 +02:00
|
|
|
struct wine_rb_tree types;
|
2009-09-30 11:40:38 +02:00
|
|
|
struct d3d10_effect_variable *local_buffers;
|
2009-10-25 17:11:49 +01:00
|
|
|
struct d3d10_effect_variable *local_variables;
|
2010-01-10 19:30:42 +01:00
|
|
|
struct d3d10_effect_anonymous_shader *anonymous_shaders;
|
2010-04-07 18:34:24 +02:00
|
|
|
struct d3d10_effect_variable **used_shaders;
|
2009-02-27 09:29:48 +01:00
|
|
|
struct d3d10_effect_technique *techniques;
|
2009-02-26 09:00:01 +01:00
|
|
|
};
|
|
|
|
|
2009-09-17 23:03:34 +02:00
|
|
|
HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size) DECLSPEC_HIDDEN;
|
2009-02-27 09:29:48 +01:00
|
|
|
|
2008-11-14 13:57:06 +01:00
|
|
|
/* D3D10Core */
|
|
|
|
HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
|
2016-03-16 00:24:10 +01:00
|
|
|
unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device);
|
2008-11-14 13:57:06 +01:00
|
|
|
|
2008-10-20 15:28:08 +02:00
|
|
|
#endif /* __WINE_D3D10_PRIVATE_H */
|