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
5d62f5d9
There was an error fetching the commit references. Please try again later.
Commit
5d62f5d9
authored
10 years ago
by
Tony Wasserka
Committed by
bunnei
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
GPU debugger: Add functionality to inspect command lists.
parent
50b2b73b
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/core/hle/service/gsp.cpp
+4
-0
4 additions, 0 deletions
src/core/hle/service/gsp.cpp
src/video_core/gpu_debugger.h
+53
-1
53 additions, 1 deletion
src/video_core/gpu_debugger.h
with
57 additions
and
1 deletion
src/core/hle/service/gsp.cpp
+
4
−
0
View file @
5d62f5d9
...
...
@@ -126,6 +126,10 @@ void TriggerCmdReqQueue(Service::Interface* self) {
GPU
::
Write
<
u32
>
(
GPU
::
Registers
::
CommandListAddress
,
cmd_buff
[
1
]
>>
3
);
GPU
::
Write
<
u32
>
(
GPU
::
Registers
::
CommandListSize
,
cmd_buff
[
2
]
>>
3
);
GPU
::
Write
<
u32
>
(
GPU
::
Registers
::
ProcessCommandList
,
1
);
// TODO: Not sure if we are supposed to always write this
// TODO: Move this to GPU
// TODO: Not sure what units the size is measured in
g_debugger
.
CommandListCalled
(
cmd_buff
[
1
],
(
u32
*
)
Memory
::
GetPointer
(
cmd_buff
[
1
]),
cmd_buff
[
2
]);
break
;
case
GXCommandId
::
SET_MEMORY_FILL
:
...
...
This diff is collapsed.
Click to expand it.
src/video_core/gpu_debugger.h
+
53
−
1
View file @
5d62f5d9
...
...
@@ -11,11 +11,23 @@
#include
"common/log.h"
#include
"core/hle/service/gsp.h"
#include
"pica.h"
class
GraphicsDebugger
{
public:
// A few utility structs used to expose data
// A vector of commands represented by their raw byte sequence
struct
PicaCommand
:
public
std
::
vector
<
u32
>
{
Pica
::
CommandHeader
&
GetHeader
()
{
return
*
(
Pica
::
CommandHeader
*
)
&
(
front
());
}
};
typedef
std
::
vector
<
PicaCommand
>
PicaCommandList
;
// Base class for all objects which need to be notified about GPU events
class
DebuggerObserver
{
...
...
@@ -40,6 +52,16 @@ public:
ERROR_LOG
(
GSP
,
"Received command: id=%x"
,
cmd
.
id
);
}
/**
* @param lst command list which triggered this call
* @param is_new true if the command list was called for the first time
* @todo figure out how to make sure called functions don't keep references around beyond their life time
*/
virtual
void
CommandListCalled
(
const
PicaCommandList
&
lst
,
bool
is_new
)
{
ERROR_LOG
(
GSP
,
"Command list called: %d"
,
(
int
)
is_new
);
}
protected
:
GraphicsDebugger
*
GetDebugger
()
{
...
...
@@ -66,12 +88,39 @@ public:
}
);
}
void
CommandListCalled
(
u32
address
,
u32
*
command_list
,
u32
size_in_words
)
{
// TODO: Decoding fun
// For now, just treating the whole command list as a single command
PicaCommandList
cmdlist
;
cmdlist
.
push_back
(
PicaCommand
());
auto
&
cmd
=
cmdlist
[
0
];
cmd
.
reserve
(
size_in_words
);
std
::
copy
(
command_list
,
command_list
+
size_in_words
,
std
::
back_inserter
(
cmd
));
auto
obj
=
std
::
pair
<
u32
,
PicaCommandList
>
(
address
,
cmdlist
);
auto
it
=
std
::
find
(
command_lists
.
begin
(),
command_lists
.
end
(),
obj
);
bool
is_new
=
(
it
==
command_lists
.
end
());
if
(
is_new
)
command_lists
.
push_back
(
obj
);
ForEachObserver
([
&
](
DebuggerObserver
*
observer
)
{
observer
->
CommandListCalled
(
obj
.
second
,
is_new
);
}
);
}
const
GSP_GPU
::
GXCommand
&
ReadGXCommandHistory
(
int
index
)
const
{
// TODO: Is this thread-safe?
return
gx_command_history
[
index
];
}
const
std
::
vector
<
std
::
pair
<
u32
,
PicaCommandList
>>&
GetCommandLists
()
const
{
return
command_lists
;
}
void
RegisterObserver
(
DebuggerObserver
*
observer
)
{
// TODO: Check for duplicates
...
...
@@ -94,4 +143,7 @@ private:
std
::
vector
<
DebuggerObserver
*>
observers
;
std
::
vector
<
GSP_GPU
::
GXCommand
>
gx_command_history
;
// vector of pairs of command lists and their storage address
std
::
vector
<
std
::
pair
<
u32
,
PicaCommandList
>>
command_lists
;
};
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