Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rafael Antognolli
mesa
Commits
be7adc2e
Commit
be7adc2e
authored
Jul 16, 2015
by
Emma Anholt
Browse files
vc4: Also consider uniform 0 in uniform lowering.
The hash table considers key 0 to be the empty key.
parent
90dfabc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/gallium/drivers/vc4/vc4_qir_lower_uniforms.c
View file @
be7adc2e
...
@@ -52,7 +52,7 @@ static void
...
@@ -52,7 +52,7 @@ static void
add_uniform
(
struct
hash_table
*
ht
,
struct
qreg
reg
)
add_uniform
(
struct
hash_table
*
ht
,
struct
qreg
reg
)
{
{
struct
hash_entry
*
entry
;
struct
hash_entry
*
entry
;
void
*
key
=
(
void
*
)(
uintptr_t
)
reg
.
index
;
void
*
key
=
(
void
*
)(
uintptr_t
)
(
reg
.
index
+
1
)
;
entry
=
_mesa_hash_table_search
(
ht
,
key
);
entry
=
_mesa_hash_table_search
(
ht
,
key
);
if
(
entry
)
{
if
(
entry
)
{
...
@@ -66,7 +66,7 @@ static void
...
@@ -66,7 +66,7 @@ static void
remove_uniform
(
struct
hash_table
*
ht
,
struct
qreg
reg
)
remove_uniform
(
struct
hash_table
*
ht
,
struct
qreg
reg
)
{
{
struct
hash_entry
*
entry
;
struct
hash_entry
*
entry
;
void
*
key
=
(
void
*
)(
uintptr_t
)
reg
.
index
;
void
*
key
=
(
void
*
)(
uintptr_t
)
(
reg
.
index
+
1
)
;
entry
=
_mesa_hash_table_search
(
ht
,
key
);
entry
=
_mesa_hash_table_search
(
ht
,
key
);
assert
(
entry
);
assert
(
entry
);
...
@@ -122,7 +122,7 @@ qir_lower_uniforms(struct vc4_compile *c)
...
@@ -122,7 +122,7 @@ qir_lower_uniforms(struct vc4_compile *c)
struct
hash_entry
*
entry
;
struct
hash_entry
*
entry
;
hash_table_foreach
(
ht
,
entry
)
{
hash_table_foreach
(
ht
,
entry
)
{
uint32_t
count
=
(
uintptr_t
)
entry
->
data
;
uint32_t
count
=
(
uintptr_t
)
entry
->
data
;
uint32_t
index
=
(
uintptr_t
)
entry
->
key
;
uint32_t
index
=
(
uintptr_t
)
entry
->
key
-
1
;
if
(
count
>
max_count
)
{
if
(
count
>
max_count
)
{
max_count
=
count
;
max_count
=
count
;
max_index
=
index
;
max_index
=
index
;
...
...
Write
Preview
Supports
Markdown
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