Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e1929396
Commit
e1929396
authored
Jan 22, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Jan 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use the core version of GL vertex attribute functions where possible.
parent
584892b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
39 deletions
+73
-39
directx.c
dlls/wined3d/directx.c
+34
-0
drawprim.c
dlls/wined3d/drawprim.c
+15
-15
state.c
dlls/wined3d/state.c
+24
-24
No files found.
dlls/wined3d/directx.c
View file @
e1929396
...
...
@@ -2881,8 +2881,10 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
USE_GL_FUNC
(
glCompressedTexSubImage2D
)
/* OpenGL 1.3 */
USE_GL_FUNC
(
glCompressedTexSubImage3D
)
/* OpenGL 1.3 */
USE_GL_FUNC
(
glDeleteBuffers
)
/* OpenGL 1.5 */
USE_GL_FUNC
(
glDisableVertexAttribArray
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glDrawBuffers
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glDrawElementsInstanced
)
/* OpenGL 3.1 */
USE_GL_FUNC
(
glEnableVertexAttribArray
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glGenBuffers
)
/* OpenGL 1.5 */
USE_GL_FUNC
(
glGetBufferSubData
)
/* OpenGL 1.5 */
USE_GL_FUNC
(
glGetCompressedTexImage
)
/* OpenGL 1.3 */
...
...
@@ -2892,6 +2894,21 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
USE_GL_FUNC
(
glStencilFuncSeparate
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glStencilOpSeparate
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glUnmapBuffer
)
/* OpenGL 1.5 */
USE_GL_FUNC
(
glVertexAttrib1f
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib1fv
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib2f
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib2fv
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib3f
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib3fv
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib4f
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib4fv
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib4Nsv
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib4Nubv
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib4Nusv
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib4sv
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttrib4ubv
)
/* OpenGL 2.0 */
USE_GL_FUNC
(
glVertexAttribDivisor
)
/* OpenGL 3.3 */
USE_GL_FUNC
(
glVertexAttribPointer
)
/* OpenGL 2.0 */
#undef USE_GL_FUNC
#ifndef USE_WIN32_OPENGL
...
...
@@ -2921,13 +2938,30 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
MAP_GL_FUNCTION
(
glCompressedTexSubImage2D
,
glCompressedTexSubImage2DARB
);
MAP_GL_FUNCTION
(
glCompressedTexSubImage3D
,
glCompressedTexSubImage3DARB
);
MAP_GL_FUNCTION
(
glDeleteBuffers
,
glDeleteBuffersARB
);
MAP_GL_FUNCTION
(
glDisableVertexAttribArray
,
glDisableVertexAttribArrayARB
);
MAP_GL_FUNCTION
(
glDrawBuffers
,
glDrawBuffersARB
);
MAP_GL_FUNCTION
(
glDrawElementsInstanced
,
glDrawElementsInstancedARB
);
MAP_GL_FUNCTION
(
glEnableVertexAttribArray
,
glEnableVertexAttribArrayARB
);
MAP_GL_FUNCTION
(
glGenBuffers
,
glGenBuffersARB
);
MAP_GL_FUNCTION
(
glGetBufferSubData
,
glGetBufferSubDataARB
);
MAP_GL_FUNCTION
(
glGetCompressedTexImage
,
glGetCompressedTexImageARB
);
MAP_GL_FUNCTION
(
glMapBuffer
,
glMapBufferARB
);
MAP_GL_FUNCTION
(
glUnmapBuffer
,
glUnmapBufferARB
);
MAP_GL_FUNCTION
(
glVertexAttrib1f
,
glVertexAttrib1fARB
);
MAP_GL_FUNCTION
(
glVertexAttrib1fv
,
glVertexAttrib1fvARB
);
MAP_GL_FUNCTION
(
glVertexAttrib2f
,
glVertexAttrib2fARB
);
MAP_GL_FUNCTION
(
glVertexAttrib2fv
,
glVertexAttrib2fvARB
);
MAP_GL_FUNCTION
(
glVertexAttrib3f
,
glVertexAttrib3fARB
);
MAP_GL_FUNCTION
(
glVertexAttrib3fv
,
glVertexAttrib3fvARB
);
MAP_GL_FUNCTION
(
glVertexAttrib4f
,
glVertexAttrib4fARB
);
MAP_GL_FUNCTION
(
glVertexAttrib4fv
,
glVertexAttrib4fvARB
);
MAP_GL_FUNCTION
(
glVertexAttrib4Nsv
,
glVertexAttrib4NsvARB
);
MAP_GL_FUNCTION
(
glVertexAttrib4Nubv
,
glVertexAttrib4NubvARB
);
MAP_GL_FUNCTION
(
glVertexAttrib4Nusv
,
glVertexAttrib4NusvARB
);
MAP_GL_FUNCTION
(
glVertexAttrib4sv
,
glVertexAttrib4svARB
);
MAP_GL_FUNCTION
(
glVertexAttrib4ubv
,
glVertexAttrib4ubvARB
);
MAP_GL_FUNCTION
(
glVertexAttribDivisor
,
glVertexAttribDivisorARB
);
MAP_GL_FUNCTION
(
glVertexAttribPointer
,
glVertexAttribPointerARB
);
#undef MAP_GL_FUNCTION
}
...
...
dlls/wined3d/drawprim.c
View file @
e1929396
...
...
@@ -346,20 +346,20 @@ static inline void send_attribute(const struct wined3d_gl_info *gl_info,
switch
(
format
)
{
case
WINED3DFMT_R32_FLOAT
:
GL_EXTCALL
(
glVertexAttrib1fv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib1fv
(
index
,
ptr
));
break
;
case
WINED3DFMT_R32G32_FLOAT
:
GL_EXTCALL
(
glVertexAttrib2fv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib2fv
(
index
,
ptr
));
break
;
case
WINED3DFMT_R32G32B32_FLOAT
:
GL_EXTCALL
(
glVertexAttrib3fv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib3fv
(
index
,
ptr
));
break
;
case
WINED3DFMT_R32G32B32A32_FLOAT
:
GL_EXTCALL
(
glVertexAttrib4fv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib4fv
(
index
,
ptr
));
break
;
case
WINED3DFMT_R8G8B8A8_UINT
:
GL_EXTCALL
(
glVertexAttrib4ubv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib4ubv
(
index
,
ptr
));
break
;
case
WINED3DFMT_B8G8R8A8_UNORM
:
if
(
gl_info
->
supported
[
ARB_VERTEX_ARRAY_BGRA
])
...
...
@@ -368,38 +368,38 @@ static inline void send_attribute(const struct wined3d_gl_info *gl_info,
DWORD
c
=
*
src
&
0xff00ff00
;
c
|=
(
*
src
&
0xff0000
)
>>
16
;
c
|=
(
*
src
&
0xff
)
<<
16
;
GL_EXTCALL
(
glVertexAttrib4Nubv
ARB
(
index
,
(
GLubyte
*
)
&
c
));
GL_EXTCALL
(
glVertexAttrib4Nubv
(
index
,
(
GLubyte
*
)
&
c
));
break
;
}
/* else fallthrough */
case
WINED3DFMT_R8G8B8A8_UNORM
:
GL_EXTCALL
(
glVertexAttrib4Nubv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib4Nubv
(
index
,
ptr
));
break
;
case
WINED3DFMT_R16G16_SINT
:
GL_EXTCALL
(
glVertexAttrib2sv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib2sv
(
index
,
ptr
));
break
;
case
WINED3DFMT_R16G16B16A16_SINT
:
GL_EXTCALL
(
glVertexAttrib4sv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib4sv
(
index
,
ptr
));
break
;
case
WINED3DFMT_R16G16_SNORM
:
{
GLshort
s
[
4
]
=
{((
const
GLshort
*
)
ptr
)[
0
],
((
const
GLshort
*
)
ptr
)[
1
],
0
,
1
};
GL_EXTCALL
(
glVertexAttrib4Nsv
ARB
(
index
,
s
));
GL_EXTCALL
(
glVertexAttrib4Nsv
(
index
,
s
));
break
;
}
case
WINED3DFMT_R16G16_UNORM
:
{
GLushort
s
[
4
]
=
{((
const
GLushort
*
)
ptr
)[
0
],
((
const
GLushort
*
)
ptr
)[
1
],
0
,
1
};
GL_EXTCALL
(
glVertexAttrib4Nusv
ARB
(
index
,
s
));
GL_EXTCALL
(
glVertexAttrib4Nusv
(
index
,
s
));
break
;
}
case
WINED3DFMT_R16G16B16A16_SNORM
:
GL_EXTCALL
(
glVertexAttrib4Nsv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib4Nsv
(
index
,
ptr
));
break
;
case
WINED3DFMT_R16G16B16A16_UNORM
:
GL_EXTCALL
(
glVertexAttrib4Nusv
ARB
(
index
,
ptr
));
GL_EXTCALL
(
glVertexAttrib4Nusv
(
index
,
ptr
));
break
;
case
WINED3DFMT_R10G10B10A2_UINT
:
...
...
@@ -424,7 +424,7 @@ static inline void send_attribute(const struct wined3d_gl_info *gl_info,
{
float
x
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
0
);
float
y
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
1
);
GL_EXTCALL
(
glVertexAttrib2f
ARB
(
index
,
x
,
y
));
GL_EXTCALL
(
glVertexAttrib2f
(
index
,
x
,
y
));
}
break
;
case
WINED3DFMT_R16G16B16A16_FLOAT
:
...
...
@@ -439,7 +439,7 @@ static inline void send_attribute(const struct wined3d_gl_info *gl_info,
float
y
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
1
);
float
z
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
2
);
float
w
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
3
);
GL_EXTCALL
(
glVertexAttrib4f
ARB
(
index
,
x
,
y
,
z
,
w
));
GL_EXTCALL
(
glVertexAttrib4f
(
index
,
x
,
y
,
z
,
w
));
}
break
;
...
...
dlls/wined3d/state.c
View file @
e1929396
...
...
@@ -4157,10 +4157,10 @@ static inline void unload_numbered_array(struct wined3d_context *context, int i)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GL_EXTCALL
(
glDisableVertexAttribArray
ARB
(
i
));
checkGLcall
(
"glDisableVertexAttribArray
ARB(reg)
"
);
GL_EXTCALL
(
glDisableVertexAttribArray
(
i
));
checkGLcall
(
"glDisableVertexAttribArray"
);
if
(
gl_info
->
supported
[
ARB_INSTANCED_ARRAYS
])
GL_EXTCALL
(
glVertexAttribDivisor
ARB
(
i
,
0
));
GL_EXTCALL
(
glVertexAttribDivisor
(
i
,
0
));
context
->
numbered_array_mask
&=
~
(
1
<<
i
);
}
...
...
@@ -4196,7 +4196,7 @@ static void load_numbered_arrays(struct wined3d_context *context,
if
(
context
->
numbered_array_mask
&
(
1
<<
i
))
unload_numbered_array
(
context
,
i
);
if
(
state
->
shader
[
WINED3D_SHADER_TYPE_VERTEX
]
->
reg_maps
.
input_registers
&
(
1
<<
i
))
GL_EXTCALL
(
glVertexAttrib4f
ARB
(
i
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
));
GL_EXTCALL
(
glVertexAttrib4f
(
i
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
));
continue
;
}
...
...
@@ -4216,11 +4216,11 @@ static void load_numbered_arrays(struct wined3d_context *context,
continue
;
}
GL_EXTCALL
(
glVertexAttribDivisor
ARB
(
i
,
1
));
GL_EXTCALL
(
glVertexAttribDivisor
(
i
,
1
));
}
else
if
(
gl_info
->
supported
[
ARB_INSTANCED_ARRAYS
])
{
GL_EXTCALL
(
glVertexAttribDivisor
ARB
(
i
,
0
));
GL_EXTCALL
(
glVertexAttribDivisor
(
i
,
0
));
}
TRACE_
(
d3d_shader
)(
"Loading array %u [VBO=%u]
\n
"
,
i
,
stream_info
->
elements
[
i
].
data
.
buffer_object
);
...
...
@@ -4237,7 +4237,7 @@ static void load_numbered_arrays(struct wined3d_context *context,
* pointer. vb can point to a user pointer data blob. In that case
* curVBO will be 0. If there is a vertex buffer but no vbo we
* won't be load converted attributes anyway. */
GL_EXTCALL
(
glVertexAttribPointer
ARB
(
i
,
stream_info
->
elements
[
i
].
format
->
gl_vtx_format
,
GL_EXTCALL
(
glVertexAttribPointer
(
i
,
stream_info
->
elements
[
i
].
format
->
gl_vtx_format
,
stream_info
->
elements
[
i
].
format
->
gl_vtx_type
,
stream_info
->
elements
[
i
].
format
->
gl_normalized
,
stream_info
->
elements
[
i
].
stride
,
stream_info
->
elements
[
i
].
data
.
addr
...
...
@@ -4245,14 +4245,14 @@ static void load_numbered_arrays(struct wined3d_context *context,
if
(
!
(
context
->
numbered_array_mask
&
(
1
<<
i
)))
{
GL_EXTCALL
(
glEnableVertexAttribArray
ARB
(
i
));
GL_EXTCALL
(
glEnableVertexAttribArray
(
i
));
context
->
numbered_array_mask
|=
(
1
<<
i
);
}
}
else
{
/* Stride = 0 means always the same values.
* glVertexAttribPointer
ARB
doesn't do that. Instead disable the
* glVertexAttribPointer doesn't do that. Instead disable the
* pointer and set up the attribute statically. But we have to
* figure out the system memory address. */
const
BYTE
*
ptr
=
stream_info
->
elements
[
i
].
data
.
addr
;
...
...
@@ -4266,20 +4266,20 @@ static void load_numbered_arrays(struct wined3d_context *context,
switch
(
stream_info
->
elements
[
i
].
format
->
id
)
{
case
WINED3DFMT_R32_FLOAT
:
GL_EXTCALL
(
glVertexAttrib1fv
ARB
(
i
,
(
const
GLfloat
*
)
ptr
));
GL_EXTCALL
(
glVertexAttrib1fv
(
i
,
(
const
GLfloat
*
)
ptr
));
break
;
case
WINED3DFMT_R32G32_FLOAT
:
GL_EXTCALL
(
glVertexAttrib2fv
ARB
(
i
,
(
const
GLfloat
*
)
ptr
));
GL_EXTCALL
(
glVertexAttrib2fv
(
i
,
(
const
GLfloat
*
)
ptr
));
break
;
case
WINED3DFMT_R32G32B32_FLOAT
:
GL_EXTCALL
(
glVertexAttrib3fv
ARB
(
i
,
(
const
GLfloat
*
)
ptr
));
GL_EXTCALL
(
glVertexAttrib3fv
(
i
,
(
const
GLfloat
*
)
ptr
));
break
;
case
WINED3DFMT_R32G32B32A32_FLOAT
:
GL_EXTCALL
(
glVertexAttrib4fv
ARB
(
i
,
(
const
GLfloat
*
)
ptr
));
GL_EXTCALL
(
glVertexAttrib4fv
(
i
,
(
const
GLfloat
*
)
ptr
));
break
;
case
WINED3DFMT_R8G8B8A8_UINT
:
GL_EXTCALL
(
glVertexAttrib4ubv
ARB
(
i
,
ptr
));
GL_EXTCALL
(
glVertexAttrib4ubv
(
i
,
ptr
));
break
;
case
WINED3DFMT_B8G8R8A8_UNORM
:
if
(
gl_info
->
supported
[
ARB_VERTEX_ARRAY_BGRA
])
...
...
@@ -4288,38 +4288,38 @@ static void load_numbered_arrays(struct wined3d_context *context,
DWORD
c
=
*
src
&
0xff00ff00
;
c
|=
(
*
src
&
0xff0000
)
>>
16
;
c
|=
(
*
src
&
0xff
)
<<
16
;
GL_EXTCALL
(
glVertexAttrib4Nubv
ARB
(
i
,
(
GLubyte
*
)
&
c
));
GL_EXTCALL
(
glVertexAttrib4Nubv
(
i
,
(
GLubyte
*
)
&
c
));
break
;
}
/* else fallthrough */
case
WINED3DFMT_R8G8B8A8_UNORM
:
GL_EXTCALL
(
glVertexAttrib4Nubv
ARB
(
i
,
ptr
));
GL_EXTCALL
(
glVertexAttrib4Nubv
(
i
,
ptr
));
break
;
case
WINED3DFMT_R16G16_SINT
:
GL_EXTCALL
(
glVertexAttrib2sv
ARB
(
i
,
(
const
GLshort
*
)
ptr
));
GL_EXTCALL
(
glVertexAttrib2sv
(
i
,
(
const
GLshort
*
)
ptr
));
break
;
case
WINED3DFMT_R16G16B16A16_SINT
:
GL_EXTCALL
(
glVertexAttrib4sv
ARB
(
i
,
(
const
GLshort
*
)
ptr
));
GL_EXTCALL
(
glVertexAttrib4sv
(
i
,
(
const
GLshort
*
)
ptr
));
break
;
case
WINED3DFMT_R16G16_SNORM
:
{
const
GLshort
s
[
4
]
=
{((
const
GLshort
*
)
ptr
)[
0
],
((
const
GLshort
*
)
ptr
)[
1
],
0
,
1
};
GL_EXTCALL
(
glVertexAttrib4Nsv
ARB
(
i
,
s
));
GL_EXTCALL
(
glVertexAttrib4Nsv
(
i
,
s
));
break
;
}
case
WINED3DFMT_R16G16_UNORM
:
{
const
GLushort
s
[
4
]
=
{((
const
GLushort
*
)
ptr
)[
0
],
((
const
GLushort
*
)
ptr
)[
1
],
0
,
1
};
GL_EXTCALL
(
glVertexAttrib4Nusv
ARB
(
i
,
s
));
GL_EXTCALL
(
glVertexAttrib4Nusv
(
i
,
s
));
break
;
}
case
WINED3DFMT_R16G16B16A16_SNORM
:
GL_EXTCALL
(
glVertexAttrib4Nsv
ARB
(
i
,
(
const
GLshort
*
)
ptr
));
GL_EXTCALL
(
glVertexAttrib4Nsv
(
i
,
(
const
GLshort
*
)
ptr
));
break
;
case
WINED3DFMT_R16G16B16A16_UNORM
:
GL_EXTCALL
(
glVertexAttrib4Nusv
ARB
(
i
,
(
const
GLushort
*
)
ptr
));
GL_EXTCALL
(
glVertexAttrib4Nusv
(
i
,
(
const
GLushort
*
)
ptr
));
break
;
case
WINED3DFMT_R10G10B10A2_UINT
:
...
...
@@ -4341,7 +4341,7 @@ static void load_numbered_arrays(struct wined3d_context *context,
{
float
x
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
0
);
float
y
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
1
);
GL_EXTCALL
(
glVertexAttrib2f
ARB
(
i
,
x
,
y
));
GL_EXTCALL
(
glVertexAttrib2f
(
i
,
x
,
y
));
}
break
;
case
WINED3DFMT_R16G16B16A16_FLOAT
:
...
...
@@ -4356,7 +4356,7 @@ static void load_numbered_arrays(struct wined3d_context *context,
float
y
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
1
);
float
z
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
2
);
float
w
=
float_16_to_32
(((
const
unsigned
short
*
)
ptr
)
+
3
);
GL_EXTCALL
(
glVertexAttrib4f
ARB
(
i
,
x
,
y
,
z
,
w
));
GL_EXTCALL
(
glVertexAttrib4f
(
i
,
x
,
y
,
z
,
w
));
}
break
;
...
...
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