d3d10_private.h 4.68 KB
Newer Older
1
/*
2
 * Copyright 2008-2009 Henri Verbeet for CodeWeavers
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * 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"
23
#include "wine/rbtree.h"
24

25
#define COBJMACROS
26 27 28 29 30 31 32
#include "winbase.h"
#include "winuser.h"
#include "objbase.h"

#include "d3d10.h"

/* TRACE helper functions */
33 34 35
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;
36

37 38 39
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;
40

41
enum d3d10_effect_object_type
42
{
43 44 45
    D3D10_EOT_VERTEXSHADER = 6,
    D3D10_EOT_PIXELSHADER = 7,
    D3D10_EOT_GEOMETRYSHADER = 8,
46 47
};

48
struct d3d10_effect_object
49
{
Henri Verbeet's avatar
Henri Verbeet committed
50
    struct d3d10_effect_pass *pass;
51
    enum d3d10_effect_object_type type;
52
    DWORD idx_offset;
53 54 55 56 57 58 59
    void *data;
};

struct d3d10_effect_shader_variable
{
    char *input_signature;
    UINT input_signature_size;
Henri Verbeet's avatar
Henri Verbeet committed
60 61 62 63 64 65
    union
    {
        ID3D10VertexShader *vs;
        ID3D10PixelShader *ps;
        ID3D10GeometryShader *gs;
    } shader;
66 67
};

68 69 70 71 72 73 74
/* ID3D10EffectType */
struct d3d10_effect_type
{
    const struct ID3D10EffectTypeVtbl *vtbl;

    DWORD id;
    struct wine_rb_entry entry;
75
    struct d3d10_effect *effect;
76 77 78 79 80 81 82 83 84 85 86

    char *name;
    DWORD element_count;
    DWORD size_unpacked;
    DWORD stride;
    DWORD size_packed;
    DWORD member_count;
    DWORD column_count;
    DWORD row_count;
    D3D10_SHADER_VARIABLE_TYPE basetype;
    D3D10_SHADER_VARIABLE_CLASS type_class;
87 88 89 90 91 92 93 94 95
    struct d3d10_effect_type_member *members;
};

struct d3d10_effect_type_member
{
    char *name;
    char *semantic;
    DWORD buffer_offset;
    struct d3d10_effect_type *type;
96 97
};

98
/* ID3D10EffectVariable */
99 100
struct d3d10_effect_variable
{
101 102
    const struct ID3D10EffectVariableVtbl *vtbl;

103
    struct d3d10_effect_variable *buffer;
104 105
    struct d3d10_effect *effect;

106
    char *name;
107
    char *semantic;
108
    DWORD buffer_offset;
109
    DWORD annotation_count;
110
    DWORD flag;
111
    DWORD data_size;
112
    struct d3d10_effect_type *type;
113
    struct d3d10_effect_variable *members;
114
    struct d3d10_effect_variable *annotations;
115 116
};

117
/* ID3D10EffectPass */
118 119
struct d3d10_effect_pass
{
120 121
    const struct ID3D10EffectPassVtbl *vtbl;

Henri Verbeet's avatar
Henri Verbeet committed
122
    struct d3d10_effect_technique *technique;
123 124
    char *name;
    DWORD start;
125
    DWORD object_count;
126
    DWORD annotation_count;
127
    struct d3d10_effect_object *objects;
128
    struct d3d10_effect_variable *annotations;
129 130
};

131
/* ID3D10EffectTechnique */
132 133
struct d3d10_effect_technique
{
134 135
    const struct ID3D10EffectTechniqueVtbl *vtbl;

Henri Verbeet's avatar
Henri Verbeet committed
136
    struct d3d10_effect *effect;
137 138
    char *name;
    DWORD pass_count;
139
    DWORD annotation_count;
140
    struct d3d10_effect_pass *passes;
141
    struct d3d10_effect_variable *annotations;
142 143
};

144
/* ID3D10Effect */
145
extern const struct ID3D10EffectVtbl d3d10_effect_vtbl DECLSPEC_HIDDEN;
146 147 148 149
struct d3d10_effect
{
    const struct ID3D10EffectVtbl *vtbl;
    LONG refcount;
150

151
    ID3D10Device *device;
152
    DWORD version;
153
    DWORD local_buffer_count;
154 155
    DWORD variable_count;
    DWORD object_count;
156 157
    DWORD sharedbuffers_count;
    DWORD sharedobjects_count;
158 159
    DWORD technique_count;
    DWORD index_offset;
160
    DWORD texture_count;
161
    DWORD dephstencilstate_count;
162
    DWORD blendstate_count;
163 164
    DWORD rasterizerstate_count;
    DWORD samplerstate_count;
165 166 167 168
    DWORD rendertargetview_count;
    DWORD depthstencilview_count;
    DWORD shader_call_count;
    DWORD shader_compile_count;
169

170
    struct wine_rb_tree types;
171
    struct d3d10_effect_variable *local_buffers;
172
    struct d3d10_effect_technique *techniques;
173 174
};

175
HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size) DECLSPEC_HIDDEN;
176

177 178 179 180
/* D3D10Core */
HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
        UINT flags, DWORD unknown0, ID3D10Device **device);

181
#endif /* __WINE_D3D10_PRIVATE_H */