mesa/st: introduce PIPE_CAP_NO_CLIP_ON_COPY_TEX
[mesa.git] / src / mesa / state_tracker / st_cb_perfmon.c
index cd7fdc06173f326ffedea9a6ab3446cd01285e88..0f5aa371d6adb0b1ff65ab294d8aa8fe9f6741b2 100644 (file)
@@ -29,6 +29,7 @@
 #include "st_context.h"
 #include "st_cb_bitmap.h"
 #include "st_cb_perfmon.h"
+#include "st_util.h"
 
 #include "util/bitset.h"
 
@@ -87,9 +88,8 @@ init_perf_monitor(struct gl_context *ctx, struct gl_perf_monitor_object *m)
    for (gid = 0; gid < ctx->PerfMonitor.NumGroups; gid++) {
       const struct gl_perf_monitor_group *g = &ctx->PerfMonitor.Groups[gid];
       const struct st_perf_monitor_group *stg = &st->perfmon[gid];
-      BITSET_WORD tmp;
 
-      BITSET_FOREACH_SET(cid, tmp, m->ActiveCounters[gid], g->NumCounters) {
+      BITSET_FOREACH_SET(cid, m->ActiveCounters[gid], g->NumCounters) {
          const struct st_perf_monitor_counter *stc = &stg->counters[cid];
          struct st_perf_counter_object *cntr =
             &stm->active_counters[stm->num_active_counters];
@@ -308,16 +308,16 @@ st_GetPerfMonitorResult(struct gl_context *ctx,
       data[offset++] = cid;
       switch (type) {
       case GL_UNSIGNED_INT64_AMD:
-         *(uint64_t *)&data[offset] = result.u64;
+         memcpy(&data[offset], &result.u64, sizeof(uint64_t));
          offset += sizeof(uint64_t) / sizeof(GLuint);
          break;
       case GL_UNSIGNED_INT:
-         *(uint32_t *)&data[offset] = result.u32;
+         memcpy(&data[offset], &result.u32, sizeof(uint32_t));
          offset += sizeof(uint32_t) / sizeof(GLuint);
          break;
       case GL_FLOAT:
       case GL_PERCENTAGE_AMD:
-         *(GLfloat *)&data[offset] = result.f;
+         memcpy(&data[offset], &result.f, sizeof(GLfloat));
          offset += sizeof(GLfloat) / sizeof(GLuint);
          break;
       }
@@ -343,7 +343,7 @@ static void
 st_InitPerfMonitorGroups(struct gl_context *ctx)
 {
    struct st_context *st = st_context(ctx);
-   struct gl_perf_monitor_state *perfmon = &st->ctx->PerfMonitor;
+   struct gl_perf_monitor_state *perfmon = &ctx->PerfMonitor;
    struct pipe_screen *screen = st->pipe->screen;
    struct gl_perf_monitor_group *groups = NULL;
    struct st_perf_monitor_group *stgroups = NULL;
@@ -404,17 +404,17 @@ st_InitPerfMonitorGroups(struct gl_context *ctx)
             case PIPE_DRIVER_QUERY_TYPE_MICROSECONDS:
             case PIPE_DRIVER_QUERY_TYPE_HZ:
                c->Minimum.u64 = 0;
-               c->Maximum.u64 = info.max_value.u64 ? info.max_value.u64 : -1;
+               c->Maximum.u64 = info.max_value.u64 ? info.max_value.u64 : UINT64_MAX;
                c->Type = GL_UNSIGNED_INT64_AMD;
                break;
             case PIPE_DRIVER_QUERY_TYPE_UINT:
                c->Minimum.u32 = 0;
-               c->Maximum.u32 = info.max_value.u32 ? info.max_value.u32 : -1;
+               c->Maximum.u32 = info.max_value.u32 ? info.max_value.u32 : UINT32_MAX;
                c->Type = GL_UNSIGNED_INT;
                break;
             case PIPE_DRIVER_QUERY_TYPE_FLOAT:
                c->Minimum.f = 0.0;
-               c->Maximum.f = info.max_value.f ? info.max_value.f : -1;
+               c->Maximum.f = info.max_value.f ? info.max_value.f : FLT_MAX;
                c->Type = GL_FLOAT;
                break;
             case PIPE_DRIVER_QUERY_TYPE_PERCENTAGE: