mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-13 10:18:40 +12:00
rsx: Implement precise ZCULL stats
This commit is contained in:
parent
0525070898
commit
472efc08eb
7 changed files with 62 additions and 58 deletions
|
@ -3377,7 +3377,10 @@ namespace rsx
|
|||
switch (type)
|
||||
{
|
||||
case CELL_GCM_ZPASS_PIXEL_CNT:
|
||||
value = value ? u16{umax} : 0;
|
||||
if (!g_cfg.video.precise_zpass_count)
|
||||
{
|
||||
value = value ? u16{ umax } : 0;
|
||||
}
|
||||
break;
|
||||
case CELL_GCM_ZCULL_STATS3:
|
||||
value = value ? 0 : u16{umax};
|
||||
|
@ -3470,7 +3473,9 @@ namespace rsx
|
|||
ensure(query->pending);
|
||||
|
||||
const bool implemented = (writer.type == CELL_GCM_ZPASS_PIXEL_CNT || writer.type == CELL_GCM_ZCULL_STATS3);
|
||||
if (implemented && !result && query->num_draws)
|
||||
const bool have_result = result && !g_cfg.video.precise_zpass_count;
|
||||
|
||||
if (implemented && !have_result && query->num_draws)
|
||||
{
|
||||
get_occlusion_query_result(query);
|
||||
|
||||
|
@ -3622,55 +3627,30 @@ namespace rsx
|
|||
ensure(query->pending);
|
||||
|
||||
const bool implemented = (writer.type == CELL_GCM_ZPASS_PIXEL_CNT || writer.type == CELL_GCM_ZCULL_STATS3);
|
||||
if (force_read)
|
||||
{
|
||||
if (implemented && !result && query->num_draws)
|
||||
{
|
||||
get_occlusion_query_result(query);
|
||||
const bool have_result = result && !g_cfg.video.precise_zpass_count;
|
||||
|
||||
if (query->result)
|
||||
{
|
||||
result += query->result;
|
||||
if (query->data_type & CELL_GCM_ZPASS_PIXEL_CNT)
|
||||
{
|
||||
m_statistics_map[writer.counter_tag] += query->result;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!implemented || !query->num_draws || have_result)
|
||||
{
|
||||
discard_occlusion_query(query);
|
||||
}
|
||||
else if (force_read || check_occlusion_query_status(query))
|
||||
{
|
||||
get_occlusion_query_result(query);
|
||||
|
||||
if (query->result)
|
||||
{
|
||||
//No need to read this
|
||||
discard_occlusion_query(query);
|
||||
result += query->result;
|
||||
if (query->data_type & CELL_GCM_ZPASS_PIXEL_CNT)
|
||||
{
|
||||
m_statistics_map[writer.counter_tag] += query->result;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (implemented && !result && query->num_draws)
|
||||
{
|
||||
//Maybe we get lucky and results are ready
|
||||
if (check_occlusion_query_status(query))
|
||||
{
|
||||
get_occlusion_query_result(query);
|
||||
if (query->result)
|
||||
{
|
||||
result += query->result;
|
||||
if (query->data_type & CELL_GCM_ZPASS_PIXEL_CNT)
|
||||
{
|
||||
m_statistics_map[writer.counter_tag] += query->result;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Too early; abort
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Not necessary to read the result anymore
|
||||
discard_occlusion_query(query);
|
||||
}
|
||||
// Too early; abort
|
||||
ensure(!force_read && implemented);
|
||||
break;
|
||||
}
|
||||
|
||||
free_query(query);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue