Hash :
d0febe7a
Author :
Date :
2018-05-17T22:36:52
Reland "GLES1: Entry points for lighting and materials" This is a reland of 4a09c1a245c406e402b3996b7ed33798b897e60f Entry points have been autogenerated again. Original change's description: > GLES1: Entry points for lighting and materials > > - glLight*/glMaterial and their queries > - Use new packed enums in these entry points, except for lightmodel > which stays GLenum to be consistent with other generic glGet's > - State.cpp: New glGet* queries related to light model and > light/normal rescale enablement > - GLES1State.cpp: Functions to get/set lighting/material state > - Validation for lighting/materials > > + Add a few convenience methods to random_utils for sampling > non-negative floats and a sampler for random booleans > > BUG=angleproject:2306 > > Change-Id: If7ba0c0a0dc75f88fbaa986b904f1ea96ee6512e > Reviewed-on: https://chromium-review.googlesource.com/1065502 > Commit-Queue: Lingfeng Yang <lfy@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:2306 Change-Id: I434273acd5200dd9f4925e239a032cc8db31a434 Reviewed-on: https://chromium-review.googlesource.com/1072849 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
//
// Copyright (c) 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// queryutils.h: Utilities for querying values from GL objects
#ifndef LIBANGLE_QUERYUTILS_H_
#define LIBANGLE_QUERYUTILS_H_
#include "angle_gl.h"
#include "common/PackedEnums.h"
#include "common/angleutils.h"
#include <EGL/egl.h>
namespace gl
{
class Buffer;
class Context;
class Error;
class Sync;
class Framebuffer;
class GLES1State;
class Program;
class Renderbuffer;
class Sampler;
class Shader;
class Texture;
struct TextureCaps;
struct UniformBlock;
struct VertexAttribute;
class VertexBinding;
struct VertexAttribCurrentValueData;
void QueryFramebufferAttachmentParameteriv(const Context *context,
const Framebuffer *framebuffer,
GLenum attachment,
GLenum pname,
GLint *params);
void QueryBufferParameteriv(const Buffer *buffer, GLenum pname, GLint *params);
void QueryBufferParameteri64v(const Buffer *buffer, GLenum pname, GLint64 *params);
void QueryBufferPointerv(const Buffer *buffer, GLenum pname, void **params);
void QueryProgramiv(const Context *context, const Program *program, GLenum pname, GLint *params);
void QueryRenderbufferiv(const Context *context,
const Renderbuffer *renderbuffer,
GLenum pname,
GLint *params);
void QueryShaderiv(const Context *context, Shader *shader, GLenum pname, GLint *params);
void QueryTexLevelParameterfv(const Texture *texture,
TextureTarget target,
GLint level,
GLenum pname,
GLfloat *params);
void QueryTexLevelParameteriv(const Texture *texture,
TextureTarget target,
GLint level,
GLenum pname,
GLint *params);
void QueryTexParameterfv(const Texture *texture, GLenum pname, GLfloat *params);
void QueryTexParameteriv(const Texture *texture, GLenum pname, GLint *params);
void QuerySamplerParameterfv(const Sampler *sampler, GLenum pname, GLfloat *params);
void QuerySamplerParameteriv(const Sampler *sampler, GLenum pname, GLint *params);
// Warning: you should ensure binding really matches attrib.bindingIndex before using the following
// functions.
void QueryVertexAttribfv(const VertexAttribute &attrib,
const VertexBinding &binding,
const VertexAttribCurrentValueData ¤tValueData,
GLenum pname,
GLfloat *params);
void QueryVertexAttribiv(const VertexAttribute &attrib,
const VertexBinding &binding,
const VertexAttribCurrentValueData ¤tValueData,
GLenum pname,
GLint *params);
void QueryVertexAttribPointerv(const VertexAttribute &attrib, GLenum pname, void **pointer);
void QueryVertexAttribIiv(const VertexAttribute &attrib,
const VertexBinding &binding,
const VertexAttribCurrentValueData ¤tValueData,
GLenum pname,
GLint *params);
void QueryVertexAttribIuiv(const VertexAttribute &attrib,
const VertexBinding &binding,
const VertexAttribCurrentValueData ¤tValueData,
GLenum pname,
GLuint *params);
void QueryActiveUniformBlockiv(const Program *program,
GLuint uniformBlockIndex,
GLenum pname,
GLint *params);
void QueryInternalFormativ(const TextureCaps &format, GLenum pname, GLsizei bufSize, GLint *params);
void QueryFramebufferParameteriv(const Framebuffer *framebuffer, GLenum pname, GLint *params);
Error QuerySynciv(const Sync *sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
void SetTexParameterf(Context *context, Texture *texture, GLenum pname, GLfloat param);
void SetTexParameterfv(Context *context, Texture *texture, GLenum pname, const GLfloat *params);
void SetTexParameteri(Context *context, Texture *texture, GLenum pname, GLint param);
void SetTexParameteriv(Context *context, Texture *texture, GLenum pname, const GLint *params);
void SetSamplerParameterf(Sampler *sampler, GLenum pname, GLfloat param);
void SetSamplerParameterfv(Sampler *sampler, GLenum pname, const GLfloat *params);
void SetSamplerParameteri(Sampler *sampler, GLenum pname, GLint param);
void SetSamplerParameteriv(Sampler *sampler, GLenum pname, const GLint *params);
void SetFramebufferParameteri(Framebuffer *framebuffer, GLenum pname, GLint param);
void SetProgramParameteri(Program *program, GLenum pname, GLint value);
GLint GetUniformResourceProperty(const Program *program, GLuint index, const GLenum prop);
GLuint QueryProgramResourceIndex(const Program *program,
GLenum programInterface,
const GLchar *name);
void QueryProgramResourceName(const Program *program,
GLenum programInterface,
GLuint index,
GLsizei bufSize,
GLsizei *length,
GLchar *name);
GLint QueryProgramResourceLocation(const Program *program,
GLenum programInterface,
const GLchar *name);
void QueryProgramResourceiv(const Program *program,
GLenum programInterface,
GLuint index,
GLsizei propCount,
const GLenum *props,
GLsizei bufSize,
GLsizei *length,
GLint *params);
void QueryProgramInterfaceiv(const Program *program,
GLenum programInterface,
GLenum pname,
GLint *params);
// GLES1 emulation
ClientVertexArrayType ParamToVertexArrayType(GLenum param);
void SetLightParameters(GLES1State *state,
GLenum light,
LightParameter pname,
const GLfloat *params);
void GetLightParameters(const GLES1State *state,
GLenum light,
LightParameter pname,
GLfloat *params);
void SetLightModelParameters(GLES1State *state, GLenum pname, const GLfloat *params);
void GetLightModelParameters(const GLES1State *state, GLenum pname, GLfloat *params);
bool IsLightModelTwoSided(const GLES1State *state);
void SetMaterialParameters(GLES1State *state,
GLenum face,
MaterialParameter pname,
const GLfloat *params);
void GetMaterialParameters(const GLES1State *state,
GLenum face,
MaterialParameter pname,
GLfloat *params);
unsigned int GetLightModelParameterCount(GLenum pname);
unsigned int GetLightParameterCount(LightParameter pname);
unsigned int GetMaterialParameterCount(MaterialParameter pname);
} // namespace gl
namespace egl
{
struct Config;
class Surface;
void QueryConfigAttrib(const Config *config, EGLint attribute, EGLint *value);
void QueryContextAttrib(const gl::Context *context, EGLint attribute, EGLint *value);
void QuerySurfaceAttrib(const Surface *surface, EGLint attribute, EGLint *value);
void SetSurfaceAttrib(Surface *surface, EGLint attribute, EGLint value);
} // namespace egl
#endif // LIBANGLE_QUERYUTILS_H_