Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Show more breadcrumbs
many-archive
Suyu
Commits
fed773a8
There was an error fetching the commit references. Please try again later.
Commit
fed773a8
authored
5 years ago
by
Fernando Sahmkow
Committed by
ReinUsesLisp
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
texture_cache: Implement Irregular Views in surfaces
parent
082740d3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/video_core/texture_cache/surface_base.cpp
+3
-0
3 additions, 0 deletions
src/video_core/texture_cache/surface_base.cpp
src/video_core/texture_cache/surface_base.h
+21
-4
21 additions, 4 deletions
src/video_core/texture_cache/surface_base.h
with
24 additions
and
4 deletions
src/video_core/texture_cache/surface_base.cpp
+
3
−
0
View file @
fed773a8
...
...
@@ -100,6 +100,9 @@ MatchStructureResult SurfaceBaseImpl::MatchesStructure(const SurfaceParams& rhs)
std
::
optional
<
std
::
pair
<
u32
,
u32
>>
SurfaceBaseImpl
::
GetLayerMipmap
(
const
GPUVAddr
candidate_gpu_addr
)
const
{
if
(
gpu_addr
==
candidate_gpu_addr
)
{
return
{{
0
,
0
}};
}
if
(
candidate_gpu_addr
<
gpu_addr
)
{
return
{};
}
...
...
This diff is collapsed.
Click to expand it.
src/video_core/texture_cache/surface_base.h
+
21
−
4
View file @
fed773a8
...
...
@@ -238,6 +238,26 @@ public:
return
GetView
(
ViewParams
(
overview_params
.
target
,
0
,
num_layers
,
0
,
params
.
num_levels
));
}
std
::
optional
<
TView
>
EmplaceIrregularView
(
const
SurfaceParams
&
view_params
,
const
GPUVAddr
view_addr
,
const
std
::
size_t
candidate_size
,
const
u32
mipmap
,
const
u32
layer
)
{
const
auto
layer_mipmap
{
GetLayerMipmap
(
view_addr
+
candidate_size
)};
if
(
!
layer_mipmap
)
{
return
{};
}
const
u32
end_layer
{
layer_mipmap
->
first
};
const
u32
end_mipmap
{
layer_mipmap
->
second
};
if
(
layer
!=
end_layer
)
{
if
(
mipmap
==
0
&&
end_mipmap
==
0
)
{
return
GetView
(
ViewParams
(
view_params
.
target
,
layer
,
end_layer
-
layer
+
1
,
0
,
1
));
}
return
{};
}
else
{
return
GetView
(
ViewParams
(
view_params
.
target
,
layer
,
1
,
mipmap
,
end_mipmap
-
mipmap
+
1
));
}
}
std
::
optional
<
TView
>
EmplaceView
(
const
SurfaceParams
&
view_params
,
const
GPUVAddr
view_addr
,
const
std
::
size_t
candidate_size
)
{
if
(
params
.
target
==
SurfaceTarget
::
Texture3D
||
...
...
@@ -252,10 +272,7 @@ public:
const
u32
layer
{
layer_mipmap
->
first
};
const
u32
mipmap
{
layer_mipmap
->
second
};
if
(
GetMipmapSize
(
mipmap
)
!=
candidate_size
)
{
// TODO: The view may cover many mimaps, this case can still go on.
// This edge-case can be safely be ignored since it will just result in worse
// performance.
return
{};
return
EmplaceIrregularView
(
view_params
,
view_addr
,
candidate_size
,
mipmap
,
layer
);
}
return
GetView
(
ViewParams
(
view_params
.
target
,
layer
,
1
,
mipmap
,
1
));
}
...
...
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