Geoff Lang | ff5b2d5 | 2016-09-07 11:32:23 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2016 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 | // queryutils.h: Utilities for querying values from GL objects |
| 8 | |
| 9 | #ifndef LIBANGLE_QUERYUTILS_H_ |
| 10 | #define LIBANGLE_QUERYUTILS_H_ |
| 11 | |
| 12 | #include "angle_gl.h" |
| 13 | #include "common/angleutils.h" |
| 14 | |
Geoff Lang | 65603eb | 2017-01-12 16:48:03 -0500 | [diff] [blame^] | 15 | #include <EGL/egl.h> |
| 16 | |
Geoff Lang | ff5b2d5 | 2016-09-07 11:32:23 -0400 | [diff] [blame] | 17 | namespace gl |
| 18 | { |
| 19 | class Buffer; |
| 20 | class Framebuffer; |
| 21 | class Program; |
Geoff Lang | 740d902 | 2016-10-07 11:20:52 -0400 | [diff] [blame] | 22 | class Renderbuffer; |
Geoff Lang | c1984ed | 2016-10-07 12:41:00 -0400 | [diff] [blame] | 23 | class Sampler; |
Geoff Lang | d7d0ed3 | 2016-10-07 11:33:51 -0400 | [diff] [blame] | 24 | class Shader; |
Geoff Lang | c1984ed | 2016-10-07 12:41:00 -0400 | [diff] [blame] | 25 | class Texture; |
Geoff Lang | 0a9661f | 2016-10-20 10:59:20 -0700 | [diff] [blame] | 26 | struct TextureCaps; |
Geoff Lang | 6899b87 | 2016-10-14 11:30:13 -0400 | [diff] [blame] | 27 | struct UniformBlock; |
Geoff Lang | 0b03106 | 2016-10-13 14:30:04 -0400 | [diff] [blame] | 28 | struct VertexAttribute; |
| 29 | struct VertexAttribCurrentValueData; |
Geoff Lang | ff5b2d5 | 2016-09-07 11:32:23 -0400 | [diff] [blame] | 30 | |
| 31 | void QueryFramebufferAttachmentParameteriv(const Framebuffer *framebuffer, |
| 32 | GLenum attachment, |
| 33 | GLenum pname, |
| 34 | GLint *params); |
| 35 | void QueryBufferParameteriv(const Buffer *buffer, GLenum pname, GLint *params); |
Geoff Lang | ebebe1c | 2016-10-14 12:01:31 -0400 | [diff] [blame] | 36 | void QueryBufferParameteri64v(const Buffer *buffer, GLenum pname, GLint64 *params); |
Geoff Lang | 496c02d | 2016-10-20 11:38:11 -0700 | [diff] [blame] | 37 | void QueryBufferPointerv(const Buffer *buffer, GLenum pname, void **params); |
Geoff Lang | ff5b2d5 | 2016-09-07 11:32:23 -0400 | [diff] [blame] | 38 | void QueryProgramiv(const Program *program, GLenum pname, GLint *params); |
Geoff Lang | 740d902 | 2016-10-07 11:20:52 -0400 | [diff] [blame] | 39 | void QueryRenderbufferiv(const Renderbuffer *renderbuffer, GLenum pname, GLint *params); |
Geoff Lang | d7d0ed3 | 2016-10-07 11:33:51 -0400 | [diff] [blame] | 40 | void QueryShaderiv(const Shader *shader, GLenum pname, GLint *params); |
He Yunchao | 11b038b | 2016-11-22 21:24:04 +0800 | [diff] [blame] | 41 | void QueryTexLevelParameterfv(const Texture *texture, |
| 42 | GLenum target, |
| 43 | GLint level, |
| 44 | GLenum pname, |
| 45 | GLfloat *params); |
| 46 | void QueryTexLevelParameteriv(const Texture *texture, |
| 47 | GLenum target, |
| 48 | GLint level, |
| 49 | GLenum pname, |
| 50 | GLint *params); |
Geoff Lang | c1984ed | 2016-10-07 12:41:00 -0400 | [diff] [blame] | 51 | void QueryTexParameterfv(const Texture *texture, GLenum pname, GLfloat *params); |
| 52 | void QueryTexParameteriv(const Texture *texture, GLenum pname, GLint *params); |
| 53 | void QuerySamplerParameterfv(const Sampler *sampler, GLenum pname, GLfloat *params); |
| 54 | void QuerySamplerParameteriv(const Sampler *sampler, GLenum pname, GLint *params); |
Geoff Lang | 0b03106 | 2016-10-13 14:30:04 -0400 | [diff] [blame] | 55 | void QueryVertexAttribfv(const VertexAttribute &attrib, |
| 56 | const VertexAttribCurrentValueData ¤tValueData, |
| 57 | GLenum pname, |
| 58 | GLfloat *params); |
| 59 | void QueryVertexAttribiv(const VertexAttribute &attrib, |
| 60 | const VertexAttribCurrentValueData ¤tValueData, |
| 61 | GLenum pname, |
| 62 | GLint *params); |
| 63 | void QueryVertexAttribPointerv(const VertexAttribute &attrib, GLenum pname, GLvoid **pointer); |
| 64 | void QueryVertexAttribIiv(const VertexAttribute &attrib, |
| 65 | const VertexAttribCurrentValueData ¤tValueData, |
| 66 | GLenum pname, |
| 67 | GLint *params); |
| 68 | void QueryVertexAttribIuiv(const VertexAttribute &attrib, |
| 69 | const VertexAttribCurrentValueData ¤tValueData, |
| 70 | GLenum pname, |
| 71 | GLuint *params); |
Geoff Lang | c1984ed | 2016-10-07 12:41:00 -0400 | [diff] [blame] | 72 | |
Geoff Lang | 6899b87 | 2016-10-14 11:30:13 -0400 | [diff] [blame] | 73 | void QueryActiveUniformBlockiv(const Program *program, |
| 74 | GLuint uniformBlockIndex, |
| 75 | GLenum pname, |
| 76 | GLint *params); |
| 77 | |
Geoff Lang | 0a9661f | 2016-10-20 10:59:20 -0700 | [diff] [blame] | 78 | void QueryInternalFormativ(const TextureCaps &format, GLenum pname, GLsizei bufSize, GLint *params); |
| 79 | |
Geoff Lang | c1984ed | 2016-10-07 12:41:00 -0400 | [diff] [blame] | 80 | void SetTexParameterf(Texture *texture, GLenum pname, GLfloat param); |
| 81 | void SetTexParameterfv(Texture *texture, GLenum pname, const GLfloat *params); |
| 82 | void SetTexParameteri(Texture *texture, GLenum pname, GLint param); |
| 83 | void SetTexParameteriv(Texture *texture, GLenum pname, const GLint *params); |
| 84 | |
| 85 | void SetSamplerParameterf(Sampler *sampler, GLenum pname, GLfloat param); |
| 86 | void SetSamplerParameterfv(Sampler *sampler, GLenum pname, const GLfloat *params); |
| 87 | void SetSamplerParameteri(Sampler *sampler, GLenum pname, GLint param); |
| 88 | void SetSamplerParameteriv(Sampler *sampler, GLenum pname, const GLint *params); |
Geoff Lang | 65603eb | 2017-01-12 16:48:03 -0500 | [diff] [blame^] | 89 | |
| 90 | } // namespace gl |
| 91 | |
| 92 | namespace egl |
| 93 | { |
| 94 | struct Config; |
| 95 | |
| 96 | void QueryConfigAttrib(const Config *config, EGLint attribute, EGLint *value); |
| 97 | |
| 98 | } // namespace egl |
Geoff Lang | ff5b2d5 | 2016-09-07 11:32:23 -0400 | [diff] [blame] | 99 | |
| 100 | #endif // LIBANGLE_QUERYUTILS_H_ |