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
ccb8da15
There was an error fetching the commit references. Please try again later.
Commit
ccb8da15
authored
7 years ago
by
Subv
Browse files
Options
Downloads
Patches
Plain Diff
GPU: Renamed ShaderType to ShaderStage as that is less confusing.
parent
88698c15
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/engines/maxwell_3d.cpp
+12
-12
12 additions, 12 deletions
src/video_core/engines/maxwell_3d.cpp
src/video_core/engines/maxwell_3d.h
+7
-7
7 additions, 7 deletions
src/video_core/engines/maxwell_3d.h
with
19 additions
and
19 deletions
src/video_core/engines/maxwell_3d.cpp
+
12
−
12
View file @
ccb8da15
...
...
@@ -44,23 +44,23 @@ void Maxwell3D::WriteReg(u32 method, u32 value) {
break
;
}
case
MAXWELL3D_REG_INDEX
(
cb_bind
[
0
].
raw_config
)
:
{
ProcessCBBind
(
Regs
::
Shader
Typ
e
::
Vertex
);
ProcessCBBind
(
Regs
::
Shader
Stag
e
::
Vertex
);
break
;
}
case
MAXWELL3D_REG_INDEX
(
cb_bind
[
1
].
raw_config
)
:
{
ProcessCBBind
(
Regs
::
Shader
Typ
e
::
TesselationControl
);
ProcessCBBind
(
Regs
::
Shader
Stag
e
::
TesselationControl
);
break
;
}
case
MAXWELL3D_REG_INDEX
(
cb_bind
[
2
].
raw_config
)
:
{
ProcessCBBind
(
Regs
::
Shader
Typ
e
::
TesselationEval
);
ProcessCBBind
(
Regs
::
Shader
Stag
e
::
TesselationEval
);
break
;
}
case
MAXWELL3D_REG_INDEX
(
cb_bind
[
3
].
raw_config
)
:
{
ProcessCBBind
(
Regs
::
Shader
Typ
e
::
Geometry
);
ProcessCBBind
(
Regs
::
Shader
Stag
e
::
Geometry
);
break
;
}
case
MAXWELL3D_REG_INDEX
(
cb_bind
[
4
].
raw_config
)
:
{
ProcessCBBind
(
Regs
::
Shader
Typ
e
::
Fragment
);
ProcessCBBind
(
Regs
::
Shader
Stag
e
::
Fragment
);
break
;
}
case
MAXWELL3D_REG_INDEX
(
draw
.
vertex_end_gl
)
:
{
...
...
@@ -106,18 +106,18 @@ void Maxwell3D::SetShader(const std::vector<u32>& parameters) {
* [0] = Shader Program.
* [1] = Unknown, presumably the shader id.
* [2] = Offset to the start of the shader, after the 0x30 bytes header.
* [3] = Shader
Typ
e.
* [3] = Shader
Stag
e.
* [4] = Const Buffer Address >> 8.
*/
auto
shader_program
=
static_cast
<
Regs
::
ShaderProgram
>
(
parameters
[
0
]);
// TODO(Subv): This address is probably an offset from the CODE_ADDRESS register.
GPUVAddr
address
=
parameters
[
2
];
auto
shader_
typ
e
=
static_cast
<
Regs
::
Shader
Typ
e
>
(
parameters
[
3
]);
auto
shader_
stag
e
=
static_cast
<
Regs
::
Shader
Stag
e
>
(
parameters
[
3
]);
GPUVAddr
cb_address
=
parameters
[
4
]
<<
8
;
auto
&
shader
=
state
.
shader_programs
[
static_cast
<
size_t
>
(
shader_program
)];
shader
.
program
=
shader_program
;
shader
.
typ
e
=
shader_
typ
e
;
shader
.
stag
e
=
shader_
stag
e
;
shader
.
address
=
address
;
// Perform the same operations as the real macro code.
...
...
@@ -135,13 +135,13 @@ void Maxwell3D::SetShader(const std::vector<u32>& parameters) {
// Write a hardcoded 0x11 to CB_BIND, this binds the current const buffer to buffer c1[] in the
// shader. It's likely that these are the constants for the shader.
regs
.
cb_bind
[
static_cast
<
size_t
>
(
shader_
typ
e
)].
valid
.
Assign
(
1
);
regs
.
cb_bind
[
static_cast
<
size_t
>
(
shader_
typ
e
)].
index
.
Assign
(
1
);
regs
.
cb_bind
[
static_cast
<
size_t
>
(
shader_
stag
e
)].
valid
.
Assign
(
1
);
regs
.
cb_bind
[
static_cast
<
size_t
>
(
shader_
stag
e
)].
index
.
Assign
(
1
);
ProcessCBBind
(
shader_
typ
e
);
ProcessCBBind
(
shader_
stag
e
);
}
void
Maxwell3D
::
ProcessCBBind
(
Regs
::
Shader
Typ
e
stage
)
{
void
Maxwell3D
::
ProcessCBBind
(
Regs
::
Shader
Stag
e
stage
)
{
// Bind the buffer currently in CB_ADDRESS to the specified index in the desired shader stage.
auto
&
shader
=
state
.
shader_stages
[
static_cast
<
size_t
>
(
stage
)];
auto
&
bind_data
=
regs
.
cb_bind
[
static_cast
<
size_t
>
(
stage
)];
...
...
This diff is collapsed.
Click to expand it.
src/video_core/engines/maxwell_3d.h
+
7
−
7
View file @
ccb8da15
...
...
@@ -38,7 +38,7 @@ public:
static
constexpr
size_t
NumCBData
=
16
;
static
constexpr
size_t
NumVertexArrays
=
32
;
static
constexpr
size_t
MaxShaderProgram
=
6
;
static
constexpr
size_t
MaxShader
Typ
e
=
5
;
static
constexpr
size_t
MaxShader
Stag
e
=
5
;
// Maximum number of const buffers per shader stage.
static
constexpr
size_t
MaxConstBuffers
=
16
;
...
...
@@ -56,7 +56,7 @@ public:
Fragment
=
5
,
};
enum
class
Shader
Typ
e
:
u32
{
enum
class
Shader
Stag
e
:
u32
{
Vertex
=
0
,
TesselationControl
=
1
,
TesselationEval
=
2
,
...
...
@@ -136,7 +136,7 @@ public:
u32
start_id
;
INSERT_PADDING_WORDS
(
1
);
u32
gpr_alloc
;
Shader
Typ
e
type
;
Shader
Stag
e
type
;
INSERT_PADDING_WORDS
(
9
);
}
shader_config
[
MaxShaderProgram
];
...
...
@@ -164,7 +164,7 @@ public:
BitField
<
4
,
5
,
u32
>
index
;
};
INSERT_PADDING_WORDS
(
7
);
}
cb_bind
[
MaxShader
Typ
e
];
}
cb_bind
[
MaxShader
Stag
e
];
INSERT_PADDING_WORDS
(
0x50A
);
};
...
...
@@ -183,7 +183,7 @@ public:
};
struct
ShaderProgramInfo
{
Regs
::
Shader
Type
typ
e
;
Regs
::
Shader
Stage
stag
e
;
Regs
::
ShaderProgram
program
;
GPUVAddr
address
;
};
...
...
@@ -192,7 +192,7 @@ public:
std
::
array
<
ConstBufferInfo
,
Regs
::
MaxConstBuffers
>
const_buffers
;
};
std
::
array
<
ShaderStageInfo
,
Regs
::
MaxShader
Typ
e
>
shader_stages
;
std
::
array
<
ShaderStageInfo
,
Regs
::
MaxShader
Stag
e
>
shader_stages
;
std
::
array
<
ShaderProgramInfo
,
Regs
::
MaxShaderProgram
>
shader_programs
;
};
...
...
@@ -205,7 +205,7 @@ private:
void
ProcessQueryGet
();
/// Handles a write to the CB_BIND register.
void
ProcessCBBind
(
Regs
::
Shader
Typ
e
stage
);
void
ProcessCBBind
(
Regs
::
Shader
Stag
e
stage
);
/// Handles a write to the VERTEX_END_GL register, triggering a draw.
void
DrawArrays
();
...
...
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