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
543e1739
Commit
543e1739
authored
1 year ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Add shader cache checkbox to develop graphics menu
parent
16ef36f1
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
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/llrender/llshadermgr.cpp
+5
-5
5 additions, 5 deletions
indra/llrender/llshadermgr.cpp
indra/llrender/llshadermgr.h
+1
-0
1 addition, 0 deletions
indra/llrender/llshadermgr.h
indra/newview/skins/default/xui/en/menu_viewer.xml
+17
-9
17 additions, 9 deletions
indra/newview/skins/default/xui/en/menu_viewer.xml
with
23 additions
and
14 deletions
indra/llrender/llshadermgr.cpp
+
5
−
5
View file @
543e1739
...
@@ -1094,11 +1094,11 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version,
...
@@ -1094,11 +1094,11 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version,
mShaderCacheInitialized
=
true
;
mShaderCacheInitialized
=
true
;
std
::
string
s
hader
_c
ache
_d
ir
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_CACHE
,
"shader_cache"
);
mS
hader
C
ache
D
ir
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_CACHE
,
"shader_cache"
);
LLFile
::
mkdir
(
s
hader
_c
ache
_d
ir
);
LLFile
::
mkdir
(
mS
hader
C
ache
D
ir
);
{
{
std
::
string
meta_out_path
=
gDirUtilp
->
add
(
s
hader
_c
ache
_d
ir
,
"shaderdata.llsd"
);
std
::
string
meta_out_path
=
gDirUtilp
->
add
(
mS
hader
C
ache
D
ir
,
"shaderdata.llsd"
);
if
(
gDirUtilp
->
fileExists
(
meta_out_path
))
if
(
gDirUtilp
->
fileExists
(
meta_out_path
))
{
{
LL_INFOS
()
<<
"Loading shader metadata"
<<
LL_ENDL
;
LL_INFOS
()
<<
"Loading shader metadata"
<<
LL_ENDL
;
...
@@ -1167,7 +1167,7 @@ bool LLShaderMgr::loadCachedProgramBinary(LLGLSLShader* shader)
...
@@ -1167,7 +1167,7 @@ bool LLShaderMgr::loadCachedProgramBinary(LLGLSLShader* shader)
std
::
vector
<
U8
>
in_data
;
std
::
vector
<
U8
>
in_data
;
in_data
.
resize
(
shader_info
.
mBinaryLength
);
in_data
.
resize
(
shader_info
.
mBinaryLength
);
std
::
string
in_path
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_CACHE
,
"s
hader
_c
ache
"
,
shader
->
mShaderHash
.
asString
()
+
".shaderbin"
);
std
::
string
in_path
=
gDirUtilp
->
add
(
mS
hader
C
ache
Dir
,
shader
->
mShaderHash
.
asString
()
+
".shaderbin"
);
LLUniqueFile
filep
=
LLFile
::
fopen
(
in_path
,
"rb"
);
LLUniqueFile
filep
=
LLFile
::
fopen
(
in_path
,
"rb"
);
if
(
filep
)
if
(
filep
)
{
{
...
@@ -1203,7 +1203,7 @@ bool LLShaderMgr::saveCachedProgramBinary(LLGLSLShader* shader)
...
@@ -1203,7 +1203,7 @@ bool LLShaderMgr::saveCachedProgramBinary(LLGLSLShader* shader)
glGetProgramBinary
(
shader
->
mProgramObject
,
program_binary
.
size
()
*
sizeof
(
U8
),
nullptr
,
&
binary_info
.
mBinaryFormat
,
program_binary
.
data
());
glGetProgramBinary
(
shader
->
mProgramObject
,
program_binary
.
size
()
*
sizeof
(
U8
),
nullptr
,
&
binary_info
.
mBinaryFormat
,
program_binary
.
data
());
std
::
string
out_path
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_CACHE
,
"s
hader
_c
ache
"
,
shader
->
mShaderHash
.
asString
()
+
".shaderbin"
);
std
::
string
out_path
=
gDirUtilp
->
add
(
mS
hader
C
ache
Dir
,
shader
->
mShaderHash
.
asString
()
+
".shaderbin"
);
LLUniqueFile
outfile
=
LLFile
::
fopen
(
out_path
,
"wb"
);
LLUniqueFile
outfile
=
LLFile
::
fopen
(
out_path
,
"wb"
);
if
(
outfile
)
if
(
outfile
)
{
{
...
...
This diff is collapsed.
Click to expand it.
indra/llrender/llshadermgr.h
+
1
−
0
View file @
543e1739
...
@@ -338,6 +338,7 @@ class LLShaderMgr
...
@@ -338,6 +338,7 @@ class LLShaderMgr
boost
::
unordered_map
<
LLUUID
,
ProgramBinaryData
>
mShaderBinaryCache
;
boost
::
unordered_map
<
LLUUID
,
ProgramBinaryData
>
mShaderBinaryCache
;
bool
mShaderCacheInitialized
=
false
;
bool
mShaderCacheInitialized
=
false
;
bool
mShaderCacheEnabled
=
false
;
bool
mShaderCacheEnabled
=
false
;
std
::
string
mShaderCacheDir
;
protected
:
protected
:
...
...
This diff is collapsed.
Click to expand it.
indra/newview/skins/default/xui/en/menu_viewer.xml
+
17
−
9
View file @
543e1739
...
@@ -3689,23 +3689,31 @@ function="World.EnvPreset"
...
@@ -3689,23 +3689,31 @@ function="World.EnvPreset"
parameter=
"RenderAttachedParticles"
/>
parameter=
"RenderAttachedParticles"
/>
</menu_item_check>
</menu_item_check>
<menu_item_separator
/>
<menu_item_separator
/>
<menu_item_check
label=
"Enable Shader Cache"
name=
"Enable Shader Cache"
>
<menu_item_check.on_check
function=
"CheckControl"
parameter=
"RenderShaderCacheEnabled"
/>
<menu_item_check.on_click
function=
"ToggleShaderControl"
parameter=
"RenderShaderCacheEnabled"
/>
</menu_item_check>
<menu_item_call
<menu_item_call
enabled=
"true"
enabled=
"true"
label=
"Clear
Cache Immediately
"
label=
"Clear
Shader Cache
"
name=
"Cache Clear"
>
name=
"
Shader
Cache Clear"
>
<menu_item_call.on_click
<menu_item_call.on_click
function=
"
Develop.Clea
rCache"
/>
function=
"
Advanced.ClearShade
rCache"
/>
</menu_item_call>
</menu_item_call>
<menu_item_separator
/>
<menu_item_call
<menu_item_call
enabled=
"true"
enabled=
"true"
label=
"Clear
Shader Cache
"
label=
"Clear
Cache Immediately
"
name=
"
Shader
Cache Clear"
>
name=
"Cache Clear"
>
<menu_item_call.on_click
<menu_item_call.on_click
function=
"
Advanced.ClearShade
rCache"
/>
function=
"
Develop.Clea
rCache"
/>
</menu_item_call>
</menu_item_call>
</menu>
</menu>
<menu
<menu
...
...
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