Commit 43e6686a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Rename _WineD3D_GL_Info to struct wined3d_gl_info.

parent 0c110597
......@@ -192,8 +192,9 @@ static const char *debug_mask(GLuint mask) {
}
#define GLINFO_LOCATION (*gl_info)
static void wrap_op1(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod,
GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) {
static void wrap_op1(const struct wined3d_gl_info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod,
GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
{
if(dstMask == GL_ALPHA) {
TRACE("glAlphaFragmentOp1ATI(%s, %s, %s, %s, %s, %s)\n", debug_op(op), debug_register(dst), debug_dstmod(dstMod),
debug_register(arg1), debug_rep(arg1Rep), debug_argmod(arg1Mod));
......@@ -206,9 +207,9 @@ static void wrap_op1(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLui
}
}
static void wrap_op2(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod,
GLuint arg1, GLuint arg1Rep, GLuint arg1Mod,
GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) {
static void wrap_op2(const struct wined3d_gl_info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod,
GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
{
if(dstMask == GL_ALPHA) {
TRACE("glAlphaFragmentOp2ATI(%s, %s, %s, %s, %s, %s, %s, %s, %s)\n", debug_op(op), debug_register(dst), debug_dstmod(dstMod),
debug_register(arg1), debug_rep(arg1Rep), debug_argmod(arg1Mod),
......@@ -223,10 +224,10 @@ static void wrap_op2(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLui
}
}
static void wrap_op3(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod,
GLuint arg1, GLuint arg1Rep, GLuint arg1Mod,
GLuint arg2, GLuint arg2Rep, GLuint arg2Mod,
GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) {
static void wrap_op3(const struct wined3d_gl_info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod,
GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod,
GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
{
if(dstMask == GL_ALPHA) {
/* Leave some free space to fit "GL_NONE, " in to align most alpha and color op lines */
TRACE("glAlphaFragmentOp3ATI(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)\n", debug_op(op), debug_register(dst), debug_dstmod(dstMod),
......@@ -250,7 +251,7 @@ static void wrap_op3(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLui
}
}
static GLuint register_for_arg(DWORD arg, const WineD3D_GL_Info *gl_info,
static GLuint register_for_arg(DWORD arg, const struct wined3d_gl_info *gl_info,
unsigned int stage, GLuint *mod, GLuint *rep, GLuint tmparg)
{
GLenum ret;
......@@ -378,7 +379,7 @@ static GLuint find_tmpreg(const struct texture_stage_op op[MAX_TEXTURES])
}
}
static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], const WineD3D_GL_Info *gl_info)
static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], const struct wined3d_gl_info *gl_info)
{
GLuint ret = GL_EXTCALL(glGenFragmentShadersATI(1));
unsigned int stage;
......@@ -1051,7 +1052,7 @@ static void atifs_enable(IWineD3DDevice *iface, BOOL enable) {
LEAVE_GL();
}
static void atifs_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *caps)
static void atifs_get_caps(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
{
caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE |
WINED3DTEXOPCAPS_SELECTARG1 |
......
......@@ -1379,7 +1379,8 @@ static void shader_none_free(IWineD3DDevice *iface) {}
static BOOL shader_none_dirty_const(IWineD3DDevice *iface) {return FALSE;}
#define GLINFO_LOCATION (*gl_info)
static void shader_none_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *pCaps)
static void shader_none_get_caps(WINED3DDEVTYPE devtype,
const struct wined3d_gl_info *gl_info, struct shader_caps *pCaps)
{
/* Set the shader caps to 0 for the none shader backend */
pCaps->VertexShaderVersion = 0;
......
......@@ -140,7 +140,7 @@ static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This, D3DCB_DESTROYSURF
HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels,
IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent)
{
const WineD3D_GL_Info *gl_info = &device->adapter->gl_info;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
UINT pow2_edge_length;
unsigned int i, j;
......
......@@ -343,7 +343,8 @@ static void wine_glFogCoorddvEXT(const GLdouble *f) {
/* End GL_EXT_fog_coord emulation */
#define GLINFO_LOCATION (*gl_info)
void add_gl_compat_wrappers(WineD3D_GL_Info *gl_info) {
void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info)
{
if(!GL_SUPPORT(ARB_MULTITEXTURE)) {
TRACE("Applying GL_ARB_multitexture emulation hooks\n");
gl_info->glActiveTextureARB = wine_glActiveTextureARB;
......
......@@ -610,7 +610,8 @@ static void nvts_enable(IWineD3DDevice *iface, BOOL enable) {
LEAVE_GL();
}
static void nvrc_fragment_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *pCaps)
static void nvrc_fragment_get_caps(WINED3DDEVTYPE devtype,
const struct wined3d_gl_info *gl_info, struct fragment_caps *pCaps)
{
pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD |
WINED3DTEXOPCAPS_ADDSIGNED |
......
......@@ -5392,7 +5392,8 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = {
/* Context activation is done by the caller. */
static void ffp_enable(IWineD3DDevice *iface, BOOL enable) { }
static void ffp_fragment_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *pCaps)
static void ffp_fragment_get_caps(WINED3DDEVTYPE devtype,
const struct wined3d_gl_info *gl_info, struct fragment_caps *pCaps)
{
pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD |
WINED3DTEXOPCAPS_ADDSIGNED |
......@@ -5479,7 +5480,7 @@ static void multistate_apply_3(DWORD state, IWineD3DStateBlockImpl *stateblock,
}
HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs,
const WineD3D_GL_Info *gl_info, const struct StateEntryTemplate *vertex,
const struct wined3d_gl_info *gl_info, const struct StateEntryTemplate *vertex,
const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc)
{
unsigned int i, type, handlers;
......
......@@ -38,7 +38,7 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d);
static void surface_cleanup(IWineD3DSurfaceImpl *This)
{
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
const WineD3D_GL_Info *gl_info = &device->adapter->gl_info;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
renderbuffer_entry_t *entry, *entry2;
TRACE("(%p) : Cleaning up.\n", This);
......@@ -124,7 +124,7 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format,
WINED3DPOOL pool, IUnknown *parent)
{
const WineD3D_GL_Info *gl_info = &device->adapter->gl_info;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, &GLINFO_LOCATION);
void (*cleanup)(IWineD3DSurfaceImpl *This);
unsigned int resource_size;
......
......@@ -127,7 +127,7 @@ static void texture_cleanup(IWineD3DTextureImpl *This, D3DCB_DESTROYSURFACEFN su
HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels,
IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent)
{
const WineD3D_GL_Info *gl_info = &device->adapter->gl_info;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
UINT pow2_width, pow2_height;
UINT tmp_w, tmp_h;
......
......@@ -500,7 +500,7 @@ static inline int getFmtIdx(WINED3DFORMAT fmt) {
return -1;
}
static BOOL init_format_base_info(WineD3D_GL_Info *gl_info)
static BOOL init_format_base_info(struct wined3d_gl_info *gl_info)
{
UINT format_count = sizeof(formats) / sizeof(*formats);
UINT i;
......@@ -529,7 +529,7 @@ static BOOL init_format_base_info(WineD3D_GL_Info *gl_info)
return TRUE;
}
static BOOL init_format_compression_info(WineD3D_GL_Info *gl_info)
static BOOL init_format_compression_info(struct wined3d_gl_info *gl_info)
{
unsigned int i;
......@@ -558,7 +558,7 @@ static BOOL init_format_compression_info(WineD3D_GL_Info *gl_info)
#define GLINFO_LOCATION (*gl_info)
/* Context activation is done by the caller. */
static void check_fbo_compat(const WineD3D_GL_Info *gl_info, struct GlPixelFormatDesc *format_desc)
static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct GlPixelFormatDesc *format_desc)
{
/* Check if the default internal format is supported as a frame buffer
* target, otherwise fall back to the render target internal.
......@@ -682,7 +682,7 @@ static void check_fbo_compat(const WineD3D_GL_Info *gl_info, struct GlPixelForma
}
/* Context activation is done by the caller. */
static void init_format_fbo_compat_info(WineD3D_GL_Info *gl_info)
static void init_format_fbo_compat_info(struct wined3d_gl_info *gl_info)
{
unsigned int i;
GLuint fbo;
......@@ -738,7 +738,7 @@ static void init_format_fbo_compat_info(WineD3D_GL_Info *gl_info)
}
}
static BOOL init_format_texture_info(WineD3D_GL_Info *gl_info)
static BOOL init_format_texture_info(struct wined3d_gl_info *gl_info)
{
unsigned int i;
......@@ -770,7 +770,7 @@ static BOOL init_format_texture_info(WineD3D_GL_Info *gl_info)
return TRUE;
}
static void apply_format_fixups(WineD3D_GL_Info *gl_info)
static void apply_format_fixups(struct wined3d_gl_info *gl_info)
{
int idx;
......@@ -890,7 +890,7 @@ static void apply_format_fixups(WineD3D_GL_Info *gl_info)
}
}
static BOOL init_format_vertex_info(WineD3D_GL_Info *gl_info)
static BOOL init_format_vertex_info(struct wined3d_gl_info *gl_info)
{
unsigned int i;
......@@ -918,7 +918,7 @@ static BOOL init_format_vertex_info(WineD3D_GL_Info *gl_info)
return TRUE;
}
BOOL initPixelFormatsNoGL(WineD3D_GL_Info *gl_info)
BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info)
{
if (!init_format_base_info(gl_info)) return FALSE;
......@@ -932,7 +932,7 @@ BOOL initPixelFormatsNoGL(WineD3D_GL_Info *gl_info)
}
/* Context activation is done by the caller. */
BOOL initPixelFormats(WineD3D_GL_Info *gl_info)
BOOL initPixelFormats(struct wined3d_gl_info *gl_info)
{
if (!init_format_base_info(gl_info)) return FALSE;
......@@ -954,7 +954,7 @@ fail:
#define GLINFO_LOCATION This->adapter->gl_info
const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const WineD3D_GL_Info *gl_info)
const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const struct wined3d_gl_info *gl_info)
{
int idx = getFmtIdx(fmt);
......
......@@ -32,7 +32,7 @@ static void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINE
/* Override the IWineD3DResource Preload method. */
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
const WineD3D_GL_Info *gl_info = &device->adapter->gl_info;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
BOOL srgb_mode = This->baseTexture.is_srgb;
BOOL srgb_was_toggled = FALSE;
unsigned int i;
......@@ -99,7 +99,7 @@ static void volumetexture_cleanup(IWineD3DVolumeTextureImpl *This, D3DCB_DESTROY
HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT height, UINT depth, UINT levels,
IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent)
{
const WineD3D_GL_Info *gl_info = &device->adapter->gl_info;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
UINT tmp_w, tmp_h, tmp_d;
unsigned int i;
......
......@@ -3949,67 +3949,68 @@ typedef BOOL (WINAPI * WINED3D_PFNWGLSETPIXELFORMATWINE) (HDC hdc, int iPixelFor
****************************************************/
#define USE_GL_FUNC(type, pfn, ext, replace) type pfn;
typedef struct _WineD3D_GL_Info {
GL_Vendors gl_vendor;
GL_Cards gl_card;
UINT vidmem;
DWORD driver_version;
DWORD driver_version_hipart;
const char *driver_description;
/**
* CAPS Constants
*/
UINT max_buffers;
UINT max_lights;
UINT max_textures;
UINT max_texture_stages;
UINT max_fragment_samplers;
UINT max_vertex_samplers;
UINT max_combined_samplers;
UINT max_sampler_stages;
UINT max_clipplanes;
UINT max_texture_size;
UINT max_texture3d_size;
float max_pointsize, max_pointsizemin;
UINT max_point_sprite_units;
UINT max_blends;
UINT max_anisotropy;
UINT max_glsl_varyings;
float max_shininess;
unsigned max_vshader_constantsF;
unsigned max_pshader_constantsF;
unsigned vs_arb_constantsF;
unsigned vs_arb_max_instructions;
unsigned vs_arb_max_temps;
unsigned ps_arb_constantsF;
unsigned ps_arb_max_local_constants;
unsigned ps_arb_max_instructions;
unsigned ps_arb_max_temps;
unsigned vs_glsl_constantsF;
unsigned ps_glsl_constantsF;
GL_PSVersion ps_arb_version;
GL_PSVersion ps_nv_version;
GL_VSVersion vs_arb_version;
GL_VSVersion vs_nv_version;
GL_VSVersion vs_ati_version;
DWORD reserved_glsl_constants;
DWORD quirks;
BOOL supported[WINED3D_GL_EXT_COUNT];
/** OpenGL EXT and ARB functions ptr */
GL_EXT_FUNCS_GEN
/** OpenGL WGL functions ptr */
WGL_EXT_FUNCS_GEN
struct GlPixelFormatDesc *gl_formats;
} WineD3D_GL_Info;
struct wined3d_gl_info
{
GL_Vendors gl_vendor;
GL_Cards gl_card;
UINT vidmem;
DWORD driver_version;
DWORD driver_version_hipart;
const char *driver_description;
UINT max_buffers;
UINT max_lights;
UINT max_textures;
UINT max_texture_stages;
UINT max_fragment_samplers;
UINT max_vertex_samplers;
UINT max_combined_samplers;
UINT max_sampler_stages;
UINT max_clipplanes;
UINT max_texture_size;
UINT max_texture3d_size;
float max_pointsize, max_pointsizemin;
UINT max_point_sprite_units;
UINT max_blends;
UINT max_anisotropy;
UINT max_glsl_varyings;
float max_shininess;
unsigned int max_vshader_constantsF;
unsigned int max_pshader_constantsF;
unsigned int vs_arb_constantsF;
unsigned int vs_arb_max_instructions;
unsigned int vs_arb_max_temps;
unsigned int ps_arb_constantsF;
unsigned int ps_arb_max_local_constants;
unsigned int ps_arb_max_instructions;
unsigned int ps_arb_max_temps;
unsigned int vs_glsl_constantsF;
unsigned int ps_glsl_constantsF;
GL_PSVersion ps_arb_version;
GL_PSVersion ps_nv_version;
GL_VSVersion vs_arb_version;
GL_VSVersion vs_nv_version;
GL_VSVersion vs_ati_version;
DWORD reserved_glsl_constants;
DWORD quirks;
BOOL supported[WINED3D_GL_EXT_COUNT];
/* GL function pointers */
GL_EXT_FUNCS_GEN
/* WGL function pointers */
WGL_EXT_FUNCS_GEN
struct GlPixelFormatDesc *gl_formats;
};
#undef USE_GL_FUNC
#endif /* __WINE_WINED3D_GL */
......@@ -822,7 +822,7 @@ typedef struct {
HRESULT (*shader_alloc_private)(IWineD3DDevice *iface);
void (*shader_free_private)(IWineD3DDevice *iface);
BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface);
void (*shader_get_caps)(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *caps);
void (*shader_get_caps)(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, struct shader_caps *caps);
BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup);
void (*shader_add_instruction_modifiers)(const struct wined3d_shader_instruction *ins);
} shader_backend_t;
......@@ -1146,7 +1146,7 @@ struct fragment_caps {
struct fragment_pipeline {
void (*enable_extension)(IWineD3DDevice *iface, BOOL enable);
void (*get_caps)(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *caps);
void (*get_caps)(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, struct fragment_caps *caps);
HRESULT (*alloc_private)(IWineD3DDevice *iface);
void (*free_private)(IWineD3DDevice *iface);
BOOL (*color_fixup_supported)(struct color_fixup_desc fixup);
......@@ -1164,7 +1164,7 @@ extern const struct fragment_pipeline nvrc_fragment_pipeline;
/* "Base" state table */
HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs,
const WineD3D_GL_Info *gl_info, const struct StateEntryTemplate *vertex,
const struct wined3d_gl_info *gl_info, const struct StateEntryTemplate *vertex,
const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc);
/* Shaders for color conversions in blits */
......@@ -1322,7 +1322,7 @@ struct WineD3DAdapter
UINT num;
BOOL opengl;
POINT monitorPoint;
WineD3D_GL_Info gl_info;
struct wined3d_gl_info gl_info;
const char *driver;
const char *description;
WCHAR DeviceName[CCHDEVICENAME]; /* DeviceName for use with e.g. ChangeDisplaySettings */
......@@ -1333,10 +1333,10 @@ struct WineD3DAdapter
unsigned int UsedTextureRam;
};
extern BOOL initPixelFormats(WineD3D_GL_Info *gl_info);
BOOL initPixelFormatsNoGL(WineD3D_GL_Info *gl_info);
extern BOOL initPixelFormats(struct wined3d_gl_info *gl_info);
BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info);
extern long WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *D3DDevice, long glram);
extern void add_gl_compat_wrappers(WineD3D_GL_Info *gl_info);
extern void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info);
/*****************************************************************************
* High order patch management
......@@ -2851,7 +2851,7 @@ struct GlPixelFormatDesc
struct color_fixup_desc color_fixup;
};
const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const WineD3D_GL_Info *gl_info);
const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const struct wined3d_gl_info *gl_info);
static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment