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
8b8e081d
Commit
8b8e081d
authored
Aug 23, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Keep track of contained indices in struct constant_heap itself.
parent
74faebd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
glsl_shader.c
dlls/wined3d/glsl_shader.c
+21
-13
No files found.
dlls/wined3d/glsl_shader.c
View file @
8b8e081d
...
@@ -84,6 +84,7 @@ struct constant_entry
...
@@ -84,6 +84,7 @@ struct constant_entry
struct
constant_heap
struct
constant_heap
{
{
struct
constant_entry
*
entries
;
struct
constant_entry
*
entries
;
BOOL
*
contained
;
unsigned
int
*
positions
;
unsigned
int
*
positions
;
unsigned
int
size
;
unsigned
int
size
;
};
};
...
@@ -932,12 +933,21 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
...
@@ -932,12 +933,21 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
}
}
}
}
static
void
update_heap_entry
(
const
struct
constant_heap
*
heap
,
unsigned
int
idx
,
static
void
update_heap_entry
(
struct
constant_heap
*
heap
,
unsigned
int
idx
,
DWORD
new_version
)
unsigned
int
heap_idx
,
DWORD
new_version
)
{
{
struct
constant_entry
*
entries
=
heap
->
entries
;
struct
constant_entry
*
entries
=
heap
->
entries
;
unsigned
int
*
positions
=
heap
->
positions
;
unsigned
int
*
positions
=
heap
->
positions
;
unsigned
int
parent_idx
;
unsigned
int
heap_idx
,
parent_idx
;
if
(
!
heap
->
contained
[
idx
])
{
heap_idx
=
heap
->
size
++
;
heap
->
contained
[
idx
]
=
TRUE
;
}
else
{
heap_idx
=
positions
[
idx
];
}
while
(
heap_idx
>
1
)
while
(
heap_idx
>
1
)
{
{
...
@@ -963,10 +973,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
...
@@ -963,10 +973,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
for
(
i
=
start
;
i
<
count
+
start
;
++
i
)
for
(
i
=
start
;
i
<
count
+
start
;
++
i
)
{
{
if
(
!
device
->
stateBlock
->
changed
.
vertexShaderConstantsF
[
i
])
update_heap_entry
(
heap
,
i
,
priv
->
next_constant_version
);
update_heap_entry
(
heap
,
i
,
heap
->
size
++
,
priv
->
next_constant_version
);
else
update_heap_entry
(
heap
,
i
,
heap
->
positions
[
i
],
priv
->
next_constant_version
);
}
}
for
(
i
=
0
;
i
<
device
->
context_count
;
++
i
)
for
(
i
=
0
;
i
<
device
->
context_count
;
++
i
)
...
@@ -983,10 +990,7 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi
...
@@ -983,10 +990,7 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi
for
(
i
=
start
;
i
<
count
+
start
;
++
i
)
for
(
i
=
start
;
i
<
count
+
start
;
++
i
)
{
{
if
(
!
device
->
stateBlock
->
changed
.
pixelShaderConstantsF
[
i
])
update_heap_entry
(
heap
,
i
,
priv
->
next_constant_version
);
update_heap_entry
(
heap
,
i
,
heap
->
size
++
,
priv
->
next_constant_version
);
else
update_heap_entry
(
heap
,
i
,
heap
->
positions
[
i
],
priv
->
next_constant_version
);
}
}
for
(
i
=
0
;
i
<
device
->
context_count
;
++
i
)
for
(
i
=
0
;
i
<
device
->
context_count
;
++
i
)
...
@@ -6475,7 +6479,9 @@ static int glsl_program_key_compare(const void *key, const struct wine_rb_entry
...
@@ -6475,7 +6479,9 @@ static int glsl_program_key_compare(const void *key, const struct wine_rb_entry
static
BOOL
constant_heap_init
(
struct
constant_heap
*
heap
,
unsigned
int
constant_count
)
static
BOOL
constant_heap_init
(
struct
constant_heap
*
heap
,
unsigned
int
constant_count
)
{
{
SIZE_T
size
=
(
constant_count
+
1
)
*
sizeof
(
*
heap
->
entries
)
+
constant_count
*
sizeof
(
*
heap
->
positions
);
SIZE_T
size
=
(
constant_count
+
1
)
*
sizeof
(
*
heap
->
entries
)
+
constant_count
*
sizeof
(
*
heap
->
contained
)
+
constant_count
*
sizeof
(
*
heap
->
positions
);
void
*
mem
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
void
*
mem
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
mem
)
if
(
!
mem
)
...
@@ -6486,7 +6492,9 @@ static BOOL constant_heap_init(struct constant_heap *heap, unsigned int constant
...
@@ -6486,7 +6492,9 @@ static BOOL constant_heap_init(struct constant_heap *heap, unsigned int constant
heap
->
entries
=
mem
;
heap
->
entries
=
mem
;
heap
->
entries
[
1
].
version
=
0
;
heap
->
entries
[
1
].
version
=
0
;
heap
->
positions
=
(
unsigned
int
*
)(
heap
->
entries
+
constant_count
+
1
);
heap
->
contained
=
(
BOOL
*
)(
heap
->
entries
+
constant_count
+
1
);
memset
(
heap
->
contained
,
0
,
constant_count
*
sizeof
(
*
heap
->
contained
));
heap
->
positions
=
(
unsigned
int
*
)(
heap
->
contained
+
constant_count
);
heap
->
size
=
1
;
heap
->
size
=
1
;
return
TRUE
;
return
TRUE
;
...
...
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