1bf215546Sopenharmony_ci/* 2bf215546Sopenharmony_ci * Mesa 3-D graphics library 3bf215546Sopenharmony_ci * 4bf215546Sopenharmony_ci * Copyright (C) 2010 VMware, Inc. All Rights Reserved. 5bf215546Sopenharmony_ci * 6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 8bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation 9bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 11bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 12bf215546Sopenharmony_ci * 13bf215546Sopenharmony_ci * The above copyright notice and this permission notice shall be included 14bf215546Sopenharmony_ci * in all copies or substantial portions of the Software. 15bf215546Sopenharmony_ci * 16bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17bf215546Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20bf215546Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21bf215546Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22bf215546Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 23bf215546Sopenharmony_ci */ 24bf215546Sopenharmony_ci 25bf215546Sopenharmony_ci 26bf215546Sopenharmony_ci#ifndef UNIFORMS_H 27bf215546Sopenharmony_ci#define UNIFORMS_H 28bf215546Sopenharmony_ci 29bf215546Sopenharmony_ci#include "main/glheader.h" 30bf215546Sopenharmony_ci#include "compiler/glsl_types.h" 31bf215546Sopenharmony_ci#include "compiler/glsl/ir_uniform.h" 32bf215546Sopenharmony_ci#include "program/prog_parameter.h" 33bf215546Sopenharmony_ci 34bf215546Sopenharmony_ci#ifdef __cplusplus 35bf215546Sopenharmony_ciextern "C" { 36bf215546Sopenharmony_ci#endif 37bf215546Sopenharmony_ci 38bf215546Sopenharmony_ci 39bf215546Sopenharmony_cistruct gl_program; 40bf215546Sopenharmony_cistruct _glapi_table; 41bf215546Sopenharmony_ci 42bf215546Sopenharmony_civoid 43bf215546Sopenharmony_ci_mesa_uniform(GLint location, GLsizei count, const GLvoid *values, 44bf215546Sopenharmony_ci struct gl_context *, struct gl_shader_program *, 45bf215546Sopenharmony_ci enum glsl_base_type basicType, unsigned src_components); 46bf215546Sopenharmony_ci 47bf215546Sopenharmony_civoid 48bf215546Sopenharmony_ci_mesa_uniform_matrix(GLint location, GLsizei count, 49bf215546Sopenharmony_ci GLboolean transpose, const void *values, 50bf215546Sopenharmony_ci struct gl_context *, struct gl_shader_program *, 51bf215546Sopenharmony_ci GLuint cols, GLuint rows, enum glsl_base_type basicType); 52bf215546Sopenharmony_ci 53bf215546Sopenharmony_civoid 54bf215546Sopenharmony_ci_mesa_uniform_handle(GLint location, GLsizei count, const GLvoid *values, 55bf215546Sopenharmony_ci struct gl_context *, struct gl_shader_program *); 56bf215546Sopenharmony_ci 57bf215546Sopenharmony_civoid 58bf215546Sopenharmony_ci_mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location, 59bf215546Sopenharmony_ci GLsizei bufSize, enum glsl_base_type returnType, 60bf215546Sopenharmony_ci GLvoid *paramsOut); 61bf215546Sopenharmony_ci 62bf215546Sopenharmony_ciextern void 63bf215546Sopenharmony_ci_mesa_uniform_attach_driver_storage(struct gl_uniform_storage *, 64bf215546Sopenharmony_ci unsigned element_stride, 65bf215546Sopenharmony_ci unsigned vector_stride, 66bf215546Sopenharmony_ci enum gl_uniform_driver_format format, 67bf215546Sopenharmony_ci void *data); 68bf215546Sopenharmony_ci 69bf215546Sopenharmony_ciextern void 70bf215546Sopenharmony_ci_mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage *uni); 71bf215546Sopenharmony_ci 72bf215546Sopenharmony_ciextern void 73bf215546Sopenharmony_ci_mesa_propagate_uniforms_to_driver_storage(struct gl_uniform_storage *uni, 74bf215546Sopenharmony_ci unsigned array_index, 75bf215546Sopenharmony_ci unsigned count); 76bf215546Sopenharmony_ci 77bf215546Sopenharmony_civoid 78bf215546Sopenharmony_ci_mesa_ensure_and_associate_uniform_storage(struct gl_context *ctx, 79bf215546Sopenharmony_ci struct gl_shader_program *shader_program, 80bf215546Sopenharmony_ci struct gl_program *prog, unsigned required_space); 81bf215546Sopenharmony_ci 82bf215546Sopenharmony_ciextern void 83bf215546Sopenharmony_ci_mesa_update_shader_textures_used(struct gl_shader_program *shProg, 84bf215546Sopenharmony_ci struct gl_program *prog); 85bf215546Sopenharmony_ci 86bf215546Sopenharmony_ciextern bool 87bf215546Sopenharmony_ci_mesa_sampler_uniforms_are_valid(const struct gl_shader_program *shProg, 88bf215546Sopenharmony_ci char *errMsg, size_t errMsgLength); 89bf215546Sopenharmony_ciextern bool 90bf215546Sopenharmony_ci_mesa_sampler_uniforms_pipeline_are_valid(struct gl_pipeline_object *); 91bf215546Sopenharmony_ci 92bf215546Sopenharmony_ciextern void 93bf215546Sopenharmony_ci_mesa_flush_vertices_for_uniforms(struct gl_context *ctx, 94bf215546Sopenharmony_ci const struct gl_uniform_storage *uni); 95bf215546Sopenharmony_ci 96bf215546Sopenharmony_ciextern GLint 97bf215546Sopenharmony_ci_mesa_GetUniformLocation_impl(GLuint programObj, const GLcharARB *name, 98bf215546Sopenharmony_ci bool glthread); 99bf215546Sopenharmony_ci 100bf215546Sopenharmony_ciextern void 101bf215546Sopenharmony_ci_mesa_GetActiveUniform_impl(GLuint program, GLuint index, 102bf215546Sopenharmony_ci GLsizei maxLength, GLsizei *length, GLint *size, 103bf215546Sopenharmony_ci GLenum *type, GLcharARB *nameOut, bool glthread); 104bf215546Sopenharmony_ci 105bf215546Sopenharmony_cistruct gl_builtin_uniform_element { 106bf215546Sopenharmony_ci const char *field; 107bf215546Sopenharmony_ci gl_state_index16 tokens[STATE_LENGTH]; 108bf215546Sopenharmony_ci int swizzle; 109bf215546Sopenharmony_ci}; 110bf215546Sopenharmony_ci 111bf215546Sopenharmony_cistruct gl_builtin_uniform_desc { 112bf215546Sopenharmony_ci const char *name; 113bf215546Sopenharmony_ci const struct gl_builtin_uniform_element *elements; 114bf215546Sopenharmony_ci unsigned int num_elements; 115bf215546Sopenharmony_ci}; 116bf215546Sopenharmony_ci 117bf215546Sopenharmony_ci#ifdef __cplusplus 118bf215546Sopenharmony_ci} 119bf215546Sopenharmony_ci#endif 120bf215546Sopenharmony_ci 121bf215546Sopenharmony_ci 122bf215546Sopenharmony_ci#endif /* UNIFORMS_H */ 123