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
1bd98719
Commit
1bd98719
authored
Dec 28, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Set WINED3D_BUFFER_CREATEBO in buffer_init().
parent
b9976c3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
24 deletions
+27
-24
buffer.c
dlls/wined3d/buffer.c
+25
-0
device.c
dlls/wined3d/device.c
+2
-24
No files found.
dlls/wined3d/buffer.c
View file @
1bd98719
...
...
@@ -1098,6 +1098,7 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
{
const
struct
GlPixelFormatDesc
*
format_desc
=
getFormatDescEntry
(
format
,
&
device
->
adapter
->
gl_info
);
HRESULT
hr
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
if
(
!
size
)
{
...
...
@@ -1119,6 +1120,30 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
TRACE
(
"size %#x, usage %#x, format %s, memory @ %p, iface @ %p.
\n
"
,
buffer
->
resource
.
size
,
buffer
->
resource
.
usage
,
debug_d3dformat
(
buffer
->
resource
.
format_desc
->
format
),
buffer
->
resource
.
allocatedMemory
,
buffer
);
/* Observations show that drawStridedSlow is faster on dynamic VBs than converting +
* drawStridedFast (half-life 2 and others).
*
* Basically converting the vertices in the buffer is quite expensive, and observations
* show that drawStridedSlow is faster than converting + uploading + drawStridedFast.
* Therefore do not create a VBO for WINED3DUSAGE_DYNAMIC buffers.
*/
if
(
!
gl_info
->
supported
[
ARB_VERTEX_BUFFER_OBJECT
])
{
TRACE
(
"Not creating a vbo because GL_ARB_vertex_buffer is not supported
\n
"
);
}
else
if
(
buffer
->
resource
.
pool
==
WINED3DPOOL_SYSTEMMEM
)
{
TRACE
(
"Not creating a vbo because the vertex buffer is in system memory
\n
"
);
}
else
if
(
buffer
->
resource
.
usage
&
WINED3DUSAGE_DYNAMIC
)
{
TRACE
(
"Not creating a vbo because the buffer has dynamic usage
\n
"
);
}
else
{
buffer
->
flags
|=
WINED3D_BUFFER_CREATEBO
;
}
if
(
data
)
{
BYTE
*
ptr
;
...
...
dlls/wined3d/device.c
View file @
1bd98719
...
...
@@ -520,23 +520,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac
TRACE
(
"Created buffer %p.
\n
"
,
object
);
*
ppVertexBuffer
=
(
IWineD3DBuffer
*
)
object
;
/* Observations show that drawStridedSlow is faster on dynamic VBs than converting +
* drawStridedFast (half-life 2).
*
* Basically converting the vertices in the buffer is quite expensive, and observations
* show that drawStridedSlow is faster than converting + uploading + drawStridedFast.
* Therefore do not create a VBO for WINED3DUSAGE_DYNAMIC buffers.
*/
if
(
!
This
->
adapter
->
gl_info
.
supported
[
ARB_VERTEX_BUFFER_OBJECT
])
{
TRACE
(
"Not creating a vbo because GL_ARB_vertex_buffer is not supported
\n
"
);
}
else
if
(
Pool
==
WINED3DPOOL_SYSTEMMEM
)
{
TRACE
(
"Not creating a vbo because the vertex buffer is in system memory
\n
"
);
}
else
if
(
Usage
&
WINED3DUSAGE_DYNAMIC
)
{
TRACE
(
"Not creating a vbo because the buffer has dynamic usage
\n
"
);
}
else
{
object
->
flags
|=
WINED3D_BUFFER_CREATEBO
;
}
return
WINED3D_OK
;
}
...
...
@@ -560,7 +543,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface
}
hr
=
buffer_init
(
object
,
This
,
Length
,
Usage
|
WINED3DUSAGE_STATICDECL
,
WINED3DFMT_UNKNOWN
,
Pool
,
GL_ELEMENT_ARRAY_BUFFER_ARB
,
NULL
,
parent
,
parent_ops
);
WINED3DFMT_UNKNOWN
,
Pool
,
GL_ELEMENT_ARRAY_BUFFER_ARB
,
NULL
,
parent
,
parent_ops
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize buffer, hr %#x
\n
"
,
hr
);
...
...
@@ -570,12 +554,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface
TRACE
(
"Created buffer %p.
\n
"
,
object
);
if
(
Pool
!=
WINED3DPOOL_SYSTEMMEM
&&
!
(
Usage
&
WINED3DUSAGE_DYNAMIC
)
&&
This
->
adapter
->
gl_info
.
supported
[
ARB_VERTEX_BUFFER_OBJECT
])
{
object
->
flags
|=
WINED3D_BUFFER_CREATEBO
;
}
*
ppIndexBuffer
=
(
IWineD3DBuffer
*
)
object
;
return
WINED3D_OK
;
...
...
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