2008-10-20 13:28:08 +00:00
|
|
|
/*
|
2009-02-27 08:29:48 +00:00
|
|
|
* Copyright 2008-2009 Henri Verbeet for CodeWeavers
|
2008-10-20 13:28:08 +00: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
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
2009-09-08 14:38:00 +00:00
|
|
|
#include "wine/rbtree.h"
|
2008-10-20 13:28:08 +00:00
|
|
|
|
2008-10-20 13:28:09 +00:00
|
|
|
#define COBJMACROS
|
2008-10-20 13:28:08 +00:00
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "objbase.h"
|
|
|
|
|
|
|
|
#include "d3d10.h"
|
2010-08-26 15:17:38 +00:00
|
|
|
#include "d3dcompiler.h"
|
2008-10-20 13:28:08 +00:00
|
|
|
|
2010-04-07 16:34:24 +00: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
|
|
|
|
|
2008-10-20 13:28:08 +00:00
|
|
|
/* TRACE helper functions */
|
2009-09-17 21:03:34 +00:00
|
|
|
const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type) DECLSPEC_HIDDEN;
|
|
|
|
const char *debug_d3d10_shader_variable_class(D3D10_SHADER_VARIABLE_CLASS c) DECLSPEC_HIDDEN;
|
|
|
|
const char *debug_d3d10_shader_variable_type(D3D10_SHADER_VARIABLE_TYPE t) DECLSPEC_HIDDEN;
|
2008-10-20 13:28:09 +00:00
|
|
|
|
2009-09-17 21:03:34 +00:00
|
|
|
void *d3d10_rb_alloc(size_t size) DECLSPEC_HIDDEN;
|
|
|
|
void *d3d10_rb_realloc(void *ptr, size_t size) DECLSPEC_HIDDEN;
|
|
|
|
void d3d10_rb_free(void *ptr) DECLSPEC_HIDDEN;
|
2009-09-08 14:38:00 +00:00
|
|
|
|
2009-07-15 10:21:18 +00:00
|
|
|
enum d3d10_effect_object_type
|
2009-02-27 08:29:48 +00:00
|
|
|
{
|
2009-07-15 10:21:18 +00:00
|
|
|
D3D10_EOT_VERTEXSHADER = 6,
|
|
|
|
D3D10_EOT_PIXELSHADER = 7,
|
|
|
|
D3D10_EOT_GEOMETRYSHADER = 8,
|
2009-02-27 08:29:48 +00:00
|
|
|
};
|
|
|
|
|
2010-01-10 18:30:42 +00:00
|
|
|
enum d3d10_effect_object_operation
|
|
|
|
{
|
|
|
|
D3D10_EOO_VALUE = 1,
|
2010-01-24 13:26:46 +00:00
|
|
|
D3D10_EOO_PARSED_OBJECT = 2,
|
2010-01-24 13:26:54 +00:00
|
|
|
D3D10_EOO_PARSED_OBJECT_INDEX = 3,
|
2010-01-10 18:30:42 +00:00
|
|
|
D3D10_EOO_ANONYMOUS_SHADER = 7,
|
|
|
|
};
|
|
|
|
|
2009-07-15 10:21:18 +00:00
|
|
|
struct d3d10_effect_object
|
2009-02-27 08:29:48 +00:00
|
|
|
{
|
2009-03-06 07:43:48 +00:00
|
|
|
struct d3d10_effect_pass *pass;
|
2009-07-15 10:21:18 +00:00
|
|
|
enum d3d10_effect_object_type type;
|
2009-02-27 08:29:48 +00:00
|
|
|
DWORD idx_offset;
|
2010-01-24 13:25:52 +00:00
|
|
|
DWORD index;
|
2009-03-03 08:03:46 +00:00
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2010-04-07 16:34:16 +00:00
|
|
|
struct d3d10_effect_shader_signature
|
|
|
|
{
|
|
|
|
char *signature;
|
|
|
|
UINT signature_size;
|
2010-04-07 16:34:24 +00:00
|
|
|
UINT element_count;
|
|
|
|
D3D10_SIGNATURE_PARAMETER_DESC *elements;
|
2010-04-07 16:34:16 +00:00
|
|
|
};
|
|
|
|
|
2009-03-03 08:03:46 +00:00
|
|
|
struct d3d10_effect_shader_variable
|
|
|
|
{
|
2010-04-07 16:34:16 +00:00
|
|
|
struct d3d10_effect_shader_signature input_signature;
|
2010-04-07 16:34:36 +00:00
|
|
|
struct d3d10_effect_shader_signature output_signature;
|
2009-03-06 07:43:48 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
ID3D10VertexShader *vs;
|
|
|
|
ID3D10PixelShader *ps;
|
|
|
|
ID3D10GeometryShader *gs;
|
|
|
|
} shader;
|
2009-02-27 08:29:48 +00:00
|
|
|
};
|
|
|
|
|
2009-09-08 14:38:00 +00:00
|
|
|
/* ID3D10EffectType */
|
|
|
|
struct d3d10_effect_type
|
|
|
|
{
|
2011-06-02 09:19:38 +00:00
|
|
|
ID3D10EffectType ID3D10EffectType_iface;
|
2009-09-08 14:38:00 +00:00
|
|
|
|
2010-01-24 13:25:19 +00:00
|
|
|
char *name;
|
|
|
|
D3D10_SHADER_VARIABLE_TYPE basetype;
|
|
|
|
D3D10_SHADER_VARIABLE_CLASS type_class;
|
|
|
|
|
2009-09-08 14:38:00 +00:00
|
|
|
DWORD id;
|
|
|
|
struct wine_rb_entry entry;
|
2009-09-30 09:42:14 +00:00
|
|
|
struct d3d10_effect *effect;
|
2009-09-08 14:38:01 +00:00
|
|
|
|
|
|
|
DWORD element_count;
|
|
|
|
DWORD size_unpacked;
|
|
|
|
DWORD stride;
|
|
|
|
DWORD size_packed;
|
|
|
|
DWORD member_count;
|
|
|
|
DWORD column_count;
|
|
|
|
DWORD row_count;
|
2009-10-21 20:59:46 +00:00
|
|
|
struct d3d10_effect_type *elementtype;
|
2009-09-30 09:42:14 +00: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 14:38:00 +00:00
|
|
|
};
|
|
|
|
|
2009-07-15 10:21:21 +00:00
|
|
|
/* ID3D10EffectVariable */
|
2009-07-15 10:21:20 +00:00
|
|
|
struct d3d10_effect_variable
|
|
|
|
{
|
2009-07-15 10:21:21 +00:00
|
|
|
const struct ID3D10EffectVariableVtbl *vtbl;
|
|
|
|
|
2009-09-30 09:40:38 +00:00
|
|
|
struct d3d10_effect_variable *buffer;
|
2010-01-10 18:30:36 +00:00
|
|
|
struct d3d10_effect_type *type;
|
2009-09-09 17:17:01 +00:00
|
|
|
|
2010-01-10 18:30:42 +00:00
|
|
|
void *data;
|
2009-07-15 10:21:20 +00:00
|
|
|
char *name;
|
2009-09-10 19:00:22 +00:00
|
|
|
char *semantic;
|
2009-07-15 10:21:20 +00:00
|
|
|
DWORD buffer_offset;
|
2009-08-20 17:02:11 +00:00
|
|
|
DWORD annotation_count;
|
2009-08-26 20:30:40 +00:00
|
|
|
DWORD flag;
|
2009-07-14 09:17:38 +00:00
|
|
|
DWORD data_size;
|
2010-01-24 13:25:19 +00:00
|
|
|
struct d3d10_effect *effect;
|
2009-10-21 20:59:46 +00:00
|
|
|
struct d3d10_effect_variable *elements;
|
2009-09-30 09:39:13 +00:00
|
|
|
struct d3d10_effect_variable *members;
|
2009-09-09 17:17:01 +00:00
|
|
|
struct d3d10_effect_variable *annotations;
|
2009-07-14 09:17:38 +00:00
|
|
|
};
|
|
|
|
|
2009-03-02 07:52:49 +00:00
|
|
|
/* ID3D10EffectPass */
|
2009-02-27 08:29:48 +00:00
|
|
|
struct d3d10_effect_pass
|
|
|
|
{
|
2011-06-03 09:13:06 +00:00
|
|
|
ID3D10EffectPass ID3D10EffectPass_iface;
|
2009-03-02 07:52:49 +00:00
|
|
|
|
2009-03-06 07:43:48 +00:00
|
|
|
struct d3d10_effect_technique *technique;
|
2009-02-27 08:29:48 +00:00
|
|
|
char *name;
|
|
|
|
DWORD start;
|
2009-07-15 10:21:18 +00:00
|
|
|
DWORD object_count;
|
2009-08-20 17:02:11 +00:00
|
|
|
DWORD annotation_count;
|
2009-07-15 10:21:18 +00:00
|
|
|
struct d3d10_effect_object *objects;
|
2009-09-09 17:17:01 +00:00
|
|
|
struct d3d10_effect_variable *annotations;
|
2009-02-27 08:29:48 +00:00
|
|
|
};
|
|
|
|
|
2009-03-02 07:52:49 +00:00
|
|
|
/* ID3D10EffectTechnique */
|
2009-02-27 08:29:48 +00:00
|
|
|
struct d3d10_effect_technique
|
|
|
|
{
|
2009-03-02 07:52:49 +00:00
|
|
|
const struct ID3D10EffectTechniqueVtbl *vtbl;
|
|
|
|
|
2009-03-06 07:43:48 +00:00
|
|
|
struct d3d10_effect *effect;
|
2009-02-27 08:29:48 +00:00
|
|
|
char *name;
|
|
|
|
DWORD pass_count;
|
2009-08-20 17:02:11 +00:00
|
|
|
DWORD annotation_count;
|
2009-02-27 08:29:48 +00:00
|
|
|
struct d3d10_effect_pass *passes;
|
2009-09-09 17:17:01 +00:00
|
|
|
struct d3d10_effect_variable *annotations;
|
2009-02-27 08:29:48 +00:00
|
|
|
};
|
|
|
|
|
2010-01-10 18:30:42 +00:00
|
|
|
struct d3d10_effect_anonymous_shader
|
|
|
|
{
|
|
|
|
struct d3d10_effect_variable shader;
|
|
|
|
struct d3d10_effect_type type;
|
|
|
|
};
|
|
|
|
|
2009-02-26 08:00:01 +00:00
|
|
|
/* ID3D10Effect */
|
2009-09-17 21:03:34 +00:00
|
|
|
extern const struct ID3D10EffectVtbl d3d10_effect_vtbl DECLSPEC_HIDDEN;
|
2009-02-26 08:00:01 +00:00
|
|
|
struct d3d10_effect
|
|
|
|
{
|
|
|
|
const struct ID3D10EffectVtbl *vtbl;
|
|
|
|
LONG refcount;
|
2009-02-27 08:29:48 +00:00
|
|
|
|
2009-03-06 07:43:48 +00:00
|
|
|
ID3D10Device *device;
|
2009-05-29 21:35:07 +00:00
|
|
|
DWORD version;
|
2009-07-14 09:17:38 +00:00
|
|
|
DWORD local_buffer_count;
|
2009-08-26 20:30:32 +00:00
|
|
|
DWORD variable_count;
|
2009-10-25 16:11:49 +00:00
|
|
|
DWORD local_variable_count;
|
2009-05-30 12:13:19 +00:00
|
|
|
DWORD sharedbuffers_count;
|
|
|
|
DWORD sharedobjects_count;
|
2009-02-27 08:29:48 +00:00
|
|
|
DWORD technique_count;
|
|
|
|
DWORD index_offset;
|
2009-08-26 20:30:32 +00:00
|
|
|
DWORD texture_count;
|
2009-05-29 21:35:07 +00:00
|
|
|
DWORD dephstencilstate_count;
|
2009-02-27 08:29:48 +00:00
|
|
|
DWORD blendstate_count;
|
2009-05-29 21:35:07 +00:00
|
|
|
DWORD rasterizerstate_count;
|
|
|
|
DWORD samplerstate_count;
|
2009-08-26 20:30:32 +00:00
|
|
|
DWORD rendertargetview_count;
|
|
|
|
DWORD depthstencilview_count;
|
2010-04-07 16:34:24 +00:00
|
|
|
DWORD used_shader_count;
|
2010-01-10 18:30:42 +00:00
|
|
|
DWORD anonymous_shader_count;
|
|
|
|
|
2010-04-07 16:34:24 +00:00
|
|
|
DWORD used_shader_current;
|
2010-01-10 18:30:42 +00:00
|
|
|
DWORD anonymous_shader_current;
|
2009-07-14 09:17:38 +00:00
|
|
|
|
2009-09-08 14:38:00 +00:00
|
|
|
struct wine_rb_tree types;
|
2009-09-30 09:40:38 +00:00
|
|
|
struct d3d10_effect_variable *local_buffers;
|
2009-10-25 16:11:49 +00:00
|
|
|
struct d3d10_effect_variable *local_variables;
|
2010-01-10 18:30:42 +00:00
|
|
|
struct d3d10_effect_anonymous_shader *anonymous_shaders;
|
2010-04-07 16:34:24 +00:00
|
|
|
struct d3d10_effect_variable **used_shaders;
|
2009-02-27 08:29:48 +00:00
|
|
|
struct d3d10_effect_technique *techniques;
|
2009-02-26 08:00:01 +00:00
|
|
|
};
|
|
|
|
|
2010-07-21 18:44:59 +00:00
|
|
|
/* ID3D10ShaderReflection */
|
|
|
|
extern const struct ID3D10ShaderReflectionVtbl d3d10_shader_reflection_vtbl DECLSPEC_HIDDEN;
|
|
|
|
struct d3d10_shader_reflection
|
|
|
|
{
|
|
|
|
const struct ID3D10ShaderReflectionVtbl *vtbl;
|
|
|
|
LONG refcount;
|
|
|
|
};
|
|
|
|
|
2009-09-17 21:03:34 +00:00
|
|
|
HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size) DECLSPEC_HIDDEN;
|
2009-02-27 08:29:48 +00:00
|
|
|
|
2008-11-14 12:57:06 +00:00
|
|
|
/* D3D10Core */
|
|
|
|
HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
|
2009-12-07 19:20:03 +00:00
|
|
|
UINT flags, void *unknown0, ID3D10Device **device);
|
2008-11-14 12:57:06 +00:00
|
|
|
|
2010-07-19 19:48:36 +00:00
|
|
|
#define MAKE_TAG(ch0, ch1, ch2, ch3) \
|
|
|
|
((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \
|
|
|
|
((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
|
|
|
|
#define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
|
|
|
|
#define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
|
|
|
|
#define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
|
|
|
|
#define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N')
|
|
|
|
#define TAG_SHDR MAKE_TAG('S', 'H', 'D', 'R')
|
|
|
|
|
|
|
|
HRESULT parse_dxbc(const char *data, SIZE_T data_size,
|
|
|
|
HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
static inline void read_dword(const char **ptr, DWORD *d)
|
|
|
|
{
|
|
|
|
memcpy(d, *ptr, sizeof(*d));
|
|
|
|
*ptr += sizeof(*d);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void write_dword(char **ptr, DWORD d)
|
|
|
|
{
|
|
|
|
memcpy(*ptr, &d, sizeof(d));
|
|
|
|
*ptr += sizeof(d);
|
|
|
|
}
|
|
|
|
|
|
|
|
void skip_dword_unknown(const char **ptr, unsigned int count) DECLSPEC_HIDDEN;
|
|
|
|
void write_dword_unknown(char **ptr, DWORD d) DECLSPEC_HIDDEN;
|
|
|
|
|
2008-10-20 13:28:08 +00:00
|
|
|
#endif /* __WINE_D3D10_PRIVATE_H */
|