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
a3538a15
Commit
a3538a15
authored
Jul 11, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store VBO addresses in a struct wined3d_bo_address in…
wined3d: Store VBO addresses in a struct wined3d_bo_address in device_stream_info_from_declaration().
parent
abfd6b47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
device.c
dlls/wined3d/device.c
+16
-13
No files found.
dlls/wined3d/device.c
View file @
a3538a15
...
@@ -190,8 +190,7 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
...
@@ -190,8 +190,7 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
{
{
const
struct
wined3d_vertex_declaration_element
*
element
=
&
declaration
->
elements
[
i
];
const
struct
wined3d_vertex_declaration_element
*
element
=
&
declaration
->
elements
[
i
];
struct
wined3d_buffer
*
buffer
=
device
->
stateBlock
->
state
.
streams
[
element
->
input_slot
].
buffer
;
struct
wined3d_buffer
*
buffer
=
device
->
stateBlock
->
state
.
streams
[
element
->
input_slot
].
buffer
;
GLuint
buffer_object
=
0
;
struct
wined3d_bo_address
data
;
const
BYTE
*
data
=
NULL
;
BOOL
stride_used
;
BOOL
stride_used
;
unsigned
int
idx
;
unsigned
int
idx
;
DWORD
stride
;
DWORD
stride
;
...
@@ -201,17 +200,20 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
...
@@ -201,17 +200,20 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
if
(
!
buffer
)
continue
;
if
(
!
buffer
)
continue
;
data
.
buffer_object
=
0
;
data
.
addr
=
NULL
;
stride
=
device
->
stateBlock
->
state
.
streams
[
element
->
input_slot
].
stride
;
stride
=
device
->
stateBlock
->
state
.
streams
[
element
->
input_slot
].
stride
;
if
(
device
->
stateBlock
->
state
.
user_stream
)
if
(
device
->
stateBlock
->
state
.
user_stream
)
{
{
TRACE
(
"Stream %u is UP, %p
\n
"
,
element
->
input_slot
,
buffer
);
TRACE
(
"Stream %u is UP, %p
\n
"
,
element
->
input_slot
,
buffer
);
buffer_object
=
0
;
data
.
buffer_object
=
0
;
data
=
(
BYTE
*
)
buffer
;
data
.
addr
=
(
BYTE
*
)
buffer
;
}
}
else
else
{
{
TRACE
(
"Stream %u isn't UP, %p
\n
"
,
element
->
input_slot
,
buffer
);
TRACE
(
"Stream %u isn't UP, %p
\n
"
,
element
->
input_slot
,
buffer
);
data
=
buffer_get_memory
(
buffer
,
&
device
->
adapter
->
gl_info
,
&
buffer_object
);
data
.
addr
=
buffer_get_memory
(
buffer
,
&
device
->
adapter
->
gl_info
,
&
data
.
buffer_object
);
/* Can't use vbo's if the base vertex index is negative. OpenGL doesn't accept negative offsets
/* Can't use vbo's if the base vertex index is negative. OpenGL doesn't accept negative offsets
* (or rather offsets bigger than the vbo, because the pointer is unsigned), so use system memory
* (or rather offsets bigger than the vbo, because the pointer is unsigned), so use system memory
...
@@ -222,9 +224,9 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
...
@@ -222,9 +224,9 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
{
{
WARN
(
"load_base_vertex_index is < 0 (%d), not using VBOs.
\n
"
,
WARN
(
"load_base_vertex_index is < 0 (%d), not using VBOs.
\n
"
,
device
->
stateBlock
->
state
.
load_base_vertex_index
);
device
->
stateBlock
->
state
.
load_base_vertex_index
);
buffer_object
=
0
;
data
.
buffer_object
=
0
;
data
=
buffer_get_sysmem
(
buffer
,
&
device
->
adapter
->
gl_info
);
data
.
addr
=
buffer_get_sysmem
(
buffer
,
&
device
->
adapter
->
gl_info
);
if
((
UINT_PTR
)
data
<
-
device
->
stateBlock
->
state
.
load_base_vertex_index
*
stride
)
if
((
UINT_PTR
)
data
.
addr
<
-
device
->
stateBlock
->
state
.
load_base_vertex_index
*
stride
)
{
{
FIXME
(
"System memory vertex data load offset is negative!
\n
"
);
FIXME
(
"System memory vertex data load offset is negative!
\n
"
);
}
}
...
@@ -232,7 +234,8 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
...
@@ -232,7 +234,8 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
if
(
fixup
)
if
(
fixup
)
{
{
if
(
buffer_object
)
*
fixup
=
TRUE
;
if
(
data
.
buffer_object
)
*
fixup
=
TRUE
;
else
if
(
*
fixup
&&
!
use_vshader
else
if
(
*
fixup
&&
!
use_vshader
&&
(
element
->
usage
==
WINED3DDECLUSAGE_COLOR
&&
(
element
->
usage
==
WINED3DDECLUSAGE_COLOR
||
element
->
usage
==
WINED3DDECLUSAGE_POSITIONT
))
||
element
->
usage
==
WINED3DDECLUSAGE_POSITIONT
))
...
@@ -247,7 +250,7 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
...
@@ -247,7 +250,7 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
}
}
}
}
}
}
data
+=
element
->
offset
;
data
.
addr
+=
element
->
offset
;
TRACE
(
"offset %u input_slot %u usage_idx %d
\n
"
,
element
->
offset
,
element
->
input_slot
,
element
->
usage_idx
);
TRACE
(
"offset %u input_slot %u usage_idx %d
\n
"
,
element
->
offset
,
element
->
input_slot
,
element
->
usage_idx
);
...
@@ -287,13 +290,13 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
...
@@ -287,13 +290,13 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
"input_slot %u, offset %u, stride %u, format %s, buffer_object %u]
\n
"
,
"input_slot %u, offset %u, stride %u, format %s, buffer_object %u]
\n
"
,
use_vshader
?
"shader"
:
"fixed function"
,
idx
,
use_vshader
?
"shader"
:
"fixed function"
,
idx
,
debug_d3ddeclusage
(
element
->
usage
),
element
->
usage_idx
,
element
->
input_slot
,
debug_d3ddeclusage
(
element
->
usage
),
element
->
usage_idx
,
element
->
input_slot
,
element
->
offset
,
stride
,
debug_d3dformat
(
element
->
format
->
id
),
buffer_object
);
element
->
offset
,
stride
,
debug_d3dformat
(
element
->
format
->
id
),
data
.
buffer_object
);
stream_info
->
elements
[
idx
].
format
=
element
->
format
;
stream_info
->
elements
[
idx
].
format
=
element
->
format
;
stream_info
->
elements
[
idx
].
stride
=
stride
;
stream_info
->
elements
[
idx
].
stride
=
stride
;
stream_info
->
elements
[
idx
].
data
=
data
;
stream_info
->
elements
[
idx
].
data
=
data
.
addr
;
stream_info
->
elements
[
idx
].
stream_idx
=
element
->
input_slot
;
stream_info
->
elements
[
idx
].
stream_idx
=
element
->
input_slot
;
stream_info
->
elements
[
idx
].
buffer_object
=
buffer_object
;
stream_info
->
elements
[
idx
].
buffer_object
=
data
.
buffer_object
;
if
(
!
device
->
adapter
->
gl_info
.
supported
[
ARB_VERTEX_ARRAY_BGRA
]
if
(
!
device
->
adapter
->
gl_info
.
supported
[
ARB_VERTEX_ARRAY_BGRA
]
&&
element
->
format
->
id
==
WINED3DFMT_B8G8R8A8_UNORM
)
&&
element
->
format
->
id
==
WINED3DFMT_B8G8R8A8_UNORM
)
...
...
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