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
0f7b813d
There was an error fetching the commit references. Please try again later.
Commit
0f7b813d
authored
5 years ago
by
ReinUsesLisp
Browse files
Options
Downloads
Patches
Plain Diff
gl_shader_decompiler: Implement shared memory
parent
4de04eba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+23
-0
23 additions, 0 deletions
src/video_core/renderer_opengl/gl_shader_decompiler.cpp
with
23 additions
and
0 deletions
src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+
23
−
0
View file @
0f7b813d
...
@@ -325,6 +325,7 @@ public:
...
@@ -325,6 +325,7 @@ public:
DeclareRegisters
();
DeclareRegisters
();
DeclarePredicates
();
DeclarePredicates
();
DeclareLocalMemory
();
DeclareLocalMemory
();
DeclareSharedMemory
();
DeclareInternalFlags
();
DeclareInternalFlags
();
DeclareInputAttributes
();
DeclareInputAttributes
();
DeclareOutputAttributes
();
DeclareOutputAttributes
();
...
@@ -500,6 +501,13 @@ private:
...
@@ -500,6 +501,13 @@ private:
code
.
AddNewLine
();
code
.
AddNewLine
();
}
}
void
DeclareSharedMemory
()
{
if
(
stage
!=
ProgramType
::
Compute
)
{
return
;
}
code
.
AddLine
(
"shared uint {}[];"
,
GetSharedMemory
());
}
void
DeclareInternalFlags
()
{
void
DeclareInternalFlags
()
{
for
(
u32
flag
=
0
;
flag
<
static_cast
<
u32
>
(
InternalFlag
::
Amount
);
flag
++
)
{
for
(
u32
flag
=
0
;
flag
<
static_cast
<
u32
>
(
InternalFlag
::
Amount
);
flag
++
)
{
const
auto
flag_code
=
static_cast
<
InternalFlag
>
(
flag
);
const
auto
flag_code
=
static_cast
<
InternalFlag
>
(
flag
);
...
@@ -858,6 +866,12 @@ private:
...
@@ -858,6 +866,12 @@ private:
Type
::
Uint
};
Type
::
Uint
};
}
}
if
(
const
auto
smem
=
std
::
get_if
<
SmemNode
>
(
&*
node
))
{
return
{
fmt
::
format
(
"{}[{} >> 2]"
,
GetSharedMemory
(),
Visit
(
smem
->
GetAddress
()).
AsUint
()),
Type
::
Uint
};
}
if
(
const
auto
internal_flag
=
std
::
get_if
<
InternalFlagNode
>
(
&*
node
))
{
if
(
const
auto
internal_flag
=
std
::
get_if
<
InternalFlagNode
>
(
&*
node
))
{
return
{
GetInternalFlag
(
internal_flag
->
GetFlag
()),
Type
::
Bool
};
return
{
GetInternalFlag
(
internal_flag
->
GetFlag
()),
Type
::
Bool
};
}
}
...
@@ -1195,6 +1209,11 @@ private:
...
@@ -1195,6 +1209,11 @@ private:
target
=
{
target
=
{
fmt
::
format
(
"{}[{} >> 2]"
,
GetLocalMemory
(),
Visit
(
lmem
->
GetAddress
()).
AsUint
()),
fmt
::
format
(
"{}[{} >> 2]"
,
GetLocalMemory
(),
Visit
(
lmem
->
GetAddress
()).
AsUint
()),
Type
::
Uint
};
Type
::
Uint
};
}
else
if
(
const
auto
smem
=
std
::
get_if
<
SmemNode
>
(
&*
dest
))
{
ASSERT
(
stage
==
ProgramType
::
Compute
);
target
=
{
fmt
::
format
(
"{}[{} >> 2]"
,
GetSharedMemory
(),
Visit
(
smem
->
GetAddress
()).
AsUint
()),
Type
::
Uint
};
}
else
if
(
const
auto
gmem
=
std
::
get_if
<
GmemNode
>
(
&*
dest
))
{
}
else
if
(
const
auto
gmem
=
std
::
get_if
<
GmemNode
>
(
&*
dest
))
{
const
std
::
string
real
=
Visit
(
gmem
->
GetRealAddress
()).
AsUint
();
const
std
::
string
real
=
Visit
(
gmem
->
GetRealAddress
()).
AsUint
();
const
std
::
string
base
=
Visit
(
gmem
->
GetBaseAddress
()).
AsUint
();
const
std
::
string
base
=
Visit
(
gmem
->
GetBaseAddress
()).
AsUint
();
...
@@ -2076,6 +2095,10 @@ private:
...
@@ -2076,6 +2095,10 @@ private:
return
"lmem_"
+
suffix
;
return
"lmem_"
+
suffix
;
}
}
std
::
string
GetSharedMemory
()
const
{
return
fmt
::
format
(
"smem_{}"
,
suffix
);
}
std
::
string
GetInternalFlag
(
InternalFlag
flag
)
const
{
std
::
string
GetInternalFlag
(
InternalFlag
flag
)
const
{
constexpr
std
::
array
InternalFlagNames
=
{
"zero_flag"
,
"sign_flag"
,
"carry_flag"
,
constexpr
std
::
array
InternalFlagNames
=
{
"zero_flag"
,
"sign_flag"
,
"carry_flag"
,
"overflow_flag"
};
"overflow_flag"
};
...
...
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