Skip to content

Commit 53cec96

Browse files
committed
Fix draw calls being listed under Primitive Setup in PStats, etc.
Previously, all draw calls would be grouped under "Primitive Setup", rather than under the appropriate bin collector. This commit fixes that and adds a few other useful collectors as well.
1 parent c18cdcf commit 53cec96

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

panda/src/glstuff/glGraphicsStateGuardian_src.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ PStatCollector CLP(GraphicsStateGuardian)::_vertex_array_update_pcollector("Draw
9191
PStatCollector CLP(GraphicsStateGuardian)::_texture_update_pcollector("Draw:Update texture");
9292
PStatCollector CLP(GraphicsStateGuardian)::_fbo_bind_pcollector("Draw:Bind FBO");
9393
PStatCollector CLP(GraphicsStateGuardian)::_check_error_pcollector("Draw:Check errors");
94+
PStatCollector CLP(GraphicsStateGuardian)::_check_residency_pcollector("*:PStats:Check residency");
9495

9596
// The following noop functions are assigned to the corresponding glext
9697
// function pointers in the class, in case the functions are not defined by
@@ -3949,6 +3950,7 @@ end_frame(Thread *current_thread) {
39493950
// connects PStats, at which point it will then correct the assessment. No
39503951
// harm done.
39513952
if (has_fixed_function_pipeline() && PStatClient::is_connected()) {
3953+
PStatTimer timer(_check_residency_pcollector);
39523954
check_nonresident_texture(_prepared_objects->_texture_residency.get_inactive_resident());
39533955
check_nonresident_texture(_prepared_objects->_texture_residency.get_active_resident());
39543956

@@ -7208,6 +7210,8 @@ do_issue_shade_model() {
72087210
*/
72097211
void CLP(GraphicsStateGuardian)::
72107212
do_issue_shader() {
7213+
PStatTimer timer(_draw_set_state_shader_pcollector);
7214+
72117215
ShaderContext *context = 0;
72127216
Shader *shader = (Shader *)_target_shader->get_shader();
72137217

@@ -10919,7 +10923,6 @@ set_state_and_transform(const RenderState *target,
1091910923
_instance_count = _target_shader->get_instance_count();
1092010924

1092110925
if (_target_shader != _state_shader) {
10922-
// PStatGPUTimer timer(this, _draw_set_state_shader_pcollector);
1092310926
do_issue_shader();
1092410927
_state_shader = _target_shader;
1092510928
_state_mask.clear_bit(TextureAttrib::get_class_slot());
@@ -11075,7 +11078,7 @@ set_state_and_transform(const RenderState *target,
1107511078
int texture_slot = TextureAttrib::get_class_slot();
1107611079
if (_target_rs->get_attrib(texture_slot) != _state_rs->get_attrib(texture_slot) ||
1107711080
!_state_mask.get_bit(texture_slot)) {
11078-
// PStatGPUTimer timer(this, _draw_set_state_texture_pcollector);
11081+
PStatGPUTimer timer(this, _draw_set_state_texture_pcollector);
1107911082
determine_target_texture();
1108011083
do_issue_texture();
1108111084

panda/src/glstuff/glGraphicsStateGuardian_src.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,7 @@ class EXPCL_GL CLP(GraphicsStateGuardian) : public GraphicsStateGuardian {
11261126
static PStatCollector _texture_update_pcollector;
11271127
static PStatCollector _fbo_bind_pcollector;
11281128
static PStatCollector _check_error_pcollector;
1129+
static PStatCollector _check_residency_pcollector;
11291130

11301131
public:
11311132
virtual TypeHandle get_type() const {

panda/src/gobj/geom.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,8 +1844,11 @@ check_valid(const GeomVertexDataPipelineReader *data_reader) const {
18441844
bool GeomPipelineReader::
18451845
draw(GraphicsStateGuardianBase *gsg,
18461846
const GeomVertexDataPipelineReader *data_reader, bool force) const {
1847-
PStatTimer timer(Geom::_draw_primitive_setup_pcollector);
1848-
bool all_ok = gsg->begin_draw_primitives(this, data_reader, force);
1847+
bool all_ok;
1848+
{
1849+
PStatTimer timer(Geom::_draw_primitive_setup_pcollector);
1850+
all_ok = gsg->begin_draw_primitives(this, data_reader, force);
1851+
}
18491852
if (all_ok) {
18501853
Geom::Primitives::const_iterator pi;
18511854
for (pi = _cdata->_primitives.begin();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy