#include "util/ralloc.h"
#include "util/strtod.h"
-extern "C" void
-_mesa_error_no_memory(const char *caller)
-{
- fprintf(stderr, "Mesa error: out of memory in %s", caller);
-}
-
void
_mesa_warning(struct gl_context *ctx, const char *fmt, ...)
{
}
struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
+_mesa_new_shader(GLuint name, gl_shader_stage stage)
{
struct gl_shader *shader;
- (void) ctx;
-
- assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER);
+ assert(stage == MESA_SHADER_FRAGMENT || stage == MESA_SHADER_VERTEX);
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
- shader->Type = type;
- shader->Stage = _mesa_shader_enum_to_shader_stage(type);
+ shader->Stage = stage;
shader->Name = name;
shader->RefCount = 1;
}
return shader;
}
+struct gl_linked_shader *
+_mesa_new_linked_shader(gl_shader_stage stage)
+{
+ struct gl_linked_shader *shader;
+
+ assert(stage == MESA_SHADER_FRAGMENT || stage == MESA_SHADER_VERTEX);
+ shader = rzalloc(NULL, struct gl_linked_shader);
+ if (shader) {
+ shader->Stage = stage;
+ }
+ return shader;
+}
+
void
_mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh)
{
}
void
-_mesa_clear_shader_program_data(struct gl_shader_program *shProg)
+_mesa_delete_linked_shader(struct gl_context *ctx,
+ struct gl_linked_shader *sh)
{
- unsigned i;
+ ralloc_free(sh);
+}
+void
+_mesa_clear_shader_program_data(struct gl_shader_program *shProg)
+{
shProg->NumUniformStorage = 0;
shProg->UniformStorage = NULL;
shProg->NumUniformRemapTable = 0;
ralloc_free(shProg->InfoLog);
shProg->InfoLog = ralloc_strdup(shProg, "");
- ralloc_free(shProg->BufferInterfaceBlocks);
- shProg->BufferInterfaceBlocks = NULL;
- shProg->NumBufferInterfaceBlocks = 0;
-
ralloc_free(shProg->UniformBlocks);
shProg->UniformBlocks = NULL;
shProg->NumUniformBlocks = 0;
shProg->ShaderStorageBlocks = NULL;
shProg->NumShaderStorageBlocks = 0;
- for (i = 0; i < MESA_SHADER_STAGES; i++) {
- ralloc_free(shProg->InterfaceBlockStageIndex[i]);
- shProg->InterfaceBlockStageIndex[i] = NULL;
- }
-
- ralloc_free(shProg->UboInterfaceBlockIndex);
- shProg->UboInterfaceBlockIndex = NULL;
- ralloc_free(shProg->SsboInterfaceBlockIndex);
- shProg->SsboInterfaceBlockIndex = NULL;
-
ralloc_free(shProg->AtomicBuffers);
shProg->AtomicBuffers = NULL;
shProg->NumAtomicBuffers = 0;
ctx->Extensions.ARB_texture_query_lod = true;
ctx->Extensions.ARB_uniform_buffer_object = true;
ctx->Extensions.ARB_viewport_array = true;
+ ctx->Extensions.ARB_cull_distance = true;
ctx->Extensions.OES_EGL_image_external = true;
ctx->Extensions.OES_standard_derivatives = true;
ctx->Extensions.EXT_shader_integer_mix = true;
ctx->Extensions.EXT_texture_array = true;
+ ctx->Extensions.MESA_shader_integer_functions = true;
+
ctx->Extensions.NV_texture_rectangle = true;
ctx->Const.GLSLVersion = 120;