blob: 9a90bf54a630d3f61ff87476be36d33b031cc0c9 [file] [log] [blame]
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +00001//
2// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7// QueryImpl.h: Defines the abstract rx::QueryImpl class.
8
Geoff Lang0a73dd82014-11-19 16:18:08 -05009#ifndef LIBANGLE_RENDERER_QUERYIMPL_H_
10#define LIBANGLE_RENDERER_QUERYIMPL_H_
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000011
Geoff Lang5aad9672014-09-08 11:10:42 -040012
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000013#include "common/angleutils.h"
Corentin Wallezad3ae902018-03-09 13:40:42 -050014#include "libANGLE/Error.h"
15#include "libANGLE/PackedEnums.h"
Geoff Lang0b7eef72014-06-12 14:10:47 -040016
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000017namespace rx
18{
19
Jamie Madillf0d10f82015-03-31 12:56:52 -040020class QueryImpl : angle::NonCopyable
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000021{
22 public:
Corentin Wallezad3ae902018-03-09 13:40:42 -050023 explicit QueryImpl(gl::QueryType type) { mType = type; }
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000024 virtual ~QueryImpl() { }
25
Geoff Lang5aad9672014-09-08 11:10:42 -040026 virtual gl::Error begin() = 0;
27 virtual gl::Error end() = 0;
Ian Ewell3ffd78b2016-01-22 16:09:42 -050028 virtual gl::Error queryCounter() = 0;
29 virtual gl::Error getResult(GLint *params) = 0;
Geoff Lang5aad9672014-09-08 11:10:42 -040030 virtual gl::Error getResult(GLuint *params) = 0;
Ian Ewell3ffd78b2016-01-22 16:09:42 -050031 virtual gl::Error getResult(GLint64 *params) = 0;
32 virtual gl::Error getResult(GLuint64 *params) = 0;
33 virtual gl::Error isResultAvailable(bool *available) = 0;
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000034
Corentin Wallezad3ae902018-03-09 13:40:42 -050035 gl::QueryType getType() const { return mType; }
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000036
37 private:
Corentin Wallezad3ae902018-03-09 13:40:42 -050038 gl::QueryType mType;
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000039};
40
41}
42
Geoff Lang0a73dd82014-11-19 16:18:08 -050043#endif // LIBANGLE_RENDERER_QUERYIMPL_H_