blob: 5e5f56302939663d126a0adf5a4a5f18fdde7d29 [file] [log] [blame]
Geoff Langff5b2d52016-09-07 11:32:23 -04001//
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 Lang65603eb2017-01-12 16:48:03 -050015#include <EGL/egl.h>
16
Geoff Langff5b2d52016-09-07 11:32:23 -040017namespace gl
18{
19class Buffer;
20class Framebuffer;
21class Program;
Geoff Lang740d9022016-10-07 11:20:52 -040022class Renderbuffer;
Geoff Langc1984ed2016-10-07 12:41:00 -040023class Sampler;
Geoff Langd7d0ed32016-10-07 11:33:51 -040024class Shader;
Geoff Langc1984ed2016-10-07 12:41:00 -040025class Texture;
Geoff Lang0a9661f2016-10-20 10:59:20 -070026struct TextureCaps;
Geoff Lang6899b872016-10-14 11:30:13 -040027struct UniformBlock;
Geoff Lang0b031062016-10-13 14:30:04 -040028struct VertexAttribute;
Jiawei-Shao2597fb62016-12-09 16:38:02 +080029struct VertexBinding;
Geoff Lang0b031062016-10-13 14:30:04 -040030struct VertexAttribCurrentValueData;
Geoff Langff5b2d52016-09-07 11:32:23 -040031
32void QueryFramebufferAttachmentParameteriv(const Framebuffer *framebuffer,
33 GLenum attachment,
34 GLenum pname,
35 GLint *params);
36void QueryBufferParameteriv(const Buffer *buffer, GLenum pname, GLint *params);
Geoff Langebebe1c2016-10-14 12:01:31 -040037void QueryBufferParameteri64v(const Buffer *buffer, GLenum pname, GLint64 *params);
Geoff Lang496c02d2016-10-20 11:38:11 -070038void QueryBufferPointerv(const Buffer *buffer, GLenum pname, void **params);
Geoff Langff5b2d52016-09-07 11:32:23 -040039void QueryProgramiv(const Program *program, GLenum pname, GLint *params);
Geoff Lang740d9022016-10-07 11:20:52 -040040void QueryRenderbufferiv(const Renderbuffer *renderbuffer, GLenum pname, GLint *params);
Geoff Langd7d0ed32016-10-07 11:33:51 -040041void QueryShaderiv(const Shader *shader, GLenum pname, GLint *params);
He Yunchao11b038b2016-11-22 21:24:04 +080042void QueryTexLevelParameterfv(const Texture *texture,
43 GLenum target,
44 GLint level,
45 GLenum pname,
46 GLfloat *params);
47void QueryTexLevelParameteriv(const Texture *texture,
48 GLenum target,
49 GLint level,
50 GLenum pname,
51 GLint *params);
Geoff Langc1984ed2016-10-07 12:41:00 -040052void QueryTexParameterfv(const Texture *texture, GLenum pname, GLfloat *params);
53void QueryTexParameteriv(const Texture *texture, GLenum pname, GLint *params);
54void QuerySamplerParameterfv(const Sampler *sampler, GLenum pname, GLfloat *params);
55void QuerySamplerParameteriv(const Sampler *sampler, GLenum pname, GLint *params);
Jiawei-Shao2597fb62016-12-09 16:38:02 +080056
57// Warning: you should ensure binding really matches attrib.bindingIndex before using the following
58// functions.
Geoff Lang0b031062016-10-13 14:30:04 -040059void QueryVertexAttribfv(const VertexAttribute &attrib,
Jiawei-Shao2597fb62016-12-09 16:38:02 +080060 const VertexBinding &binding,
Geoff Lang0b031062016-10-13 14:30:04 -040061 const VertexAttribCurrentValueData &currentValueData,
62 GLenum pname,
63 GLfloat *params);
Jiawei-Shao2597fb62016-12-09 16:38:02 +080064
Geoff Lang0b031062016-10-13 14:30:04 -040065void QueryVertexAttribiv(const VertexAttribute &attrib,
Jiawei-Shao2597fb62016-12-09 16:38:02 +080066 const VertexBinding &binding,
Geoff Lang0b031062016-10-13 14:30:04 -040067 const VertexAttribCurrentValueData &currentValueData,
68 GLenum pname,
69 GLint *params);
Jiawei-Shao2597fb62016-12-09 16:38:02 +080070
Geoff Lang0b031062016-10-13 14:30:04 -040071void QueryVertexAttribPointerv(const VertexAttribute &attrib, GLenum pname, GLvoid **pointer);
Jiawei-Shao2597fb62016-12-09 16:38:02 +080072
Geoff Lang0b031062016-10-13 14:30:04 -040073void QueryVertexAttribIiv(const VertexAttribute &attrib,
Jiawei-Shao2597fb62016-12-09 16:38:02 +080074 const VertexBinding &binding,
Geoff Lang0b031062016-10-13 14:30:04 -040075 const VertexAttribCurrentValueData &currentValueData,
76 GLenum pname,
77 GLint *params);
Jiawei-Shao2597fb62016-12-09 16:38:02 +080078
Geoff Lang0b031062016-10-13 14:30:04 -040079void QueryVertexAttribIuiv(const VertexAttribute &attrib,
Jiawei-Shao2597fb62016-12-09 16:38:02 +080080 const VertexBinding &binding,
Geoff Lang0b031062016-10-13 14:30:04 -040081 const VertexAttribCurrentValueData &currentValueData,
82 GLenum pname,
83 GLuint *params);
Geoff Langc1984ed2016-10-07 12:41:00 -040084
Geoff Lang6899b872016-10-14 11:30:13 -040085void QueryActiveUniformBlockiv(const Program *program,
86 GLuint uniformBlockIndex,
87 GLenum pname,
88 GLint *params);
89
Geoff Lang0a9661f2016-10-20 10:59:20 -070090void QueryInternalFormativ(const TextureCaps &format, GLenum pname, GLsizei bufSize, GLint *params);
JiangYizhouf7bbc8a2016-11-16 09:57:22 +080091void QueryFramebufferParameteriv(const Framebuffer *framebuffer, GLenum pname, GLint *params);
Geoff Lang0a9661f2016-10-20 10:59:20 -070092
Geoff Langc1984ed2016-10-07 12:41:00 -040093void SetTexParameterf(Texture *texture, GLenum pname, GLfloat param);
94void SetTexParameterfv(Texture *texture, GLenum pname, const GLfloat *params);
95void SetTexParameteri(Texture *texture, GLenum pname, GLint param);
96void SetTexParameteriv(Texture *texture, GLenum pname, const GLint *params);
97
98void SetSamplerParameterf(Sampler *sampler, GLenum pname, GLfloat param);
99void SetSamplerParameterfv(Sampler *sampler, GLenum pname, const GLfloat *params);
100void SetSamplerParameteri(Sampler *sampler, GLenum pname, GLint param);
101void SetSamplerParameteriv(Sampler *sampler, GLenum pname, const GLint *params);
JiangYizhouf7bbc8a2016-11-16 09:57:22 +0800102void SetFramebufferParameteri(Framebuffer *framebuffer, GLenum pname, GLint param);
Geoff Lang65603eb2017-01-12 16:48:03 -0500103
104} // namespace gl
105
106namespace egl
107{
108struct Config;
109
110void QueryConfigAttrib(const Config *config, EGLint attribute, EGLint *value);
111
112} // namespace egl
Geoff Langff5b2d52016-09-07 11:32:23 -0400113
114#endif // LIBANGLE_QUERYUTILS_H_