1f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry/* 2f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * Copyright © 2011 Intel Corporation 3f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * 4f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * Permission is hereby granted, free of charge, to any person obtaining a 5f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * copy of this software and associated documentation files (the "Software"), 6f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * to deal in the Software without restriction, including without limitation 7f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * and/or sell copies of the Software, and to permit persons to whom the 9f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * Software is furnished to do so, subject to the following conditions: 10f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * 11f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * The above copyright notice and this permission notice (including the next 12f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * paragraph) shall be included in all copies or substantial portions of the 13f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * Software. 14f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * 15f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * DEALINGS IN THE SOFTWARE. 22f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry */ 23f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry 24f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry/* This file declares stripped-down versions of functions that 25f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * normally exist outside of the glsl folder, so that they can be used 26f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * when running the GLSL compiler standalone (for unit testing or 27f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * compiling builtins). 28f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry */ 29f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry 30f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry#pragma once 31f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry#ifndef STANDALONE_SCAFFOLDING_H 32f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry#define STANDALONE_SCAFFOLDING_H 33f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry 34f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry#include "main/mtypes.h" 35f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry 36f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berryextern "C" void 37f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, 38f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry struct gl_shader *sh); 39f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry 40f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berryextern "C" struct gl_shader * 41f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type); 42f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry 43d5a10dba6464d6cc40b3abcd6b704fb087e1056cDylan Noblesmithextern "C" void 44d5a10dba6464d6cc40b3abcd6b704fb087e1056cDylan Noblesmith_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint id, 45d5a10dba6464d6cc40b3abcd6b704fb087e1056cDylan Noblesmith const char *msg, int len); 46d5a10dba6464d6cc40b3abcd6b704fb087e1056cDylan Noblesmith 47f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry/** 48f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * Initialize the given gl_context structure to a reasonable set of 49f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * defaults representing the minimum capabilities required by the 50f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * OpenGL spec. 51f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * 52f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * This is used when compiling builtin functions and in testing, when 53f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry * we don't have a connection to an actual driver. 54f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry */ 55f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berryvoid initialize_context_to_defaults(struct gl_context *ctx, gl_api api); 56f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry 57f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry 58f129f618fe8a5397774484f1b7afb42d4be809a0Paul Berry#endif /* STANDALONE_SCAFFOLDING_H */ 59