wined3d_private.h revision 0ac83e2abcde6d1badbbeaf979676be588dd64bb
/*
* Direct3D wine internal private include file
*
* Copyright 2002-2003 The wine-d3d team
* Copyright 2002-2003 Raphael Junqueira
* Copyright 2002-2003, 2004 Jason Edmeades
* Copyright 2005 Oliver Stieber
* Copyright 2006-2011, 2013 Stefan Dösinger for CodeWeavers
*
* 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
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#ifndef __WINE_WINED3D_PRIVATE_H
#define __WINE_WINED3D_PRIVATE_H
#ifdef USE_WIN32_OPENGL
#define WINE_GLAPI __stdcall
#else
#define WINE_GLAPI
#endif
#include <stdarg.h>
#include <math.h>
#include <limits.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#define COBJMACROS
#ifndef VBOX_WINE_WITHOUT_LIBWINE
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#else
#include <windows.h>
#ifndef DUMMYUNIONNAME1
# define DUMMYUNIONNAME1 u1
#endif
#endif
#ifndef VBOX_WINE_WITHOUT_LIBWINE
#include "objbase.h"
#endif
#include "wined3d_gl.h"
#include "wine/wgl_driver.h"
#ifdef VBOX
#include "vboxext.h"
#endif
#ifdef VBOX_WITH_WDDM
# include "vboxsharedrc.h"
#endif
#if defined(VBOX_WINE_WITH_SINGLE_CONTEXT) || defined(VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT)
# define VBoxTlsRefAssertImpl Assert
# include <VBox/VBoxVideo3D.h>
#endif
/* Driver quirks */
#define WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT 0x00000001
#define WINED3D_QUIRK_SET_TEXCOORD_W 0x00000002
#define WINED3D_QUIRK_GLSL_CLIP_VARYING 0x00000004
#define WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA 0x00000008
#define WINED3D_QUIRK_NV_CLIP_BROKEN 0x00000010
#define WINED3D_QUIRK_FBO_TEX_UPDATE 0x00000020
#define WINED3D_QUIRK_BROKEN_RGBA16 0x00000040
#define WINED3D_QUIRK_INFO_LOG_SPAM 0x00000080
#define WINED3D_QUIRK_LIMITED_TEX_FILTERING 0x00000100
#define WINED3D_QUIRK_BROKEN_ARB_FOG 0x00000200
#ifdef VBOX_WITH_WINE_FIX_QUIRKS
#define WINED3D_QUIRK_FULLSIZE_BLIT 0x02000000
#define WINED3D_QUIRK_FORCE_BLIT 0x04000000
#define WINED3D_QUIRK_NO_SHADER_V3 0x08000000
#endif
/* Texture format fixups */
enum fixup_channel_source
{
CHANNEL_SOURCE_ZERO = 0,
CHANNEL_SOURCE_ONE = 1,
CHANNEL_SOURCE_X = 2,
CHANNEL_SOURCE_Y = 3,
CHANNEL_SOURCE_Z = 4,
CHANNEL_SOURCE_W = 5,
};
enum complex_fixup
{
COMPLEX_FIXUP_NONE = 0,
COMPLEX_FIXUP_YUY2 = 1,
COMPLEX_FIXUP_UYVY = 2,
COMPLEX_FIXUP_YV12 = 3,
COMPLEX_FIXUP_P8 = 4,
};
#include <pshpack2.h>
struct color_fixup_desc
{
unsigned x_sign_fixup : 1;
unsigned x_source : 3;
unsigned y_sign_fixup : 1;
unsigned y_source : 3;
unsigned z_sign_fixup : 1;
unsigned z_source : 3;
unsigned w_sign_fixup : 1;
unsigned w_source : 3;
};
#include <poppack.h>
static const struct color_fixup_desc COLOR_FIXUP_IDENTITY =
static inline struct color_fixup_desc create_color_fixup_desc(
{
struct color_fixup_desc fixup =
{
};
return fixup;
}
{
struct color_fixup_desc fixup =
{
};
return fixup;
}
{
}
{
}
{
enum complex_fixup complex_fixup = 0;
return complex_fixup;
}
/* Device caps */
#define MAX_PALETTES 65536
#define MAX_STREAM_OUT 4
#define MAX_STREAMS 16
#define MAX_TEXTURES 8
#define MAX_FRAGMENT_SAMPLERS 16
#define MAX_VERTEX_SAMPLERS 4
#define MAX_ACTIVE_LIGHTS 8
#define MAX_CONSTANT_BUFFERS 15
#define MAX_SAMPLER_OBJECTS 16
struct min_lookup
{
};
static inline GLenum wined3d_gl_mag_filter(const GLenum mag_lookup[], enum wined3d_texture_filter_type mag_filter)
{
return mag_lookup[mag_filter];
}
{
}
/* float_16_to_32() and float_32_to_16() (see implementation in
* surface_base.c) convert 16 bit floats in the FLOAT16 data type
* to standard C floats and vice versa. They do not depend on the encoding
* of the C float, so they are platform independent, but slow. On x86 and
* other IEEE 754 compliant platforms the conversion can be accelerated by
* bit shifting the exponent and mantissa. There are also some SSE-based
* assembly routines out there.
*
* See GL_NV_half_float for a reference of the FLOAT16 / GL_HALF format
*/
static inline float float_16_to_32(const unsigned short *in)
{
const unsigned short s = ((*in) & 0x8000);
const unsigned short m = (*in) & 0x3ff;
if(e == 0) {
} else if(e < 31) {
} else {
else return NAN;
}
}
{
const unsigned int m = in & 0x7ffff;
if (e == 0)
{
}
else if (e < 15)
{
}
else
{
else return NAN;
}
}
#define ORM_BACKBUFFER 0
#define ORM_FBO 1
#define RTL_READDRAW 1
#define RTL_READTEX 2
/* NOTE: When adding fields to this structure, make sure to update the default
* values in wined3d_main.c as well. */
struct wined3d_settings
{
/* Ideally, we don't want the user to have to request GLSL. If the
* hardware supports GLSL, we should use it. However, until it's fully
* implemented, we'll leave it as a registry setting for developers. */
unsigned short pci_vendor_id;
unsigned short pci_device_id;
/* Memory tracking and object counting. */
unsigned int emulated_textureram;
char *logo;
int allow_multisampling;
unsigned int max_sm_vs;
unsigned int max_sm_gs;
unsigned int max_sm_ps;
};
{
WINED3DSTT_UNKNOWN = 0,
WINED3DSTT_1D = 1,
WINED3DSTT_2D = 2,
WINED3DSTT_CUBE = 3,
WINED3DSTT_VOLUME = 4,
};
{
WINED3DSPR_TEMP = 0,
WINED3DSPR_INPUT = 1,
WINED3DSPR_CONST = 2,
WINED3DSPR_ADDR = 3,
WINED3DSPR_TEXTURE = 3,
WINED3DSPR_RASTOUT = 4,
WINED3DSPR_ATTROUT = 5,
WINED3DSPR_TEXCRDOUT = 6,
WINED3DSPR_OUTPUT = 6,
WINED3DSPR_CONSTINT = 7,
WINED3DSPR_COLOROUT = 8,
WINED3DSPR_DEPTHOUT = 9,
WINED3DSPR_SAMPLER = 10,
WINED3DSPR_CONST2 = 11,
WINED3DSPR_CONST3 = 12,
WINED3DSPR_CONST4 = 13,
WINED3DSPR_CONSTBOOL = 14,
WINED3DSPR_LOOP = 15,
WINED3DSPR_TEMPFLOAT16 = 16,
WINED3DSPR_MISCTYPE = 17,
WINED3DSPR_LABEL = 18,
WINED3DSPR_PREDICATE = 19,
};
enum wined3d_data_type
{
};
{
};
{
WINED3DSPSM_NONE = 0,
WINED3DSPSM_NEG = 1,
WINED3DSPSM_BIAS = 2,
WINED3DSPSM_BIASNEG = 3,
WINED3DSPSM_SIGN = 4,
WINED3DSPSM_SIGNNEG = 5,
WINED3DSPSM_COMP = 6,
WINED3DSPSM_X2 = 7,
WINED3DSPSM_X2NEG = 8,
WINED3DSPSM_DZ = 9,
WINED3DSPSM_DW = 10,
WINED3DSPSM_ABS = 11,
WINED3DSPSM_ABSNEG = 12,
WINED3DSPSM_NOT = 13,
};
{
WINED3DSPDM_NONE = 0,
WINED3DSPDM_SATURATE = 1,
};
/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */
#define WINED3DSI_TEXLD_PROJECT 0x1
#define WINED3DSI_TEXLD_BIAS 0x2
#define WINED3DSI_INDEXED_DYNAMIC 0x4
{
};
#define WINED3D_SM1_VS 0xfffe
#define WINED3D_SM1_PS 0xffff
#define WINED3D_SM4_PS 0x0000
#define WINED3D_SM4_VS 0x0001
#define WINED3D_SM4_GS 0x0002
/* Shader version tokens, and shader end tokens */
/* Shader backends */
/* TODO: Make this dynamic, based on shader limits ? */
#define MAX_ATTRIBS 16
#define MAX_REG_ADDR 1
#define MAX_REG_TEMP 32
#define MAX_REG_TEXCRD 8
#define MAX_REG_INPUT 32
#define MAX_REG_OUTPUT 32
#define MAX_CONST_I 16
#define MAX_CONST_B 16
#define WINED3D_MAX_CBS 15
/* FIXME: This needs to go up to 2048 for
* Shader model 3 according to msdn (and for software shaders) */
#define MAX_LABELS 16
#define SHADER_PGMSIZE 16384
struct wined3d_shader_buffer
{
char *buffer;
unsigned int buffer_size;
unsigned int content_size;
unsigned int lineNo;
};
{
};
enum wined3d_shader_type
{
};
struct wined3d_shader_version
{
enum wined3d_shader_type type;
};
struct wined3d_shader_reg_maps
{
struct wined3d_shader_version shader_version;
/* Whether or not loops are used in this shader, and nesting depth */
unsigned loop_depth;
};
/* Keeps track of details for TEX_M#x# instructions which need to maintain
* state information between multiple instructions. */
struct wined3d_shader_tex_mx
{
unsigned int current_row;
};
struct wined3d_shader_loop_state
{
};
struct wined3d_shader_context
{
const struct wined3d_shader *shader;
const struct wined3d_gl_info *gl_info;
const struct wined3d_shader_reg_maps *reg_maps;
struct wined3d_shader_buffer *buffer;
struct wined3d_shader_tex_mx *tex_mx;
struct wined3d_shader_loop_state *loop_state;
void *backend_data;
};
{
const struct wined3d_shader_src_param *rel_addr;
unsigned int offset;
};
struct wined3d_shader_register
{
enum wined3d_data_type data_type;
};
struct wined3d_shader_dst_param
{
struct wined3d_shader_register reg;
};
struct wined3d_shader_src_param
{
struct wined3d_shader_register reg;
};
struct wined3d_shader_semantic
{
enum wined3d_decl_usage usage;
struct wined3d_shader_dst_param reg;
};
struct wined3d_shader_instruction
{
const struct wined3d_shader_context *ctx;
const struct wined3d_shader_src_param *predicate;
const struct wined3d_shader_dst_param *dst;
const struct wined3d_shader_src_param *src;
union
{
struct wined3d_shader_semantic semantic;
struct wined3d_shader_src_param src;
} declaration;
};
struct wined3d_shader_attribute
{
enum wined3d_decl_usage usage;
};
struct wined3d_shader_loop_control
{
unsigned int count;
unsigned int start;
int step;
};
struct wined3d_shader_frontend
{
void (*shader_free)(void *data);
void (*shader_read_header)(void *data, const DWORD **ptr, struct wined3d_shader_version *shader_version);
void (*shader_read_instruction)(void *data, const DWORD **ptr, struct wined3d_shader_instruction *ins);
};
typedef void (*SHADER_HANDLER)(const struct wined3d_shader_instruction *);
#define WINED3D_SHADER_CAP_VS_CLIPPING 0x00000001
#define WINED3D_SHADER_CAP_SRGB_WRITE 0x00000002
struct shader_caps
{
float ps_1x_max_value;
};
enum tex_types
{
tex_1d = 0,
tex_2d = 1,
tex_3d = 2,
tex_cube = 3,
tex_rect = 4,
tex_type_count = 5,
};
enum vertexprocessing_mode {
};
#define WINED3D_CONST_NUM_UNUSED ~0U
{
};
/* Stateblock dependent parameters which have to be hardcoded
* into the shader code
*/
#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT 4
#define WINED3D_PSARGS_TEXTRANSFORM_MASK 0xf
#define WINED3D_PSARGS_TEXTYPE_SHIFT 2
#define WINED3D_PSARGS_TEXTYPE_MASK 0x3
/* Similar to tex_types, except that it doesn't have 1d textures
* (can't be bound), rect textures (handled via np2_fixup) and
* none / unknown (treated as 2d and handled via dummy textures). */
{
};
struct ps_compile_args {
enum vertexprocessing_mode vp_mode;
enum wined3d_ffp_ps_fog_mode fog;
/* Bitmap for NP2 texcoord fixups (16 samplers max currently).
D3D9 has a limit of 16 samplers and the fixup is superfluous
in D3D10 (unconditional NP2 support mandatory). */
};
enum fog_src_type {
VS_FOG_Z = 0,
VS_FOG_COORD = 1
};
struct vs_compile_args {
};
struct wined3d_context;
struct wined3d_state;
struct fragment_pipeline;
struct wined3d_vertex_pipe_ops;
struct wined3d_shader_backend_ops
{
void (*shader_handle_instruction)(const struct wined3d_shader_instruction *);
const struct wined3d_state *state);
void (*shader_update_float_vertex_constants)(struct wined3d_device *device, UINT start, UINT count);
const struct wined3d_state *state);
const struct wined3d_state *state);
HRESULT (*shader_alloc_private)(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe,
const struct fragment_pipeline *fragment_pipe);
};
} while(0)
#define HIGHEST_TRANSFORMSTATE WINED3D_TS_WORLD_MATRIX(255) /* Highest value in wined3d_transform_state. */
/* Checking of API calls */
/* --------------------- */
#ifndef WINE_NO_DEBUG_MSGS
#define checkGLcall(A) \
do { \
/* #ifdef VBOX */ \
if (!wglGetCurrentContext()) \
{ \
ERR(">>>>>>>>>>>>>>>>> NULL ctx issuing %s @ %s / %d\n", \
break; \
} \
/*#endif*/ \
if (err == GL_NO_ERROR) { \
\
} else do { \
ERR(">>>>>>>>>>>>>>>>> %s (%#x) from %s @ %s / %d\n", \
} while (err != GL_NO_ERROR); \
} while(0)
#else
#define checkGLcall(A) do {} while(0)
#endif
enum wined3d_ffp_idx
{
WINED3D_FFP_POSITION = 0,
WINED3D_FFP_NORMAL = 3,
WINED3D_FFP_PSIZE = 4,
WINED3D_FFP_DIFFUSE = 5,
WINED3D_FFP_SPECULAR = 6,
WINED3D_FFP_TEXCOORD3 = 10,
WINED3D_FFP_TEXCOORD4 = 11,
WINED3D_FFP_TEXCOORD5 = 12,
WINED3D_FFP_TEXCOORD6 = 13,
WINED3D_FFP_TEXCOORD7 = 14,
};
enum wined3d_ffp_emit_idx
{
WINED3D_FFP_EMIT_SHORT4N = 10,
WINED3D_FFP_EMIT_UDEC3 = 13,
WINED3D_FFP_EMIT_DEC3N = 14,
WINED3D_FFP_EMIT_INVALID = 17,
};
struct wined3d_bo_address
{
};
struct wined3d_stream_info_element
{
const struct wined3d_format *format;
struct wined3d_bo_address data;
#ifdef VBOX_WITH_WINE_FIX_BUFOFFSET
#endif
};
struct wined3d_stream_info
{
};
#define eps 1e-8
/* Routines and structures related to state management */
#define STATE_RENDER(a) (a)
#define STATE_IS_RENDER(a) ((a) >= STATE_RENDER(1) && (a) <= STATE_RENDER(WINEHIGHEST_RENDER_STATE))
#define STATE_TEXTURESTAGE(stage, num) (STATE_RENDER(WINEHIGHEST_RENDER_STATE) + 1 + (stage) * (WINED3D_HIGHEST_TEXTURE_STATE + 1) + (num))
#define STATE_IS_TEXTURESTAGE(a) ((a) >= STATE_TEXTURESTAGE(0, 1) && (a) <= STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE))
/* + 1 because samplers start with 0 */
#define STATE_SAMPLER(num) (STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (num))
#define STATE_IS_SAMPLER(num) ((num) >= STATE_SAMPLER(0) && (num) <= STATE_SAMPLER(MAX_COMBINED_SAMPLERS - 1))
#define STATE_IS_PIXELSHADER(a) ((a) == STATE_PIXELSHADER)
#define STATE_TRANSFORM(a) (STATE_PIXELSHADER + (a))
#define STATE_IS_TRANSFORM(a) ((a) >= STATE_TRANSFORM(1) && (a) <= STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(255)))
#define STATE_IS_STREAMSRC(a) ((a) == STATE_STREAMSRC)
#define STATE_IS_INDEXBUFFER(a) ((a) == STATE_INDEXBUFFER)
#define STATE_IS_VDECL(a) ((a) == STATE_VDECL)
#define STATE_IS_VSHADER(a) ((a) == STATE_VSHADER)
#define STATE_IS_GEOMETRY_SHADER(a) ((a) == STATE_GEOMETRY_SHADER)
#define STATE_IS_VIEWPORT(a) ((a) == STATE_VIEWPORT)
#define STATE_IS_VERTEXSHADERCONSTANT(a) ((a) == STATE_VERTEXSHADERCONSTANT)
#define STATE_IS_PIXELSHADERCONSTANT(a) ((a) == STATE_PIXELSHADERCONSTANT)
#define STATE_IS_LIGHT_TYPE(a) ((a) == STATE_LIGHT_TYPE)
#define STATE_IS_ACTIVELIGHT(a) ((a) >= STATE_ACTIVELIGHT(0) && (a) < STATE_ACTIVELIGHT(MAX_ACTIVE_LIGHTS))
#define STATE_IS_SCISSORRECT(a) ((a) == STATE_SCISSORRECT)
#define STATE_IS_CLIPPLANE(a) ((a) >= STATE_CLIPPLANE(0) && (a) <= STATE_CLIPPLANE(MAX_CLIPPLANES - 1))
#define STATE_IS_MATERIAL(a) ((a) == STATE_MATERIAL)
#define STATE_IS_FRONTFACE(a) ((a) == STATE_FRONTFACE)
#define STATE_IS_POINTSPRITECOORDORIGIN(a) ((a) == STATE_POINTSPRITECOORDORIGIN)
#define STATE_IS_BASEVERTEXINDEX(a) ((a) == STATE_BASEVERTEXINDEX)
#define STATE_IS_FRAMEBUFFER(a) ((a) == STATE_FRAMEBUFFER)
#define STATE_IS_POINT_SIZE_ENABLE(a) ((a) == STATE_POINT_SIZE_ENABLE)
#define STATE_HIGHEST (STATE_POINT_SIZE_ENABLE)
enum fogsource {
};
#define WINED3D_MAX_FBO_ENTRIES 64
struct wined3d_occlusion_query
{
struct wined3d_context *context;
};
union wined3d_gl_query_object
{
};
struct wined3d_event_query
{
union wined3d_gl_query_object object;
struct wined3d_context *context;
};
{
};
void wined3d_event_query_issue(struct wined3d_event_query *query, const struct wined3d_device *device) DECLSPEC_HIDDEN;
struct wined3d_context
{
const struct wined3d_gl_info *gl_info;
const struct wined3d_d3d_info *d3d_info;
const struct StateEntry *state_table;
/* State dirtification
* dirtyArray is an array that contains markers for dirty states. numDirtyEntries states are dirty, their numbers are in indices
* 0...numDirtyEntries - 1. isStateDirty is a redundant copy of the dirtyArray. Technically only one of them would be needed,
* but with the help of both it is easy to find out if a state is dirty(just check the array index), and for applying dirty states
* only numDirtyEntries array elements have to be checked, not STATE_HIGHEST states.
*/
DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */
DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */
struct wined3d_swapchain *swapchain;
struct wined3d_surface *current_rt;
/* Stores some information about the context state for optimization */
#if !defined(VBOX_WINE_WITH_SINGLE_CONTEXT) && !defined(VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT)
#endif
#if !defined(VBOX_WINE_WITH_SINGLE_CONTEXT) && !defined(VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT)
#else
#endif
enum fogsource fog_source;
/* The actual opengl context */
int restore_pf;
#ifndef VBOX_WINE_WITH_SINGLE_CONTEXT
#else
struct wined3d_device *device;
#endif
#if defined(VBOX_WINE_WITH_SINGLE_CONTEXT) || defined(VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT)
#endif
int pixel_format;
/* FBOs */
struct list fbo_destroy_list;
struct fbo_entry *current_fbo;
struct wined3d_surface **blit_targets;
/* Queries */
struct list occlusion_queries;
struct list event_queries;
/* Extension emulation */
};
struct wined3d_fb_state
{
struct wined3d_surface **render_targets;
struct wined3d_surface *depth_stencil;
};
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
struct StateEntry
{
};
struct StateEntryTemplate
{
struct StateEntry content;
};
#define WINED3D_FRAGMENT_CAP_PROJ_CONTROL 0x00000001
#define WINED3D_FRAGMENT_CAP_SRGB_WRITE 0x00000002
struct fragment_caps
{
};
struct fragment_pipeline
{
const struct StateEntryTemplate *states;
};
struct wined3d_vertex_caps
{
};
struct wined3d_vertex_pipe_ops
{
const struct StateEntryTemplate *vp_states;
};
/* "Base" state table */
enum wined3d_blit_op
{
};
/* Shaders for color conversions in blits. Do not do blit operations while
* already under the GL lock. */
struct blit_shader
{
HRESULT (*set_shader)(void *blit_priv, struct wined3d_context *context, const struct wined3d_surface *surface);
const RECT *src_rect, DWORD src_usage, enum wined3d_pool src_pool, const struct wined3d_format *src_format,
const RECT *dst_rect, DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format);
};
const struct blit_shader *wined3d_select_blitter(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op,
const RECT *src_rect, DWORD src_usage, enum wined3d_pool src_pool, const struct wined3d_format *src_format,
const RECT *dst_rect, DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format)
/* Temporary blit_shader helper functions */
void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN;
BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device,
BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_device *device) DECLSPEC_HIDDEN;
struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN;
unsigned int unit) DECLSPEC_HIDDEN;
void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name) DECLSPEC_HIDDEN;
void context_check_fbo_status(const struct wined3d_context *context, GLenum target) DECLSPEC_HIDDEN;
struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, struct wined3d_surface *target,
const struct wined3d_format *ds_format
#ifdef VBOX_WITH_WDDM
, struct VBOXUHGSMI *pHgsmi
#endif
void context_destroy(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
void context_surface_update(struct wined3d_context *context, const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
#if defined(VBOX_WINE_WITH_SINGLE_CONTEXT) || defined(VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT)
void context_clear_on_thread_detach();
#endif
#if defined(VBOX_WINE_WITH_SINGLE_CONTEXT)
struct wined3d_swapchain *swapchain,
const struct wined3d_format *ds_format);
#endif
/*****************************************************************************
* Internal representation of a light
*/
struct wined3d_light_info
{
/* Converted parms to speed up swapping lights */
float lightPosn[4];
float lightDirn[4];
float exponent;
float cutoff;
};
/* The default light parameters */
struct wined3d_pixel_format
{
int iPixelFormat; /* WGL pixel format */
int iPixelType; /* WGL pixel type e.g. WGL_TYPE_RGBA_ARB, WGL_TYPE_RGBA_FLOAT_ARB or WGL_TYPE_COLORINDEX_ARB */
int depthSize, stencilSize;
int auxBuffers;
int numSamples;
};
enum wined3d_pci_vendor
{
HW_VENDOR_SOFTWARE = 0x0000,
HW_VENDOR_AMD = 0x1002,
HW_VENDOR_NVIDIA = 0x10de,
HW_VENDOR_INTEL = 0x8086,
};
enum wined3d_pci_device
{
CARD_WINE = 0x0000,
CARD_AMD_RAGE_128PRO = 0x5246,
CARD_AMD_RADEON_7200 = 0x5144,
CARD_AMD_RADEON_8500 = 0x514c,
CARD_AMD_RADEON_9500 = 0x4144,
CARD_AMD_RADEON_XPRESS_200M = 0x5955,
CARD_AMD_RADEON_X700 = 0x5e4c,
CARD_AMD_RADEON_X1600 = 0x71c2,
CARD_AMD_RADEON_HD2350 = 0x94c7,
CARD_AMD_RADEON_HD2600 = 0x9581,
CARD_AMD_RADEON_HD2900 = 0x9400,
CARD_AMD_RADEON_HD3200 = 0x9620,
CARD_AMD_RADEON_HD4200M = 0x9712,
CARD_AMD_RADEON_HD4350 = 0x954f,
CARD_AMD_RADEON_HD4600 = 0x9495,
CARD_AMD_RADEON_HD4700 = 0x944e,
CARD_AMD_RADEON_HD4800 = 0x944c,
CARD_AMD_RADEON_HD5400 = 0x68f9,
CARD_AMD_RADEON_HD5600 = 0x68d8,
CARD_AMD_RADEON_HD5700 = 0x68be,
CARD_AMD_RADEON_HD5800 = 0x6898,
CARD_AMD_RADEON_HD5900 = 0x689c,
CARD_AMD_RADEON_HD6300 = 0x9803,
CARD_AMD_RADEON_HD6400 = 0x6770,
CARD_AMD_RADEON_HD6410D = 0x9644,
CARD_AMD_RADEON_HD6550D = 0x9640,
CARD_AMD_RADEON_HD6600 = 0x6758,
CARD_AMD_RADEON_HD6600M = 0x6741,
CARD_AMD_RADEON_HD6700 = 0x68ba,
CARD_AMD_RADEON_HD6800 = 0x6739,
CARD_AMD_RADEON_HD6900 = 0x6719,
CARD_AMD_RADEON_HD7700 = 0x683d,
CARD_AMD_RADEON_HD7800 = 0x6819,
CARD_AMD_RADEON_HD7900 = 0x679a,
CARD_NVIDIA_RIVA_128 = 0x0018,
CARD_NVIDIA_RIVA_TNT = 0x0020,
CARD_NVIDIA_RIVA_TNT2 = 0x0028,
CARD_NVIDIA_GEFORCE = 0x0100,
CARD_NVIDIA_GEFORCE2_MX = 0x0110,
CARD_NVIDIA_GEFORCE2 = 0x0150,
CARD_NVIDIA_GEFORCE3 = 0x0200,
CARD_NVIDIA_GEFORCE4_MX = 0x0170,
CARD_NVIDIA_GEFORCE4_TI4200 = 0x0253,
CARD_NVIDIA_GEFORCEFX_5200 = 0x0320,
CARD_NVIDIA_GEFORCEFX_5600 = 0x0312,
CARD_NVIDIA_GEFORCEFX_5800 = 0x0302,
CARD_NVIDIA_GEFORCE_6200 = 0x014f,
CARD_NVIDIA_GEFORCE_6600GT = 0x0140,
CARD_NVIDIA_GEFORCE_6800 = 0x0041,
CARD_NVIDIA_GEFORCE_7400 = 0x01d8,
CARD_NVIDIA_GEFORCE_7600 = 0x0391,
CARD_NVIDIA_GEFORCE_7800GT = 0x0092,
CARD_NVIDIA_GEFORCE_8300GS = 0x0423,
CARD_NVIDIA_GEFORCE_8400GS = 0x0404,
CARD_NVIDIA_GEFORCE_8500GT = 0x0421,
CARD_NVIDIA_GEFORCE_8600GT = 0x0402,
CARD_NVIDIA_GEFORCE_8600MGT = 0x0407,
CARD_NVIDIA_GEFORCE_8800GTS = 0x0193,
CARD_NVIDIA_GEFORCE_8800GTX = 0x0191,
CARD_NVIDIA_GEFORCE_9200 = 0x086d,
CARD_NVIDIA_GEFORCE_9300 = 0x086c,
CARD_NVIDIA_GEFORCE_9400M = 0x0863,
CARD_NVIDIA_GEFORCE_9400GT = 0x042c,
CARD_NVIDIA_GEFORCE_9500GT = 0x0640,
CARD_NVIDIA_GEFORCE_9600GT = 0x0622,
CARD_NVIDIA_GEFORCE_9800GT = 0x0614,
CARD_NVIDIA_GEFORCE_210 = 0x0a23,
CARD_NVIDIA_GEFORCE_GT220 = 0x0a20,
CARD_NVIDIA_GEFORCE_GT240 = 0x0ca3,
CARD_NVIDIA_GEFORCE_GTX260 = 0x05e2,
CARD_NVIDIA_GEFORCE_GTX275 = 0x05e6,
CARD_NVIDIA_GEFORCE_GTX280 = 0x05e1,
CARD_NVIDIA_GEFORCE_315M = 0x0a7a,
CARD_NVIDIA_GEFORCE_320M = 0x08a3,
CARD_NVIDIA_GEFORCE_GT320M = 0x0a2d,
CARD_NVIDIA_GEFORCE_GT325M = 0x0a35,
CARD_NVIDIA_GEFORCE_GT330 = 0x0ca0,
CARD_NVIDIA_GEFORCE_GTS350M = 0x0cb0,
CARD_NVIDIA_GEFORCE_410M = 0x1055,
CARD_NVIDIA_GEFORCE_GT420 = 0x0de2,
CARD_NVIDIA_GEFORCE_GT430 = 0x0de1,
CARD_NVIDIA_GEFORCE_GT440 = 0x0de0,
CARD_NVIDIA_GEFORCE_GTS450 = 0x0dc4,
CARD_NVIDIA_GEFORCE_GTX460 = 0x0e22,
CARD_NVIDIA_GEFORCE_GTX460M = 0x0dd1,
CARD_NVIDIA_GEFORCE_GTX465 = 0x06c4,
CARD_NVIDIA_GEFORCE_GTX470 = 0x06cd,
CARD_NVIDIA_GEFORCE_GTX480 = 0x06c0,
CARD_NVIDIA_GEFORCE_GT520 = 0x1040,
CARD_NVIDIA_GEFORCE_GT540M = 0x0df4,
CARD_NVIDIA_GEFORCE_GTX550 = 0x1244,
CARD_NVIDIA_GEFORCE_GT555M = 0x04b8,
CARD_NVIDIA_GEFORCE_GTX560TI = 0x1200,
CARD_NVIDIA_GEFORCE_GTX560 = 0x1201,
CARD_NVIDIA_GEFORCE_GTX570 = 0x1081,
CARD_NVIDIA_GEFORCE_GTX580 = 0x1080,
CARD_NVIDIA_GEFORCE_GT610 = 0x104a,
CARD_NVIDIA_GEFORCE_GT630 = 0x0f00,
CARD_NVIDIA_GEFORCE_GT630M = 0x0de9,
CARD_NVIDIA_GEFORCE_GT640M = 0x0fd2,
CARD_NVIDIA_GEFORCE_GT650M = 0x0fd1,
CARD_NVIDIA_GEFORCE_GTX650 = 0x0fc6,
CARD_NVIDIA_GEFORCE_GTX650TI = 0x11c6,
CARD_NVIDIA_GEFORCE_GTX660 = 0x11c0,
CARD_NVIDIA_GEFORCE_GTX660TI = 0x1183,
CARD_NVIDIA_GEFORCE_GTX670 = 0x1189,
CARD_NVIDIA_GEFORCE_GTX670MX = 0x11a1,
CARD_NVIDIA_GEFORCE_GTX680 = 0x1180,
CARD_NVIDIA_GEFORCE_GTX770M = 0x11e0,
CARD_INTEL_830M = 0x3577,
CARD_INTEL_855GM = 0x3582,
CARD_INTEL_845G = 0x2562,
CARD_INTEL_865G = 0x2572,
CARD_INTEL_915G = 0x2582,
CARD_INTEL_E7221G = 0x258a,
CARD_INTEL_915GM = 0x2592,
CARD_INTEL_945G = 0x2772,
CARD_INTEL_945GM = 0x27a2,
CARD_INTEL_945GME = 0x27ae,
CARD_INTEL_Q35 = 0x29b2,
CARD_INTEL_G33 = 0x29c2,
CARD_INTEL_Q33 = 0x29d2,
CARD_INTEL_PNVG = 0xa001,
CARD_INTEL_PNVM = 0xa011,
CARD_INTEL_965Q = 0x2992,
CARD_INTEL_965G = 0x2982,
CARD_INTEL_946GZ = 0x2972,
CARD_INTEL_965GM = 0x2a02,
CARD_INTEL_965GME = 0x2a12,
CARD_INTEL_GM45 = 0x2a42,
CARD_INTEL_IGD = 0x2e02,
CARD_INTEL_Q45 = 0x2e12,
CARD_INTEL_G45 = 0x2e22,
CARD_INTEL_G41 = 0x2e32,
CARD_INTEL_B43 = 0x2e92,
CARD_INTEL_ILKD = 0x0042,
CARD_INTEL_ILKM = 0x0046,
CARD_INTEL_SNBD = 0x0122,
CARD_INTEL_SNBM = 0x0126,
CARD_INTEL_SNBS = 0x010a,
CARD_INTEL_IVBD = 0x0162,
CARD_INTEL_IVBM = 0x0166,
CARD_INTEL_IVBS = 0x015a,
};
struct wined3d_fbo_ops
{
};
struct wined3d_gl_limits
{
float pointsize_max;
float pointsize_min;
float shininess;
};
struct wined3d_gl_info
{
struct wined3d_gl_limits limits;
struct opengl_funcs gl_ops;
struct wined3d_fbo_ops fbo_ops;
struct wined3d_format *formats;
};
struct wined3d_driver_info
{
enum wined3d_pci_vendor vendor;
enum wined3d_pci_device device;
const char *name;
const char *description;
unsigned int vidmem;
};
struct wined3d_d3d_limits
{
};
struct wined3d_d3d_info
{
struct wined3d_d3d_limits limits;
};
/* The adapter structure */
struct wined3d_adapter
{
struct wined3d_gl_info gl_info;
struct wined3d_d3d_info d3d_info;
struct wined3d_driver_info driver_info;
unsigned int cfg_count;
struct wined3d_pixel_format *cfgs;
#ifndef VBOX_WITH_WDDM
unsigned int TextureRam; /* Amount of texture memory both video ram + AGP/TurboCache/HyperMemory/.. */
unsigned int UsedTextureRam;
#endif
const struct wined3d_vertex_pipe_ops *vertex_pipe;
const struct fragment_pipeline *fragment_pipe;
const struct wined3d_shader_backend_ops *shader_backend;
const struct blit_shader *blitter;
};
#ifndef VBOX_WITH_WDDM
#endif
enum projection_types
{
proj_none = 0,
proj_count3 = 1,
proj_count4 = 2
};
enum dst_arg
{
resultreg = 0,
tempreg = 1
};
/*****************************************************************************
* Fixed function pipeline replacements
*/
#define ARG_UNUSED 0xff
struct texture_stage_op
{
unsigned cop : 8;
unsigned carg1 : 8;
unsigned carg2 : 8;
unsigned carg0 : 8;
unsigned aop : 8;
unsigned aarg1 : 8;
unsigned aarg2 : 8;
unsigned aarg0 : 8;
struct color_fixup_desc color_fixup;
unsigned tex_type : 3;
unsigned dst : 1;
unsigned projected : 2;
unsigned padding : 10;
};
struct ffp_frag_settings
{
enum wined3d_ffp_ps_fog_mode fog;
/* Use shorts instead of chars to get dword alignment */
unsigned short sRGB_write;
unsigned short emul_clipplanes;
};
struct ffp_frag_desc
{
struct wine_rb_entry entry;
struct ffp_frag_settings settings;
};
{
};
#define WINED3D_FFP_TCI_SHIFT 16
#define WINED3D_FFP_TCI_MASK 0xff
#define WINED3D_FFP_LIGHT_TYPE_MASK 0x7
struct wined3d_ffp_vs_settings
{
};
struct wined3d_ffp_vs_desc
{
struct wine_rb_entry entry;
struct wined3d_ffp_vs_settings settings;
};
void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct wined3d_stream_info *si,
struct wined3d
{
};
#ifndef VBOX_WITH_WDDM
#endif
/*****************************************************************************
* IWineD3DDevice implementation structure
*/
#define WINED3D_UNMAPPED_STAGE ~0U
/* Multithreaded flag. Removed from the public header to signal that IWineD3D::CreateDevice ignores it */
#define WINED3DCREATE_MULTITHREADED 0x00000004
struct wined3d_device
{
/* WineD3D Information */
struct wined3d_device_parent *device_parent;
struct wined3d_adapter *adapter;
/* Window styles to restore when switching fullscreen mode */
/* X and GL Information */
const struct wined3d_shader_backend_ops *shader_backend;
void *shader_priv;
void *fragment_priv;
void *vertex_priv;
void *blit_priv;
/* Array of functions for states which are handled by more than one pipeline part */
const struct blit_shader *blitter;
#define DDRAW_PITCH_ALIGNMENT 8
#define D3D8_PITCH_ALIGNMENT 4
unsigned char surface_alignment; /* Line Alignment of surfaces */
/* State block related */
struct wined3d_stateblock *stateBlock;
struct wined3d_stateblock *updateStateBlock;
/* Internal use fields */
#ifndef VBOX_WITH_WDDM
#endif
struct wined3d_swapchain **swapchains;
/* Render Target Support */
struct wined3d_fb_state fb;
struct wined3d_surface *onscreen_depth_stencil;
struct wined3d_surface *auto_depth_stencil;
/* For rendering to a texture using glCopyTexImage */
/* Cursor management */
/* The Wine logo surface */
struct wined3d_surface *logo_surface;
/* Textures for when no other textures are mapped */
/* With register combiners we can skip junk texture stages */
/* Stream source management */
struct wined3d_stream_info stream_info;
unsigned int num_buffer_queries;
/* Context management */
struct wined3d_context **contexts;
/* number of vertices in the current draw operation */
/* ogl 2.1 requires 0 vertattr to be present
* GL_ARRAY_BUFFER_ARB buffer */
/* buffer length */
/* current buffer value type */
/* number of values stored in the buffer currently */
/* number of elements in a value */
/* current buffer value */
union
{
GLfloat f[4];
GLshort s[4];
} zvValue;
#endif
#ifdef VBOX_WITH_WDDM
struct VBOXUHGSMI *pHgsmi;
#endif
#ifdef VBOX_WINE_WITH_SHADER_CACHE
#endif
#ifdef VBOX_WINE_WITH_PROFILE
#endif
};
void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb,
BOOL device_context_add(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
void device_context_remove(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
#ifndef VBOX_WITH_WDDM
#else
#endif
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_update_stream_info(struct wined3d_device *device, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
{
}
static inline void invalidate_active_texture(const struct wined3d_device *device, struct wined3d_context *context)
{
if (sampler != WINED3D_UNMAPPED_STAGE)
}
#define WINED3D_RESOURCE_ACCESS_GPU 0x1
#define WINED3D_RESOURCE_ACCESS_CPU 0x2
/* SCRATCH is mostly the same as CPU, but can't be used by the GPU at all,
* not even for resource uploads. */
#define WINED3D_RESOURCE_ACCESS_SCRATCH 0x4
struct wined3d_resource_ops
{
};
struct wined3d_resource
{
struct wined3d_device *device;
enum wined3d_resource_type type;
const struct wined3d_format *format;
enum wined3d_pool pool;
#ifdef VBOX_WITH_WDDM
#endif
struct list privateData;
struct list resource_list_entry;
void *parent;
const struct wined3d_parent_ops *parent_ops;
const struct wined3d_resource_ops *resource_ops;
};
const struct wined3d_resource_ops *resource_ops
#ifdef VBOX_WITH_WDDM
, void *pvClientMem
#endif
/* Tests show that the start address of resources is 32 byte aligned */
#define RESOURCE_ALIGNMENT 16
{
WINED3DTEXSTA_SHADOW = 10,
MAX_WINETEXTURESTATES = 11,
};
enum WINED3DSRGB
{
SRGB_ANY = 0, /* Uses the cached value(e.g. external calls) */
};
struct gl_texture
{
};
struct wined3d_texture_ops
{
const struct wined3d_box *dirty_region);
};
#define WINED3D_TEXTURE_COND_NP2 0x1
#define WINED3D_TEXTURE_POW2_MAT_IDENT 0x2
#define WINED3D_TEXTURE_IS_SRGB 0x4
struct wined3d_texture
{
struct wined3d_resource resource;
const struct wined3d_texture_ops *texture_ops;
struct wined3d_resource **sub_resources;
float pow2_matrix[16];
const struct min_lookup *min_mip_lookup;
const GLenum *mag_lookup;
};
#ifdef VBOX
# ifdef VBOX_WITH_WDDM
#define texture_gl_delete(_t) do { \
} while (0)
# else
#define texture_gl_delete(_t) do { \
} while (0)
# endif
#endif
static inline struct wined3d_texture *wined3d_texture_from_resource(struct wined3d_resource *resource)
{
}
{
}
struct wined3d_volume
{
struct wined3d_resource resource;
struct wined3d_texture *container;
struct wined3d_box lockedBox;
struct wined3d_box dirtyBox;
};
{
}
void volume_add_dirty_box(struct wined3d_volume *volume, const struct wined3d_box *dirty_box) DECLSPEC_HIDDEN;
void volume_load(const struct wined3d_volume *volume, struct wined3d_context *context, UINT level, BOOL srgb_mode) DECLSPEC_HIDDEN;
void volume_set_container(struct wined3d_volume *volume, struct wined3d_texture *container) DECLSPEC_HIDDEN;
struct wined3d_surface_dib
{
void *bitmap_data;
};
struct wined3d_renderbuffer_entry
{
};
struct fbo_entry
{
struct wined3d_surface **render_targets;
struct wined3d_surface *depth_stencil;
};
struct wined3d_surface_ops
{
};
struct wined3d_surface
{
struct wined3d_resource resource;
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
struct wined3d_swapchain *swapchain;
/* A method to retrieve the drawable size. Not in the Vtable to make it changeable */
/* PBO */
int lockCount;
/* For GetDC */
struct wined3d_surface_dib dib;
/* Color keys for DDraw */
struct wined3d_color_key dst_blt_color_key;
struct wined3d_color_key src_blt_color_key;
struct wined3d_color_key gl_color_key;
struct list renderbuffers;
const struct wined3d_renderbuffer_entry *current_renderbuffer;
/* DirectDraw Overlay handling */
struct wined3d_surface *overlay_dest;
struct list overlay_entry;
};
{
}
{
}
void surface_add_dirty_rect(struct wined3d_surface *surface, const struct wined3d_box *dirty_rect) DECLSPEC_HIDDEN;
void surface_internal_preload(struct wined3d_surface *surface, enum WINED3DSRGB srgb) DECLSPEC_HIDDEN;
HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location, const RECT *rect) DECLSPEC_HIDDEN;
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
void surface_modify_location(struct wined3d_surface *surface, DWORD location, BOOL persistent) DECLSPEC_HIDDEN;
void surface_set_container(struct wined3d_surface *surface, struct wined3d_texture *container) DECLSPEC_HIDDEN;
void surface_set_swapchain(struct wined3d_surface *surface, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void surface_set_texture_name(struct wined3d_surface *surface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;
void surface_set_texture_target(struct wined3d_surface *surface, GLenum target, GLint level) DECLSPEC_HIDDEN;
void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN;
void get_drawable_size_swapchain(const struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN;
void get_drawable_size_backbuffer(const struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN;
void get_drawable_size_fbo(const struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN;
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
/* Surface flags: */
#define SFLAG_NORMCOORD 0x00000008 /* Set if GL texture coordinates are normalized (non-texture rectangle). */
#ifdef VBOX_WITH_WDDM
# define SFLAG_DONOTFREE_VBOXWDDM SFLAG_CLIENTMEM
#else
# define SFLAG_DONOTFREE_VBOXWDDM 0
#endif
/* In some conditions the surface memory must not be freed:
* SFLAG_CONVERTED: Converting the data back would take too long
* SFLAG_DIBSECTION: The dib code manages the memory
* SFLAG_DYNLOCK: Avoid freeing the data for performance
* SFLAG_PBO: PBOs don't use 'normal' memory. It is either allocated by the driver or must be NULL.
* SFLAG_CLIENT: OpenGL uses our memory as backup
*/
#define SFLAG_DONOTFREE (SFLAG_CONVERTED | \
SFLAG_DYNLOCK | \
SFLAG_CLIENT | \
SFLAG_DIBSECTION | \
SFLAG_USERPTR | \
SFLAG_PBO | \
SFLAG_PIN_SYSMEM | \
/* #ifdef VBOX */ \
/* #endif */ \
)
#define SFLAG_LOCATIONS (SFLAG_INSYSMEM | \
SFLAG_INTEXTURE | \
SFLAG_INSRGBTEX | \
SFLAG_INDRAWABLE | \
{
};
void d3dfmt_p8_init_palette(const struct wined3d_surface *surface, BYTE table[256][4], BOOL colorkey) DECLSPEC_HIDDEN;
struct wined3d_sampler
{
void *parent;
};
{
const struct wined3d_format *format;
};
struct wined3d_vertex_declaration
{
void *parent;
const struct wined3d_parent_ops *parent_ops;
struct wined3d_device *device;
};
struct wined3d_saved_states
{
};
struct StageState {
};
struct wined3d_stream_output
{
struct wined3d_buffer *buffer;
};
struct wined3d_stream_state
{
struct wined3d_buffer *buffer;
};
struct wined3d_state
{
const struct wined3d_fb_state *fb;
struct wined3d_buffer *index_buffer;
INT load_base_vertex_index; /* Non-indexed drawing needs 0 here, indexed needs base_vertex_index. */
struct wined3d_shader *vertex_shader;
float *vs_consts_f;
struct wined3d_shader *geometry_shader;
struct wined3d_shader *pixel_shader;
float *ps_consts_f;
struct wined3d_material material;
struct wined3d_viewport viewport;
/* Light hashmap . Collisions are handled using standard wine double linked lists */
const struct wined3d_light_info *lights[MAX_ACTIVE_LIGHTS]; /* Map of opengl lights to d3d lights */
};
struct wined3d_stateblock
{
struct wined3d_device *device;
/* Array indicating whether things have been set or changed */
struct wined3d_saved_states changed;
struct wined3d_state state;
/* Contained state management */
unsigned int num_contained_render_states;
unsigned int num_contained_transform_states;
unsigned int num_contained_vs_consts_i;
unsigned int num_contained_vs_consts_b;
unsigned int num_contained_vs_consts_f;
unsigned int num_contained_ps_consts_i;
unsigned int num_contained_ps_consts_b;
unsigned int num_contained_ps_consts_f;
unsigned int num_contained_tss_states;
unsigned int num_contained_sampler_states;
};
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
* allows GetData on a created issue, but opengl doesn't
*/
enum query_state {
};
struct wined3d_query_ops
{
};
struct wined3d_query
{
const struct wined3d_query_ops *query_ops;
struct wined3d_device *device;
enum query_state state;
enum wined3d_query_type type;
void *extendedData;
};
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
* fixed function semantics as D3DCOLOR or FLOAT16 */
{
};
struct wined3d_map_range
{
};
struct wined3d_buffer
{
struct wined3d_resource resource;
struct wined3d_buffer_desc desc;
struct wined3d_map_range *maps;
struct wined3d_event_query *query;
/* conversion stuff */
#ifdef VBOX_WITH_WINE_FIX_BUFOFFSET
#endif
};
{
}
BYTE *buffer_get_sysmem(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
struct wined3d_rendertarget_view
{
struct wined3d_resource *resource;
void *parent;
};
struct wined3d_swapchain_ops
{
};
struct wined3d_swapchain
{
void *parent;
const struct wined3d_parent_ops *parent_ops;
const struct wined3d_swapchain_ops *swapchain_ops;
struct wined3d_device *device;
struct wined3d_surface **back_buffers;
struct wined3d_surface *front_buffer;
struct wined3d_swapchain_desc desc;
#ifndef VBOX_WITH_WDDM
enum wined3d_format_id orig_fmt;
struct wined3d_gamma_ramp orig_gamma;
#endif
const struct wined3d_format *ds_format;
#ifndef VBOX_WINE_WITH_SINGLE_CONTEXT
struct wined3d_context **context;
unsigned int num_contexts;
#else
#endif
#ifndef VBOX_WITH_WDDM
#endif
};
void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *rect) DECLSPEC_HIDDEN;
#define DEFAULT_REFRESH_RATE 0
/*****************************************************************************
* Utility function prototypes
*/
/* Trace routines */
const char *debug_d3dtexturefiltertype(enum wined3d_texture_filter_type filter_type) DECLSPEC_HIDDEN;
/* Math utils */
struct wined3d_shader_lconst
{
unsigned int idx;
};
struct wined3d_shader_limits
{
unsigned int sampler;
unsigned int constant_int;
unsigned int constant_float;
unsigned int constant_bool;
unsigned int packed_output;
unsigned int packed_input;
};
#ifdef __GNUC__
#else
#endif
/* Base Shader utility functions. */
int shader_addline(struct wined3d_shader_buffer *buffer, const char *fmt, ...) PRINTF_ATTR(2,3) DECLSPEC_HIDDEN;
int shader_vaddline(struct wined3d_shader_buffer *buffer, const char *fmt, va_list args) DECLSPEC_HIDDEN;
/* Vertex shader utility functions */
struct wined3d_vertex_shader
{
};
struct wined3d_geometry_shader
{
};
struct wined3d_pixel_shader
{
/* Pixel shader input semantics */
unsigned int declared_in_count;
/* Some information about the shader behavior */
};
struct wined3d_shader
{
struct wined3d_shader_limits limits;
const struct wined3d_shader_frontend *frontend;
void *frontend_data;
void *backend_data;
void *parent;
const struct wined3d_parent_ops *parent_ops;
/* Programs this shader is linked with */
struct list linked_programs;
/* Immediate constants (override global ones) */
struct list constantsB;
struct list constantsF;
struct list constantsI;
struct wined3d_shader_reg_maps reg_maps;
/* Pointer to the parent device */
struct wined3d_device *device;
struct list shader_list_entry;
union
{
struct wined3d_vertex_shader vs;
struct wined3d_geometry_shader gs;
struct wined3d_pixel_shader ps;
} u;
#ifdef VBOX_WINE_WITH_SHADER_CACHE
#endif
};
unsigned int max) DECLSPEC_HIDDEN;
void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_shader_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN;
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN;
{
{
case WINED3DSPR_RASTOUT:
/* oFog & oPts */
return TRUE;
/* oPos */
return FALSE;
case WINED3DSPR_DEPTHOUT: /* oDepth */
case WINED3DSPR_CONSTBOOL: /* b# */
case WINED3DSPR_LOOP: /* aL */
case WINED3DSPR_PREDICATE: /* p0 */
case WINED3DSPR_PRIMID: /* primID */
return TRUE;
case WINED3DSPR_MISCTYPE:
{
case 0: /* vPos */
return FALSE;
case 1: /* vFace */
return TRUE;
default:
return FALSE;
}
case WINED3DSPR_IMMCONST:
default:
return FALSE;
}
}
{
position_fixup[0] = 1.0f;
if (context->render_offscreen)
{
}
}
{
struct wined3d_shader_lconst *lconst;
if (shader->load_local_constsF)
return FALSE;
{
return TRUE;
}
return FALSE;
}
/* Using additional shader constants (uniforms in GLSL / program environment
* or local parameters in ARB) is costly:
* ARB only knows float4 parameters and GLSL compiler are not really smart
* when it comes to efficiently pack float2 uniforms, so no space is wasted
* (in fact most compilers map a float2 to a full float4 uniform).
*
* For NP2 texcoord fixup we only need 2 floats (width and height) for each
* 2D texture used in the shader. We therefore pack fixup info for 2 textures
* into a single shader constant (uniform / program parameter).
*
* This structure is shared between the GLSL and the ARB backend.*/
struct ps_np2fixup_info {
};
#ifdef VBOX_WINE_WITH_SHADER_CACHE
struct wined3d_shader * vertexshader_check_cached(struct wined3d_device *device, struct wined3d_shader *object) DECLSPEC_HIDDEN;
struct wined3d_shader * pixelshader_check_cached(struct wined3d_device *device, struct wined3d_shader *object) DECLSPEC_HIDDEN;
#endif
void zv_bind(struct wined3d_context *context, GLenum enmzvValue, GLuint czvValue, GLuint czvValueElements, GLboolean bzvNormalized, const GLvoid *pzvValue);
void zv_bind_by_element(struct wined3d_context *context, const struct wined3d_stream_info_element *element, GLuint czvValue, const GLvoid *pzvValue);
#endif
struct wined3d_palette
{
void *parent;
struct wined3d_device *device;
/* This is to store the palette in 'screen format' */
int screen_palents[256];
};
/* DirectDraw utility functions */
/*****************************************************************************
* Pixel format management
*/
/* WineD3D pixel format flags */
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001
#define WINED3DFMT_FLAG_FILTERING 0x00000002
#define WINED3DFMT_FLAG_DEPTH 0x00000004
#define WINED3DFMT_FLAG_STENCIL 0x00000008
#define WINED3DFMT_FLAG_RENDERTARGET 0x00000010
#define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x00000040
#define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB 0x00000080
#define WINED3DFMT_FLAG_GETDC 0x00000100
#define WINED3DFMT_FLAG_FLOAT 0x00000200
#define WINED3DFMT_FLAG_BUMPMAP 0x00000400
#define WINED3DFMT_FLAG_SRGB_READ 0x00000800
#define WINED3DFMT_FLAG_SRGB_WRITE 0x00001000
#define WINED3DFMT_FLAG_VTF 0x00002000
#define WINED3DFMT_FLAG_SHADOW 0x00004000
#define WINED3DFMT_FLAG_COMPRESSED 0x00008000
#define WINED3DFMT_FLAG_BROKEN_PITCH 0x00010000
#define WINED3DFMT_FLAG_BLOCKS 0x00020000
#define WINED3DFMT_FLAG_HEIGHT_SCALE 0x00040000
#define WINED3DFMT_FLAG_TEXTURE 0x00080000
struct wined3d_rational
{
};
struct wined3d_format
{
enum wined3d_format_id id;
enum wined3d_ffp_emit_idx emit_idx;
unsigned int component_size;
unsigned int flags;
struct wined3d_rational height_scale;
struct color_fixup_desc color_fixup;
};
{
/* Check stateblock->vertexDecl to allow this to be used from
* IWineD3DDeviceImpl_FindTexUnitMap(). This is safe because
* stateblock->vertexShader implies a vertex declaration instead of ddraw
* style strided data. */
}
{
return !!state->pixel_shader;
}
{
}
/* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
#define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL"
#ifdef VBOX_WINE_WITHOUT_LIBWINE
#include <float.h>
#endif
#endif