mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 00:10:10 +01:00
llvmpipe: replace LP_MAX_THREADS with screen->num_threads in query code
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
38a751cbe8
commit
ff74cf62b1
1 changed files with 4 additions and 2 deletions
|
|
@ -38,6 +38,7 @@
|
||||||
#include "lp_flush.h"
|
#include "lp_flush.h"
|
||||||
#include "lp_fence.h"
|
#include "lp_fence.h"
|
||||||
#include "lp_query.h"
|
#include "lp_query.h"
|
||||||
|
#include "lp_screen.h"
|
||||||
#include "lp_state.h"
|
#include "lp_state.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -92,6 +93,7 @@ llvmpipe_get_query_result(struct pipe_context *pipe,
|
||||||
boolean wait,
|
boolean wait,
|
||||||
union pipe_query_result *vresult)
|
union pipe_query_result *vresult)
|
||||||
{
|
{
|
||||||
|
struct llvmpipe_screen *screen = llvmpipe_screen(pipe->screen);
|
||||||
struct llvmpipe_query *pq = llvmpipe_query(q);
|
struct llvmpipe_query *pq = llvmpipe_query(q);
|
||||||
uint64_t *result = (uint64_t *)vresult;
|
uint64_t *result = (uint64_t *)vresult;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -118,12 +120,12 @@ llvmpipe_get_query_result(struct pipe_context *pipe,
|
||||||
|
|
||||||
switch (pq->type) {
|
switch (pq->type) {
|
||||||
case PIPE_QUERY_OCCLUSION_COUNTER:
|
case PIPE_QUERY_OCCLUSION_COUNTER:
|
||||||
for (i = 0; i < LP_MAX_THREADS; i++) {
|
for (i = 0; i < screen->num_threads; i++) {
|
||||||
*result += pq->count[i];
|
*result += pq->count[i];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PIPE_QUERY_TIMESTAMP:
|
case PIPE_QUERY_TIMESTAMP:
|
||||||
for (i = 0; i < LP_MAX_THREADS; i++) {
|
for (i = 0; i < screen->num_threads; i++) {
|
||||||
if (pq->count[i] > *result) {
|
if (pq->count[i] > *result) {
|
||||||
*result = pq->count[i];
|
*result = pq->count[i];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue