Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b83dc6bb
Commit
b83dc6bb
authored
Dec 19, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move the GL info structure into the adapter.
parent
6ac59b96
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
39 deletions
+54
-39
device.c
dlls/wined3d/device.c
+4
-2
directx.c
dlls/wined3d/directx.c
+1
-1
utils.c
dlls/wined3d/utils.c
+32
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+6
-36
wined3d_gl.h
include/wine/wined3d_gl.h
+11
-0
No files found.
dlls/wined3d/device.c
View file @
b83dc6bb
...
@@ -1711,7 +1711,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice*
...
@@ -1711,7 +1711,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice*
return
hr
;
return
hr
;
}
}
static
size_t
ConvertFvfToDeclaration
(
DWORD
fvf
,
WINED3DVERTEXELEMENT
**
ppVertexElements
)
{
static
size_t
ConvertFvfToDeclaration
(
IWineD3DDeviceImpl
*
This
,
/* For the GL info, which has the type table */
DWORD
fvf
,
WINED3DVERTEXELEMENT
**
ppVertexElements
)
{
unsigned
int
idx
,
idx2
;
unsigned
int
idx
,
idx2
;
unsigned
int
offset
;
unsigned
int
offset
;
...
@@ -1839,10 +1840,11 @@ static size_t ConvertFvfToDeclaration(DWORD fvf, WINED3DVERTEXELEMENT** ppVertex
...
@@ -1839,10 +1840,11 @@ static size_t ConvertFvfToDeclaration(DWORD fvf, WINED3DVERTEXELEMENT** ppVertex
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF
(
IWineD3DDevice
*
iface
,
IWineD3DVertexDeclaration
**
ppVertexDeclaration
,
IUnknown
*
Parent
,
DWORD
Fvf
)
{
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF
(
IWineD3DDevice
*
iface
,
IWineD3DVertexDeclaration
**
ppVertexDeclaration
,
IUnknown
*
Parent
,
DWORD
Fvf
)
{
WINED3DVERTEXELEMENT
*
elements
=
NULL
;
WINED3DVERTEXELEMENT
*
elements
=
NULL
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
size_t
size
;
size_t
size
;
DWORD
hr
;
DWORD
hr
;
size
=
ConvertFvfToDeclaration
(
Fvf
,
&
elements
);
size
=
ConvertFvfToDeclaration
(
This
,
Fvf
,
&
elements
);
if
(
size
==
0
)
return
WINED3DERR_OUTOFVIDEOMEMORY
;
if
(
size
==
0
)
return
WINED3DERR_OUTOFVIDEOMEMORY
;
hr
=
IWineD3DDevice_CreateVertexDeclaration
(
iface
,
ppVertexDeclaration
,
Parent
,
elements
,
size
);
hr
=
IWineD3DDevice_CreateVertexDeclaration
(
iface
,
ppVertexDeclaration
,
Parent
,
elements
,
size
);
...
...
dlls/wined3d/directx.c
View file @
b83dc6bb
...
@@ -3160,7 +3160,7 @@ BOOL InitAdapters(void) {
...
@@ -3160,7 +3160,7 @@ BOOL InitAdapters(void) {
select_shader_mode
(
&
Adapters
[
0
].
gl_info
,
WINED3DDEVTYPE_HAL
,
&
ps_selected_mode
,
&
vs_selected_mode
);
select_shader_mode
(
&
Adapters
[
0
].
gl_info
,
WINED3DDEVTYPE_HAL
,
&
ps_selected_mode
,
&
vs_selected_mode
);
select_shader_max_constants
(
ps_selected_mode
,
vs_selected_mode
,
&
Adapters
[
0
].
gl_info
);
select_shader_max_constants
(
ps_selected_mode
,
vs_selected_mode
,
&
Adapters
[
0
].
gl_info
);
fillGLAttribFuncs
(
&
Adapters
[
0
].
gl_info
);
fillGLAttribFuncs
(
&
Adapters
[
0
].
gl_info
);
init_type_lookup
(
&
Adapters
[
0
].
gl_info
);
}
}
numAdapters
=
1
;
numAdapters
=
1
;
TRACE
(
"%d adapters successfully initialized
\n
"
,
numAdapters
);
TRACE
(
"%d adapters successfully initialized
\n
"
,
numAdapters
);
...
...
dlls/wined3d/utils.c
View file @
b83dc6bb
...
@@ -326,6 +326,38 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info)
...
@@ -326,6 +326,38 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info)
return
TRUE
;
return
TRUE
;
}
}
/* NOTE: Make sure these are in the correct numerical order. (see /include/wined3d_types.h) */
static
WINED3DGLTYPE
const
glTypeLookupTemplate
[
WINED3DDECLTYPE_UNUSED
]
=
{
{
WINED3DDECLTYPE_FLOAT1
,
1
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
float
)},
{
WINED3DDECLTYPE_FLOAT2
,
2
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
float
)},
{
WINED3DDECLTYPE_FLOAT3
,
3
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
float
)},
{
WINED3DDECLTYPE_FLOAT4
,
4
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
float
)},
{
WINED3DDECLTYPE_D3DCOLOR
,
4
,
GL_UNSIGNED_BYTE
,
GL_TRUE
,
sizeof
(
BYTE
)},
{
WINED3DDECLTYPE_UBYTE4
,
4
,
GL_UNSIGNED_BYTE
,
GL_FALSE
,
sizeof
(
BYTE
)},
{
WINED3DDECLTYPE_SHORT2
,
2
,
GL_SHORT
,
GL_FALSE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_SHORT4
,
4
,
GL_SHORT
,
GL_FALSE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_UBYTE4N
,
4
,
GL_UNSIGNED_BYTE
,
GL_TRUE
,
sizeof
(
BYTE
)},
{
WINED3DDECLTYPE_SHORT2N
,
2
,
GL_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_SHORT4N
,
4
,
GL_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_USHORT2N
,
2
,
GL_UNSIGNED_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_USHORT4N
,
4
,
GL_UNSIGNED_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_UDEC3
,
3
,
GL_UNSIGNED_SHORT
,
GL_FALSE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_DEC3N
,
3
,
GL_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_FLOAT16_2
,
2
,
GL_HALF_FLOAT_NV
,
GL_FALSE
,
sizeof
(
GLhalfNV
)},
{
WINED3DDECLTYPE_FLOAT16_4
,
4
,
GL_HALF_FLOAT_NV
,
GL_FALSE
,
sizeof
(
GLhalfNV
)}};
void
init_type_lookup
(
WineD3D_GL_Info
*
gl_info
)
{
memcpy
(
gl_info
->
glTypeLookup
,
glTypeLookupTemplate
,
sizeof
(
glTypeLookupTemplate
));
if
(
!
GL_SUPPORT
(
NV_HALF_FLOAT
))
{
/* Do not change the size of the type, it is CPU side. Whe have to change the GPU-side information though.
* It is the job of the vertex buffer code to make sure that the vbos have the right format
*/
gl_info
->
glTypeLookup
[
WINED3DDECLTYPE_FLOAT16_2
].
glType
=
GL_FLOAT
;
gl_info
->
glTypeLookup
[
WINED3DDECLTYPE_FLOAT16_4
].
glType
=
GL_FLOAT
;
}
}
#undef GLINFO_LOCATION
#undef GLINFO_LOCATION
#define GLINFO_LOCATION This->adapter->gl_info
#define GLINFO_LOCATION This->adapter->gl_info
...
...
dlls/wined3d/wined3d_private.h
View file @
b83dc6bb
...
@@ -114,42 +114,12 @@ extern DWORD *stateLookup[MAX_LOOKUPS];
...
@@ -114,42 +114,12 @@ extern DWORD *stateLookup[MAX_LOOKUPS];
extern
DWORD
minMipLookup
[
WINED3DTEXF_ANISOTROPIC
+
1
][
WINED3DTEXF_LINEAR
+
1
];
extern
DWORD
minMipLookup
[
WINED3DTEXF_ANISOTROPIC
+
1
][
WINED3DTEXF_LINEAR
+
1
];
typedef
struct
_WINED3DGLTYPE
{
void
init_type_lookup
(
WineD3D_GL_Info
*
gl_info
);
int
d3dType
;
#define WINED3D_ATR_TYPE(type) GLINFO_LOCATION.glTypeLookup[type].d3dType
GLint
size
;
#define WINED3D_ATR_SIZE(type) GLINFO_LOCATION.glTypeLookup[type].size
GLenum
glType
;
#define WINED3D_ATR_GLTYPE(type) GLINFO_LOCATION.glTypeLookup[type].glType
GLboolean
normalized
;
#define WINED3D_ATR_NORMALIZED(type) GLINFO_LOCATION.glTypeLookup[type].normalized
int
typesize
;
#define WINED3D_ATR_TYPESIZE(type) GLINFO_LOCATION.glTypeLookup[type].typesize
}
WINED3DGLTYPE
;
/* NOTE: Make sure these are in the correct numerical order. (see /include/wined3d_types.h) */
static
WINED3DGLTYPE
const
glTypeLookup
[
WINED3DDECLTYPE_UNUSED
]
=
{
{
WINED3DDECLTYPE_FLOAT1
,
1
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
float
)},
{
WINED3DDECLTYPE_FLOAT2
,
2
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
float
)},
{
WINED3DDECLTYPE_FLOAT3
,
3
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
float
)},
{
WINED3DDECLTYPE_FLOAT4
,
4
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
float
)},
{
WINED3DDECLTYPE_D3DCOLOR
,
4
,
GL_UNSIGNED_BYTE
,
GL_TRUE
,
sizeof
(
BYTE
)},
{
WINED3DDECLTYPE_UBYTE4
,
4
,
GL_UNSIGNED_BYTE
,
GL_FALSE
,
sizeof
(
BYTE
)},
{
WINED3DDECLTYPE_SHORT2
,
2
,
GL_SHORT
,
GL_FALSE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_SHORT4
,
4
,
GL_SHORT
,
GL_FALSE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_UBYTE4N
,
4
,
GL_UNSIGNED_BYTE
,
GL_TRUE
,
sizeof
(
BYTE
)},
{
WINED3DDECLTYPE_SHORT2N
,
2
,
GL_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_SHORT4N
,
4
,
GL_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_USHORT2N
,
2
,
GL_UNSIGNED_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_USHORT4N
,
4
,
GL_UNSIGNED_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_UDEC3
,
3
,
GL_UNSIGNED_SHORT
,
GL_FALSE
,
sizeof
(
short
int
)},
{
WINED3DDECLTYPE_DEC3N
,
3
,
GL_SHORT
,
GL_TRUE
,
sizeof
(
short
int
)},
/* We should do an extension check for NV_HALF_FLOAT. However, without NV_HALF_FLOAT
* we won't be able to load the data at all, so at least for the moment it wouldn't
* gain us much. */
{
WINED3DDECLTYPE_FLOAT16_2
,
2
,
GL_HALF_FLOAT_NV
,
GL_FALSE
,
sizeof
(
GLhalfNV
)},
{
WINED3DDECLTYPE_FLOAT16_4
,
4
,
GL_HALF_FLOAT_NV
,
GL_FALSE
,
sizeof
(
GLhalfNV
)}};
#define WINED3D_ATR_TYPE(type) glTypeLookup[type].d3dType
#define WINED3D_ATR_SIZE(type) glTypeLookup[type].size
#define WINED3D_ATR_GLTYPE(type) glTypeLookup[type].glType
#define WINED3D_ATR_NORMALIZED(type) glTypeLookup[type].normalized
#define WINED3D_ATR_TYPESIZE(type) glTypeLookup[type].typesize
/**
/**
* Settings
* Settings
...
...
include/wine/wined3d_gl.h
View file @
b83dc6bb
...
@@ -3634,6 +3634,14 @@ typedef struct {
...
@@ -3634,6 +3634,14 @@ typedef struct {
WINED3DFORMAT
conversion_group
;
WINED3DFORMAT
conversion_group
;
}
GlPixelFormatDesc
;
}
GlPixelFormatDesc
;
typedef
struct
_WINED3DGLTYPE
{
int
d3dType
;
GLint
size
;
GLenum
glType
;
GLboolean
normalized
;
int
typesize
;
}
WINED3DGLTYPE
;
#define USE_GL_FUNC(type, pfn, ext, replace) type pfn;
#define USE_GL_FUNC(type, pfn, ext, replace) type pfn;
typedef
struct
_WineD3D_GL_Info
{
typedef
struct
_WineD3D_GL_Info
{
...
@@ -3695,6 +3703,9 @@ typedef struct _WineD3D_GL_Info {
...
@@ -3695,6 +3703,9 @@ typedef struct _WineD3D_GL_Info {
WGL_EXT_FUNCS_GEN
;
WGL_EXT_FUNCS_GEN
;
GlPixelFormatDesc
*
gl_formats
;
GlPixelFormatDesc
*
gl_formats
;
/* Vertex data types */
WINED3DGLTYPE
glTypeLookup
[
WINED3DDECLTYPE_UNUSED
];
}
WineD3D_GL_Info
;
}
WineD3D_GL_Info
;
#undef USE_GL_FUNC
#undef USE_GL_FUNC
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment