Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
280c92b7
Commit
280c92b7
authored
2 years ago
by
David Parks
Browse files
Options
Downloads
Patches
Plain Diff
SL-18154 Followup -- Use Henri's xxHash integration to speed up UI Vertex Buffer cache
parent
8e0e61ed
No related branches found
Branches containing commit
No related tags found
2 merge requests
!3
Update to main branch
,
!2
Rebase onto current main branch
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llrender/llrender.cpp
+7
-7
7 additions, 7 deletions
indra/llrender/llrender.cpp
with
7 additions
and
7 deletions
indra/llrender/llrender.cpp
+
7
−
7
View file @
280c92b7
...
...
@@ -35,7 +35,7 @@
#include
"llrendertarget.h"
#include
"lltexture.h"
#include
"llshadermgr.h"
#include
"
llmd5
.h"
#include
"
hbxxh
.h"
#if LL_WINDOWS
extern
void
APIENTRY
gl_debug_callback
(
GLenum
source
,
...
...
@@ -79,7 +79,7 @@ struct LLVBCache
std
::
chrono
::
steady_clock
::
time_point
touched
;
};
static
std
::
unordered_map
<
std
::
size_t
,
LLVBCache
>
sVBCache
;
static
std
::
unordered_map
<
U64
,
LLVBCache
>
sVBCache
;
static
const
GLenum
sGLTextureType
[]
=
{
...
...
@@ -1640,7 +1640,7 @@ void LLRender::flush()
if
(
mBuffer
)
{
LLMD5
hash
;
HBXXH64
hash
;
U32
attribute_mask
=
LLGLSLShader
::
sCurBoundShaderPtr
->
mAttributeMask
;
{
...
...
@@ -1660,8 +1660,8 @@ void LLRender::flush()
hash
.
finalize
();
}
size_t
vhash
[
2
];
hash
.
raw_
digest
(
(
unsigned
char
*
)
vhash
);
U64
vhash
=
hash
.
digest
();
// check the VB cache before making a new vertex buffer
// This is a giant hack to deal with (mostly) our terrible UI rendering code
...
...
@@ -1672,7 +1672,7 @@ void LLRender::flush()
// To leverage this, we maintain a running hash of the vertex stream being
// built up before a flush, and then check that hash against a VB
// cache just before creating a vertex buffer in VRAM
std
::
unordered_map
<
std
::
size_t
,
LLVBCache
>::
iterator
cache
=
sVBCache
.
find
(
vhash
[
0
]
);
std
::
unordered_map
<
U64
,
LLVBCache
>::
iterator
cache
=
sVBCache
.
find
(
vhash
);
LLPointer
<
LLVertexBuffer
>
vb
;
...
...
@@ -1705,7 +1705,7 @@ void LLRender::flush()
vb
->
unbind
();
sVBCache
[
vhash
[
0
]
]
=
{
vb
,
std
::
chrono
::
steady_clock
::
now
()
};
sVBCache
[
vhash
]
=
{
vb
,
std
::
chrono
::
steady_clock
::
now
()
};
static
U32
miss_count
=
0
;
miss_count
++
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment