aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/acc2.c319
-rw-r--r--src/mesa/state_tracker/st_atom.c4
-rw-r--r--src/mesa/state_tracker/st_atom_constbuf.c2
-rw-r--r--src/mesa/state_tracker/st_atom_depth.c10
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c43
-rw-r--r--src/mesa/state_tracker/st_atom_sampler.c20
-rw-r--r--src/mesa/state_tracker/st_atom_shader.c6
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c22
-rw-r--r--src/mesa/state_tracker/st_cb_accum.c20
-rw-r--r--src/mesa/state_tracker/st_cb_bitmap.c6
-rw-r--r--src/mesa/state_tracker/st_cb_blit.c2
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c4
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c10
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c12
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c19
-rw-r--r--src/mesa/state_tracker/st_cb_feedback.c5
-rw-r--r--src/mesa/state_tracker/st_cb_flush.c10
-rw-r--r--src/mesa/state_tracker/st_cb_program.c12
-rw-r--r--src/mesa/state_tracker/st_cb_queryobj.c4
-rw-r--r--src/mesa/state_tracker/st_cb_rasterpos.c6
-rw-r--r--src/mesa/state_tracker/st_cb_strings.c8
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c12
-rw-r--r--src/mesa/state_tracker/st_context.c7
-rw-r--r--src/mesa/state_tracker/st_context.h4
-rw-r--r--src/mesa/state_tracker/st_draw.c30
-rw-r--r--src/mesa/state_tracker/st_draw_feedback.c2
-rw-r--r--src/mesa/state_tracker/st_extensions.c36
-rw-r--r--src/mesa/state_tracker/st_format.c97
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c57
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c25
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c35
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.h1
-rw-r--r--src/mesa/state_tracker/st_program.c12
-rw-r--r--src/mesa/state_tracker/st_public.h17
-rw-r--r--src/mesa/state_tracker/st_texture.c47
-rw-r--r--src/mesa/state_tracker/wgl/SConscript41
-rw-r--r--src/mesa/state_tracker/wgl/opengl32.def879
-rw-r--r--src/mesa/state_tracker/wgl/stw_device.c80
-rw-r--r--src/mesa/state_tracker/wgl/stw_device.h60
-rw-r--r--src/mesa/state_tracker/wgl/stw_framebuffer.c181
-rw-r--r--src/mesa/state_tracker/wgl/stw_framebuffer.h71
-rw-r--r--src/mesa/state_tracker/wgl/stw_icd.c637
-rw-r--r--src/mesa/state_tracker/wgl/stw_icd.h489
-rw-r--r--src/mesa/state_tracker/wgl/stw_pixelformat.c120
-rw-r--r--src/mesa/state_tracker/wgl/stw_pixelformat.h76
-rw-r--r--src/mesa/state_tracker/wgl/stw_quirks.c108
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl.c199
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl.h63
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.c42
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.h35
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_arbmultisample.c41
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_arbmultisample.h40
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.c513
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.h58
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_context.c291
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_context.h46
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_getprocaddress.c70
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c187
-rw-r--r--src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c74
-rw-r--r--src/mesa/state_tracker/wgl/stw_winsys.h60
60 files changed, 418 insertions, 4969 deletions
diff --git a/src/mesa/state_tracker/acc2.c b/src/mesa/state_tracker/acc2.c
deleted file mode 100644
index fa5de2b764c..00000000000
--- a/src/mesa/state_tracker/acc2.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Brian Paul
- */
-
-#include "main/imports.h"
-#include "main/image.h"
-#include "main/macros.h"
-
-#include "st_context.h"
-#include "st_cb_accum.h"
-#include "st_cb_fbo.h"
-#include "st_draw.h"
-#include "st_format.h"
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "pipe/p_inlines.h"
-#include "util/p_tile.h"
-
-
-#define UNCLAMPED_FLOAT_TO_SHORT(us, f) \
- us = ( (short) ( CLAMP((f), -1.0, 1.0) * 32767.0F) )
-
-
-/**
- * For hardware that supports deep color buffers, we could accelerate
- * most/all the accum operations with blending/texturing.
- * For now, just use the get/put_tile() functions and do things in software.
- */
-
-
-static void
-acc_get_tile_rgba(struct pipe_context *pipe, struct pipe_surface *acc_ps,
- uint x, uint y, uint w, uint h, float *p)
-{
- const enum pipe_format f = acc_ps->format;
- const int cpp = acc_ps->cpp;
-
- acc_ps->format = PIPE_FORMAT_R16G16B16A16_SNORM;
- acc_ps->cpp = 8;
-
- pipe_get_tile_rgba(pipe, acc_ps, x, y, w, h, p);
-
- acc_ps->format = f;
- acc_ps->cpp = cpp;
-}
-
-
-static void
-acc_put_tile_rgba(struct pipe_context *pipe, struct pipe_surface *acc_ps,
- uint x, uint y, uint w, uint h, const float *p)
-{
- enum pipe_format f = acc_ps->format;
- const int cpp = acc_ps->cpp;
-
- acc_ps->format = PIPE_FORMAT_R16G16B16A16_SNORM;
- acc_ps->cpp = 8;
-
- pipe_put_tile_rgba(pipe, acc_ps, x, y, w, h, p);
-
- acc_ps->format = f;
- acc_ps->cpp = cpp;
-}
-
-
-
-void
-st_clear_accum_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
-{
- struct pipe_context *pipe = ctx->st->pipe;
- struct st_renderbuffer *acc_strb = st_renderbuffer(rb);
- struct pipe_surface *acc_ps = acc_strb->surface;
- const GLint xpos = ctx->DrawBuffer->_Xmin;
- const GLint ypos = ctx->DrawBuffer->_Ymin;
- const GLint width = ctx->DrawBuffer->_Xmax - xpos;
- const GLint height = ctx->DrawBuffer->_Ymax - ypos;
- const GLfloat r = ctx->Accum.ClearColor[0];
- const GLfloat g = ctx->Accum.ClearColor[1];
- const GLfloat b = ctx->Accum.ClearColor[2];
- const GLfloat a = ctx->Accum.ClearColor[3];
- GLfloat *accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- int i;
-
-#if 1
- GLvoid *map;
-
- map = pipe_surface_map(acc_ps);
- switch (acc_strb->format) {
- case PIPE_FORMAT_R16G16B16A16_SNORM:
- {
- GLshort r = FLOAT_TO_SHORT(ctx->Accum.ClearColor[0]);
- GLshort g = FLOAT_TO_SHORT(ctx->Accum.ClearColor[1]);
- GLshort b = FLOAT_TO_SHORT(ctx->Accum.ClearColor[2]);
- GLshort a = FLOAT_TO_SHORT(ctx->Accum.ClearColor[3]);
- int i, j;
- for (i = 0; i < height; i++) {
- GLshort *dst = ((GLshort *) map
- + ((ypos + i) * acc_ps->pitch + xpos) * 4);
- for (j = 0; j < width; j++) {
- dst[0] = r;
- dst[1] = g;
- dst[2] = b;
- dst[3] = a;
- dst += 4;
- }
- }
- }
- break;
- default:
- _mesa_problem(ctx, "unexpected format in st_clear_accum_buffer()");
- }
-
- pipe_surface_unmap(acc_ps);
-
-#else
- for (i = 0; i < width * height; i++) {
- accBuf[i*4+0] = r;
- accBuf[i*4+1] = g;
- accBuf[i*4+2] = b;
- accBuf[i*4+3] = a;
- }
-
- acc_put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf);
-#endif
-}
-
-
-/** For ADD/MULT */
-static void
-accum_mad(struct pipe_context *pipe, GLfloat scale, GLfloat bias,
- GLint xpos, GLint ypos, GLint width, GLint height,
- struct pipe_surface *acc_ps)
-{
- GLfloat *accBuf;
- GLint i;
-
- accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
-
- pipe_get_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf);
-
- for (i = 0; i < 4 * width * height; i++) {
- accBuf[i] = accBuf[i] * scale + bias;
- }
-
- pipe_put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf);
-
- free(accBuf);
-}
-
-
-static void
-accum_accum(struct pipe_context *pipe, GLfloat value,
- GLint xpos, GLint ypos, GLint width, GLint height,
- struct pipe_surface *acc_ps,
- struct pipe_surface *color_ps)
-{
- GLfloat *colorBuf, *accBuf;
- GLint i;
-
- colorBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
-
- pipe_get_tile_rgba(pipe, color_ps, xpos, ypos, width, height, colorBuf);
- acc_get_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf);
-
- for (i = 0; i < 4 * width * height; i++) {
- accBuf[i] = accBuf[i] + colorBuf[i] * value;
- }
-
- acc_put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf);
-
- free(colorBuf);
- free(accBuf);
-}
-
-
-static void
-accum_load(struct pipe_context *pipe, GLfloat value,
- GLint xpos, GLint ypos, GLint width, GLint height,
- struct pipe_surface *acc_ps,
- struct pipe_surface *color_ps)
-{
- GLfloat *buf;
- GLint i;
-
- buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
-
- pipe_get_tile_rgba(pipe, color_ps, xpos, ypos, width, height, buf);
-
- for (i = 0; i < 4 * width * height; i++) {
- buf[i] = buf[i] * value;
- }
-
- acc_put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, buf);
-
- free(buf);
-}
-
-
-static void
-accum_return(GLcontext *ctx, GLfloat value,
- GLint xpos, GLint ypos, GLint width, GLint height,
- struct pipe_surface *acc_ps,
- struct pipe_surface *color_ps)
-{
- struct pipe_context *pipe = ctx->st->pipe;
- const GLubyte *colormask = ctx->Color.ColorMask;
- GLfloat *abuf, *cbuf = NULL;
- GLint i, ch;
-
- abuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
-
- acc_get_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, abuf);
-
- if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) {
- cbuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- pipe_get_tile_rgba(pipe, color_ps, xpos, ypos, width, height, cbuf);
- }
-
- for (i = 0; i < width * height; i++) {
- for (ch = 0; ch < 4; ch++) {
- if (colormask[ch]) {
- GLfloat val = abuf[i * 4 + ch] * value;
- abuf[i * 4 + ch] = CLAMP(val, 0.0, 1.0);
- }
- else {
- abuf[i * 4 + ch] = cbuf[i * 4 + ch];
- }
- }
- }
-
- pipe_put_tile_rgba(pipe, color_ps, xpos, ypos, width, height, abuf);
-
- free(abuf);
- if (cbuf)
- free(cbuf);
-}
-
-
-static void
-st_Accum(GLcontext *ctx, GLenum op, GLfloat value)
-{
- struct st_context *st = ctx->st;
- struct pipe_context *pipe = st->pipe;
- struct st_renderbuffer *acc_strb
- = st_renderbuffer(ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
- struct st_renderbuffer *color_strb
- = st_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
- struct pipe_surface *acc_ps = acc_strb->surface;
- struct pipe_surface *color_ps = color_strb->surface;
-
- const GLint xpos = ctx->DrawBuffer->_Xmin;
- const GLint ypos = ctx->DrawBuffer->_Ymin;
- const GLint width = ctx->DrawBuffer->_Xmax - xpos;
- const GLint height = ctx->DrawBuffer->_Ymax - ypos;
-
- /* make sure color bufs aren't cached */
- pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
-
- switch (op) {
- case GL_ADD:
- if (value != 0.0F) {
- accum_mad(pipe, 1.0, value, xpos, ypos, width, height, acc_ps);
- }
- break;
- case GL_MULT:
- if (value != 1.0F) {
- accum_mad(pipe, value, 0.0, xpos, ypos, width, height, acc_ps);
- }
- break;
- case GL_ACCUM:
- if (value != 0.0F) {
- accum_accum(pipe, value, xpos, ypos, width, height, acc_ps, color_ps);
- }
- break;
- case GL_LOAD:
- accum_load(pipe, value, xpos, ypos, width, height, acc_ps, color_ps);
- break;
- case GL_RETURN:
- accum_return(ctx, value, xpos, ypos, width, height, acc_ps, color_ps);
- break;
- default:
- assert(0);
- }
-}
-
-
-
-void st_init_accum_functions(struct dd_function_table *functions)
-{
- functions->Accum = st_Accum;
-}
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
index fc8587f4598..f79092291b0 100644
--- a/src/mesa/state_tracker/st_atom.c
+++ b/src/mesa/state_tracker/st_atom.c
@@ -69,7 +69,7 @@ void st_init_atoms( struct st_context *st )
{
GLuint i;
- st->atoms = malloc(sizeof(atoms));
+ st->atoms = _mesa_malloc(sizeof(atoms));
st->nr_atoms = sizeof(atoms)/sizeof(*atoms);
memcpy(st->atoms, atoms, sizeof(atoms));
@@ -92,7 +92,7 @@ void st_init_atoms( struct st_context *st )
void st_destroy_atoms( struct st_context *st )
{
if (st->atoms) {
- free(st->atoms);
+ _mesa_free(st->atoms);
st->atoms = NULL;
}
}
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index d02e51cb9a5..514b10cd022 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -92,8 +92,6 @@ void st_upload_constants( struct st_context *st,
pipe_buffer_unmap(pipe->screen, cbuf->buffer);
}
- cbuf->size = paramBytes;
-
st->pipe->set_constant_buffer(st->pipe, id, 0, cbuf);
}
else {
diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c
index 0e791ceb208..2d617bd95dc 100644
--- a/src/mesa/state_tracker/st_atom_depth.c
+++ b/src/mesa/state_tracker/st_atom_depth.c
@@ -112,8 +112,8 @@ update_depth_stencil_alpha(struct st_context *st)
dsa->stencil[0].zfail_op = gl_stencil_op_to_pipe(st->ctx->Stencil.ZFailFunc[0]);
dsa->stencil[0].zpass_op = gl_stencil_op_to_pipe(st->ctx->Stencil.ZPassFunc[0]);
dsa->stencil[0].ref_value = st->ctx->Stencil.Ref[0] & 0xff;
- dsa->stencil[0].value_mask = st->ctx->Stencil.ValueMask[0] & 0xff;
- dsa->stencil[0].write_mask = st->ctx->Stencil.WriteMask[0] & 0xff;
+ dsa->stencil[0].valuemask = st->ctx->Stencil.ValueMask[0] & 0xff;
+ dsa->stencil[0].writemask = st->ctx->Stencil.WriteMask[0] & 0xff;
if (st->ctx->Stencil._TestTwoSide) {
dsa->stencil[1].enabled = 1;
@@ -122,8 +122,8 @@ update_depth_stencil_alpha(struct st_context *st)
dsa->stencil[1].zfail_op = gl_stencil_op_to_pipe(st->ctx->Stencil.ZFailFunc[1]);
dsa->stencil[1].zpass_op = gl_stencil_op_to_pipe(st->ctx->Stencil.ZPassFunc[1]);
dsa->stencil[1].ref_value = st->ctx->Stencil.Ref[1] & 0xff;
- dsa->stencil[1].value_mask = st->ctx->Stencil.ValueMask[1] & 0xff;
- dsa->stencil[1].write_mask = st->ctx->Stencil.WriteMask[1] & 0xff;
+ dsa->stencil[1].valuemask = st->ctx->Stencil.ValueMask[1] & 0xff;
+ dsa->stencil[1].writemask = st->ctx->Stencil.WriteMask[1] & 0xff;
}
else {
dsa->stencil[1] = dsa->stencil[0];
@@ -134,7 +134,7 @@ update_depth_stencil_alpha(struct st_context *st)
if (st->ctx->Color.AlphaEnabled) {
dsa->alpha.enabled = 1;
dsa->alpha.func = st_compare_func_to_pipe(st->ctx->Color.AlphaFunc);
- dsa->alpha.ref = st->ctx->Color.AlphaRef;
+ dsa->alpha.ref_value = st->ctx->Color.AlphaRef;
}
cso_set_depth_stencil_alpha(st->cso_context, dsa);
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index 2916886610d..625efdd66b5 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -34,6 +34,7 @@
#include "st_context.h"
#include "st_atom.h"
#include "st_cb_fbo.h"
+#include "st_public.h"
#include "st_texture.h"
#include "pipe/p_context.h"
#include "pipe/p_inlines.h"
@@ -95,7 +96,7 @@ update_framebuffer_state( struct st_context *st )
struct pipe_framebuffer_state *framebuffer = &st->state.framebuffer;
struct gl_framebuffer *fb = st->ctx->DrawBuffer;
struct st_renderbuffer *strb;
- GLuint i, j;
+ GLuint i;
memset(framebuffer, 0, sizeof(*framebuffer));
@@ -107,21 +108,19 @@ update_framebuffer_state( struct st_context *st )
/* Examine Mesa's ctx->DrawBuffer->_ColorDrawBuffers state
* to determine which surfaces to draw to
*/
- framebuffer->num_cbufs = 0;
- for (j = 0; j < MAX_DRAW_BUFFERS; j++) {
- for (i = 0; i < fb->_NumColorDrawBuffers[j]; i++) {
- strb = st_renderbuffer(fb->_ColorDrawBuffers[j][i]);
-
- /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/
- if (strb->rtt) {
- /* rendering to a GL texture, may have to update surface */
- update_renderbuffer_surface(st, strb);
- }
+ framebuffer->nr_cbufs = 0;
+ for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
+ strb = st_renderbuffer(fb->_ColorDrawBuffers[i]);
- if (strb->surface) {
- framebuffer->cbufs[framebuffer->num_cbufs] = strb->surface;
- framebuffer->num_cbufs++;
- }
+ /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/
+ if (strb->rtt) {
+ /* rendering to a GL texture, may have to update surface */
+ update_renderbuffer_surface(st, strb);
+ }
+
+ if (strb->surface) {
+ framebuffer->cbufs[framebuffer->nr_cbufs] = strb->surface;
+ framebuffer->nr_cbufs++;
}
}
@@ -146,9 +145,19 @@ update_framebuffer_state( struct st_context *st )
cso_set_framebuffer(st->cso_context, framebuffer);
- if (fb->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT) {
+ if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) {
if (st->frontbuffer_status == FRONT_STATUS_COPY_OF_BACK) {
- /* XXX copy back buf to front? */
+ /* copy back color buffer to front color buffer */
+ struct st_framebuffer *stfb = (struct st_framebuffer *) fb;
+ struct pipe_surface *surf_front, *surf_back;
+ (void) st_get_framebuffer_surface(stfb, ST_SURFACE_FRONT_LEFT, &surf_front);
+ (void) st_get_framebuffer_surface(stfb, ST_SURFACE_BACK_LEFT, &surf_back);
+
+ st->pipe->surface_copy(st->pipe,
+ FALSE,
+ surf_front, 0, 0, /* dest */
+ surf_back, 0, 0, /* src */
+ fb->Width, fb->Height);
}
/* we're assuming we'll really draw to the front buffer */
st->frontbuffer_status = FRONT_STATUS_DIRTY;
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index cef61fb55c5..d7b904354f2 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -121,24 +121,30 @@ gl_filter_to_img_filter(GLenum filter)
static void
update_samplers(struct st_context *st)
{
- const struct st_fragment_program *fs = st->fp;
+ struct gl_vertex_program *vprog = st->ctx->VertexProgram._Current;
+ struct gl_fragment_program *fprog = st->ctx->FragmentProgram._Current;
+ const GLbitfield samplersUsed = (vprog->Base.SamplersUsed |
+ fprog->Base.SamplersUsed);
GLuint su;
st->state.num_samplers = 0;
- /*printf("%s samplers used = 0x%x\n", __FUNCTION__, fs->Base.Base.SamplersUsed);*/
-
/* loop over sampler units (aka tex image units) */
for (su = 0; su < st->ctx->Const.MaxTextureImageUnits; su++) {
struct pipe_sampler_state *sampler = st->state.samplers + su;
memset(sampler, 0, sizeof(*sampler));
- if (fs->Base.Base.SamplersUsed & (1 << su)) {
- GLuint texUnit = fs->Base.Base.SamplerUnits[su];
- const struct gl_texture_object *texobj
- = st->ctx->Texture.Unit[texUnit]._Current;
+ if (samplersUsed & (1 << su)) {
+ struct gl_texture_object *texobj;
+ GLuint texUnit;
+
+ if (fprog->Base.SamplersUsed & (1 << su))
+ texUnit = fprog->Base.SamplerUnits[su];
+ else
+ texUnit = vprog->Base.SamplerUnits[su];
+ texobj = st->ctx->Texture.Unit[texUnit]._Current;
if (!texobj) {
texobj = st_get_default_texture(st);
}
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index cbd414e2d3b..bed3ff4ae5b 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -165,7 +165,7 @@ find_translated_vp(struct st_context *st,
/* No? Allocate translated vp object now */
if (!xvp) {
- xvp = CALLOC_STRUCT(translated_vertex_program);
+ xvp = ST_CALLOC_STRUCT(translated_vertex_program);
xvp->frag_inputs = fragInputsRead;
xvp->master = stvp;
@@ -298,7 +298,7 @@ st_free_translated_vertex_programs(struct st_context *st,
while (xvp) {
next = xvp->next;
- free(xvp);
+ _mesa_free(xvp);
xvp = next;
}
}
@@ -313,7 +313,7 @@ get_passthrough_fs(struct st_context *st)
st->passthrough_fs =
util_make_fragment_passthrough_shader(st->pipe, &shader);
#if 0 /* We actually need to keep the tokens around at this time */
- free((void *) shader.tokens);
+ _mesa_free((void *) shader.tokens);
#endif
}
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index fb03766ff59..21f7321f97a 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -44,22 +44,30 @@
static void
update_textures(struct st_context *st)
{
+ struct gl_vertex_program *vprog = st->ctx->VertexProgram._Current;
struct gl_fragment_program *fprog = st->ctx->FragmentProgram._Current;
+ const GLbitfield samplersUsed = (vprog->Base.SamplersUsed |
+ fprog->Base.SamplersUsed);
GLuint su;
st->state.num_textures = 0;
- /*printf("%s samplers used = 0x%x\n", __FUNCTION__, fprog->Base.SamplersUsed);*/
-
- for (su = 0; su < st->ctx->Const.MaxTextureCoordUnits; su++) {
+ /* loop over sampler units (aka tex image units) */
+ for (su = 0; su < st->ctx->Const.MaxTextureImageUnits; su++) {
struct pipe_texture *pt = NULL;
- if (fprog->Base.SamplersUsed & (1 << su)) {
- const GLuint texUnit = fprog->Base.SamplerUnits[su];
- struct gl_texture_object *texObj
- = st->ctx->Texture.Unit[texUnit]._Current;
+ if (samplersUsed & (1 << su)) {
+ struct gl_texture_object *texObj;
struct st_texture_object *stObj;
GLboolean flush, retval;
+ GLuint texUnit;
+
+ if (fprog->Base.SamplersUsed & (1 << su))
+ texUnit = fprog->Base.SamplerUnits[su];
+ else
+ texUnit = vprog->Base.SamplerUnits[su];
+
+ texObj = st->ctx->Texture.Unit[texUnit]._Current;
if (!texObj) {
texObj = st_get_default_texture(st);
diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c
index a4e72b48ed4..2fc37343bdf 100644
--- a/src/mesa/state_tracker/st_cb_accum.c
+++ b/src/mesa/state_tracker/st_cb_accum.c
@@ -206,8 +206,8 @@ accum_accum(struct pipe_context *pipe, GLfloat value,
color_surf = screen->get_tex_surface(screen, color_strb->texture, 0, 0, 0,
PIPE_BUFFER_USAGE_CPU_READ);
- colorBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ colorBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
+ accBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, colorBuf);
acc_get_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, accBuf);
@@ -218,8 +218,8 @@ accum_accum(struct pipe_context *pipe, GLfloat value,
acc_put_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, accBuf);
- free(colorBuf);
- free(accBuf);
+ _mesa_free(colorBuf);
+ _mesa_free(accBuf);
pipe_surface_reference(&acc_surf, NULL);
pipe_surface_reference(&color_surf, NULL);
}
@@ -242,7 +242,7 @@ accum_load(struct pipe_context *pipe, GLfloat value,
color_surf = screen->get_tex_surface(screen, color_strb->texture, 0, 0, 0,
PIPE_BUFFER_USAGE_CPU_READ);
- buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, buf);
@@ -252,7 +252,7 @@ accum_load(struct pipe_context *pipe, GLfloat value,
acc_put_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, buf);
- free(buf);
+ _mesa_free(buf);
pipe_surface_reference(&acc_surf, NULL);
pipe_surface_reference(&color_surf, NULL);
}
@@ -271,7 +271,7 @@ accum_return(GLcontext *ctx, GLfloat value,
GLfloat *abuf, *cbuf = NULL;
GLint i, ch;
- abuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ abuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
acc_surf = screen->get_tex_surface(screen, acc_strb->texture, 0, 0, 0,
PIPE_BUFFER_USAGE_CPU_READ);
@@ -283,7 +283,7 @@ accum_return(GLcontext *ctx, GLfloat value,
acc_get_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, abuf);
if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) {
- cbuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ cbuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, cbuf);
}
@@ -301,9 +301,9 @@ accum_return(GLcontext *ctx, GLfloat value,
pipe_put_tile_rgba(color_surf, xpos, ypos, width, height, abuf);
- free(abuf);
+ _mesa_free(abuf);
if (cbuf)
- free(cbuf);
+ _mesa_free(cbuf);
pipe_surface_reference(&acc_surf, NULL);
pipe_surface_reference(&color_surf, NULL);
}
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index bc05ca6a2ff..da0ea645580 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -798,7 +798,7 @@ st_init_bitmap(struct st_context *st)
}
/* alloc bitmap cache object */
- st->bitmap.cache = CALLOC_STRUCT(bitmap_cache);
+ st->bitmap.cache = ST_CALLOC_STRUCT(bitmap_cache);
reset_cache(st);
}
@@ -821,13 +821,13 @@ st_destroy_bitmap(struct st_context *st)
}
if (st->bitmap.vbuf) {
- pipe_buffer_destroy(pipe->screen, st->bitmap.vbuf);
+ pipe_buffer_reference(pipe->screen, &st->bitmap.vbuf, NULL);
st->bitmap.vbuf = NULL;
}
if (st->bitmap.cache) {
pipe_texture_release(&st->bitmap.cache->texture);
- FREE(st->bitmap.cache);
+ _mesa_free(st->bitmap.cache);
st->bitmap.cache = NULL;
}
}
diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c
index 327bafeb986..28526234720 100644
--- a/src/mesa/state_tracker/st_cb_blit.c
+++ b/src/mesa/state_tracker/st_cb_blit.c
@@ -79,7 +79,7 @@ st_BlitFramebuffer(GLcontext *ctx,
struct st_renderbuffer *srcRb =
st_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
struct st_renderbuffer *dstRb =
- st_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]);
+ st_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
struct pipe_surface *srcSurf = srcRb->surface;
struct pipe_surface *dstSurf = dstRb->surface;
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 07fa2afce05..aba1cda9323 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -55,7 +55,7 @@
static struct gl_buffer_object *
st_bufferobj_alloc(GLcontext *ctx, GLuint name, GLenum target)
{
- struct st_buffer_object *st_obj = CALLOC_STRUCT(st_buffer_object);
+ struct st_buffer_object *st_obj = ST_CALLOC_STRUCT(st_buffer_object);
if (!st_obj)
return NULL;
@@ -80,7 +80,7 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object *obj)
if (st_obj->buffer)
pipe_buffer_reference(pipe->screen, &st_obj->buffer, NULL);
- free(st_obj);
+ _mesa_free(st_obj);
}
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index b6cea161634..0eddda23a7a 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -98,12 +98,12 @@ st_destroy_clear(struct st_context *st)
struct pipe_context *pipe = st->pipe;
if (st->clear.vert_shader.tokens) {
- FREE((void *) st->clear.vert_shader.tokens);
+ _mesa_free((void *) st->clear.vert_shader.tokens);
st->clear.vert_shader.tokens = NULL;
}
if (st->clear.frag_shader.tokens) {
- FREE((void *) st->clear.frag_shader.tokens);
+ _mesa_free((void *) st->clear.frag_shader.tokens);
st->clear.frag_shader.tokens = NULL;
}
@@ -116,7 +116,7 @@ st_destroy_clear(struct st_context *st)
st->clear.vs = NULL;
}
if (st->clear.vbuf) {
- pipe_buffer_destroy(pipe->screen, st->clear.vbuf);
+ pipe_buffer_reference(pipe->screen, &st->clear.vbuf, NULL);
st->clear.vbuf = NULL;
}
}
@@ -287,8 +287,8 @@ clear_with_quad(GLcontext *ctx,
depth_stencil.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE;
depth_stencil.stencil[0].zfail_op = PIPE_STENCIL_OP_REPLACE;
depth_stencil.stencil[0].ref_value = ctx->Stencil.Clear;
- depth_stencil.stencil[0].value_mask = 0xff;
- depth_stencil.stencil[0].write_mask = ctx->Stencil.WriteMask[0] & 0xff;
+ depth_stencil.stencil[0].valuemask = 0xff;
+ depth_stencil.stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff;
}
cso_set_depth_stencil_alpha(st->cso_context, &depth_stencil);
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 32bf21411da..cb4a01c22b6 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -896,7 +896,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
ubyte *buffer;
int i;
- buffer = malloc(width * height * sizeof(ubyte));
+ buffer = _mesa_malloc(width * height * sizeof(ubyte));
if (!buffer) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)");
return;
@@ -950,7 +950,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
}
- free(buffer);
+ _mesa_free(buffer);
/* unmap the stencil buffer */
screen->surface_unmap(screen, psDraw);
@@ -1056,19 +1056,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (type == GL_COLOR) {
/* alternate path using get/put_tile() */
- GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ GLfloat *buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(psRead, srcx, srcy, width, height, buf);
pipe_put_tile_rgba(psTex, 0, 0, width, height, buf);
- free(buf);
+ _mesa_free(buf);
}
else {
/* GL_DEPTH */
- GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
+ GLuint *buf = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint));
pipe_get_tile_z(psRead, srcx, srcy, width, height, buf);
pipe_put_tile_z(psTex, 0, 0, width, height, buf);
- free(buf);
+ _mesa_free(buf);
}
pipe_surface_reference(&psRead, NULL);
}
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index eece7dee112..611d78df0c4 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -42,7 +42,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
-#include "pipe/p_winsys.h"
+#include "pipe/p_screen.h"
#include "st_context.h"
#include "st_cb_fbo.h"
#include "st_cb_texture.h"
@@ -118,7 +118,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
template.height[0] = height;
template.depth[0] = 1;
template.last_level = 0;
- template.nr_samples = rb->Samples;
+ template.nr_samples = rb->NumSamples;
if (pf_is_depth_stencil(template.format)) {
template.tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL;
@@ -171,7 +171,6 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
surface_usage );
assert(strb->surface->texture);
- assert(strb->surface->buffer);
assert(strb->surface->format);
assert(strb->surface->block.size);
assert(strb->surface->block.width);
@@ -195,7 +194,7 @@ st_renderbuffer_delete(struct gl_renderbuffer *rb)
ASSERT(strb);
pipe_surface_reference(&strb->surface, NULL);
pipe_texture_reference(&strb->texture, NULL);
- free(strb);
+ _mesa_free(strb);
}
@@ -233,7 +232,7 @@ st_new_framebuffer(GLcontext *ctx, GLuint name)
static struct gl_renderbuffer *
st_new_renderbuffer(GLcontext *ctx, GLuint name)
{
- struct st_renderbuffer *strb = CALLOC_STRUCT(st_renderbuffer);
+ struct st_renderbuffer *strb = ST_CALLOC_STRUCT(st_renderbuffer);
if (strb) {
_mesa_init_renderbuffer(&strb->Base, name);
strb->Base.Delete = st_renderbuffer_delete;
@@ -255,7 +254,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples)
{
struct st_renderbuffer *strb;
- strb = CALLOC_STRUCT(st_renderbuffer);
+ strb = ST_CALLOC_STRUCT(st_renderbuffer);
if (!strb) {
_mesa_error(NULL, GL_OUT_OF_MEMORY, "creating renderbuffer");
return NULL;
@@ -263,7 +262,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples)
_mesa_init_renderbuffer(&strb->Base, 0);
strb->Base.ClassID = 0x4242; /* just a unique value */
- strb->Base.Samples = samples;
+ strb->Base.NumSamples = samples;
strb->format = format;
switch (format) {
@@ -354,11 +353,13 @@ st_render_texture(GLcontext *ctx,
{
struct st_renderbuffer *strb;
struct gl_renderbuffer *rb;
- struct pipe_texture *pt;
+ struct pipe_texture *pt = st_get_texobj_texture(att->Texture);
struct st_texture_object *stObj;
const struct gl_texture_image *texImage =
att->Texture->Image[att->CubeMapFace][att->TextureLevel];
+ if (!pt)
+ return;
assert(!att->Renderbuffer);
@@ -387,8 +388,6 @@ st_render_texture(GLcontext *ctx,
rb->Height = texImage->Height2;
/*printf("***** render to texture level %d: %d x %d\n", att->TextureLevel, rb->Width, rb->Height);*/
- pt = st_get_texobj_texture(att->Texture);
- assert(pt);
/*printf("***** pipe texture %d x %d\n", pt->width[0], pt->height[0]);*/
pipe_texture_reference( &strb->texture, pt );
diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c
index 19021411cfc..86d35422622 100644
--- a/src/mesa/state_tracker/st_cb_feedback.c
+++ b/src/mesa/state_tracker/st_cb_feedback.c
@@ -52,7 +52,6 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
-#include "pipe/p_winsys.h"
#include "cso_cache/cso_cache.h"
#include "draw/draw_context.h"
@@ -185,7 +184,7 @@ feedback_destroy( struct draw_stage *stage )
static struct draw_stage *
draw_glfeedback_stage(GLcontext *ctx, struct draw_context *draw)
{
- struct feedback_stage *fs = CALLOC_STRUCT(feedback_stage);
+ struct feedback_stage *fs = ST_CALLOC_STRUCT(feedback_stage);
fs->stage.draw = draw;
fs->stage.next = NULL;
@@ -258,7 +257,7 @@ select_destroy( struct draw_stage *stage )
static struct draw_stage *
draw_glselect_stage(GLcontext *ctx, struct draw_context *draw)
{
- struct feedback_stage *fs = CALLOC_STRUCT(feedback_stage);
+ struct feedback_stage *fs = ST_CALLOC_STRUCT(feedback_stage);
fs->stage.draw = draw;
fs->stage.next = NULL;
diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c
index 072f2e92ad7..f8621ab125f 100644
--- a/src/mesa/state_tracker/st_cb_flush.c
+++ b/src/mesa/state_tracker/st_cb_flush.c
@@ -42,7 +42,7 @@
#include "st_public.h"
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
-#include "pipe/p_winsys.h"
+#include "pipe/p_screen.h"
#include "util/u_gen_mipmap.h"
#include "util/u_blit.h"
@@ -55,7 +55,7 @@ is_front_buffer_dirty(struct st_context *st)
/**
- * Tell the winsys to display the front color buffer on-screen.
+ * Tell the screen to display the front color buffer on-screen.
*/
static void
display_front_buffer(struct st_context *st)
@@ -67,7 +67,7 @@ display_front_buffer(struct st_context *st)
/* Hook for copying "fake" frontbuffer if necessary:
*/
- st->pipe->winsys->flush_frontbuffer( st->pipe->winsys, front_surf,
+ st->pipe->screen->flush_frontbuffer( st->pipe->screen, front_surf,
st->pipe->priv );
/*
@@ -103,8 +103,8 @@ void st_finish( struct st_context *st )
st_flush(st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
if(fence) {
- st->pipe->winsys->fence_finish(st->pipe->winsys, fence, 0);
- st->pipe->winsys->fence_reference(st->pipe->winsys, &fence, NULL);
+ st->pipe->screen->fence_finish(st->pipe->screen, fence, 0);
+ st->pipe->screen->fence_reference(st->pipe->screen, &fence, NULL);
}
}
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index ea0fa20012e..4398ab28392 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -99,7 +99,7 @@ static struct gl_program *st_new_program( GLcontext *ctx,
{
switch (target) {
case GL_VERTEX_PROGRAM_ARB: {
- struct st_vertex_program *prog = CALLOC_STRUCT(st_vertex_program);
+ struct st_vertex_program *prog = ST_CALLOC_STRUCT(st_vertex_program);
prog->serialNo = SerialNo++;
@@ -111,7 +111,7 @@ static struct gl_program *st_new_program( GLcontext *ctx,
case GL_FRAGMENT_PROGRAM_ARB:
case GL_FRAGMENT_PROGRAM_NV: {
- struct st_fragment_program *prog = CALLOC_STRUCT(st_fragment_program);
+ struct st_fragment_program *prog = ST_CALLOC_STRUCT(st_fragment_program);
prog->serialNo = SerialNo++;
@@ -152,7 +152,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog)
}
if (stvp->state.tokens) {
- FREE((void *) stvp->state.tokens);
+ _mesa_free((void *) stvp->state.tokens);
stvp->state.tokens = NULL;
}
}
@@ -167,7 +167,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog)
}
if (stfp->state.tokens) {
- FREE((void *) stfp->state.tokens);
+ _mesa_free((void *) stfp->state.tokens);
stfp->state.tokens = NULL;
}
@@ -214,7 +214,7 @@ static void st_program_string_notify( GLcontext *ctx,
}
if (stfp->state.tokens) {
- FREE((void *) stfp->state.tokens);
+ _mesa_free((void *) stfp->state.tokens);
stfp->state.tokens = NULL;
}
@@ -242,7 +242,7 @@ static void st_program_string_notify( GLcontext *ctx,
}
if (stvp->state.tokens) {
- FREE((void *) stvp->state.tokens);
+ _mesa_free((void *) stvp->state.tokens);
stvp->state.tokens = NULL;
}
diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c
index 21c2c7dd9ff..dcf4c38eb61 100644
--- a/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/src/mesa/state_tracker/st_cb_queryobj.c
@@ -64,7 +64,7 @@ st_query_object(struct gl_query_object *q)
static struct gl_query_object *
st_NewQueryObject(GLcontext *ctx, GLuint id)
{
- struct st_query_object *stq = CALLOC_STRUCT(st_query_object);
+ struct st_query_object *stq = ST_CALLOC_STRUCT(st_query_object);
if (stq) {
stq->base.Id = id;
stq->base.Ready = GL_TRUE;
@@ -87,7 +87,7 @@ st_DeleteQuery(GLcontext *ctx, struct gl_query_object *q)
stq->pq = NULL;
}
- FREE(stq);
+ _mesa_free(stq);
}
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c
index 3eaccb74e17..7dd23527399 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -102,7 +102,7 @@ rastpos_line( struct draw_stage *stage, struct prim_header *prim )
static void
rastpos_destroy(struct draw_stage *stage)
{
- free(stage);
+ _mesa_free(stage);
}
@@ -162,7 +162,7 @@ rastpos_point(struct draw_stage *stage, struct prim_header *prim)
ctx->Current.RasterSecondaryColor,
VERT_RESULT_COL1, VERT_ATTRIB_COLOR1);
- for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
update_attrib(ctx, outputMapping, prim->v[0],
ctx->Current.RasterTexCoords[i],
VERT_RESULT_TEX0 + i, VERT_ATTRIB_TEX0 + i);
@@ -180,7 +180,7 @@ rastpos_point(struct draw_stage *stage, struct prim_header *prim)
static struct rastpos_stage *
new_draw_rastpos_stage(GLcontext *ctx, struct draw_context *draw)
{
- struct rastpos_stage *rs = CALLOC_STRUCT(rastpos_stage);
+ struct rastpos_stage *rs = ST_CALLOC_STRUCT(rastpos_stage);
GLuint i;
rs->stage.draw = draw;
diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c
index 066124f8f30..2036ccafbfb 100644
--- a/src/mesa/state_tracker/st_cb_strings.c
+++ b/src/mesa/state_tracker/st_cb_strings.c
@@ -36,11 +36,10 @@
#include "main/version.h"
#include "pipe/p_context.h"
#include "pipe/p_screen.h"
-#include "pipe/p_winsys.h"
#include "st_context.h"
#include "st_cb_strings.h"
-#define ST_VERSION_STRING "0.1"
+#define ST_VERSION_STRING "0.2"
static const GLubyte *
st_get_string(GLcontext * ctx, GLenum name)
@@ -67,10 +66,9 @@ st_get_string(GLcontext * ctx, GLenum name)
}
case GL_RENDERER:
- util_snprintf(st->renderer, sizeof(st->renderer), "Gallium %s, %s on %s",
+ util_snprintf(st->renderer, sizeof(st->renderer), "Gallium %s on %s",
ST_VERSION_STRING,
- screen->get_name( screen ),
- screen->winsys->get_name( screen->winsys ));
+ screen->get_name( screen ));
return (GLubyte *) st->renderer;
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 0b2b639a5bd..3dd1f1d737d 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -114,7 +114,7 @@ st_NewTextureImage(GLcontext * ctx)
{
DBG("%s\n", __FUNCTION__);
(void) ctx;
- return (struct gl_texture_image *) CALLOC_STRUCT(st_texture_image);
+ return (struct gl_texture_image *) ST_CALLOC_STRUCT(st_texture_image);
}
@@ -122,7 +122,7 @@ st_NewTextureImage(GLcontext * ctx)
static struct gl_texture_object *
st_NewTextureObject(GLcontext * ctx, GLuint name, GLenum target)
{
- struct st_texture_object *obj = CALLOC_STRUCT(st_texture_object);
+ struct st_texture_object *obj = ST_CALLOC_STRUCT(st_texture_object);
DBG("%s\n", __FUNCTION__);
_mesa_initialize_texture_object(&obj->base, name, target);
@@ -749,8 +749,8 @@ st_GetTexImage(GLcontext * ctx, GLenum target, GLint level,
static void
st_GetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
GLvoid *pixels,
- const struct gl_texture_object *texObj,
- const struct gl_texture_image *texImage)
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
{
st_get_tex_image(ctx, target, level, 0, 0, pixels,
(struct gl_texture_object *) texObj,
@@ -1417,9 +1417,7 @@ st_finalize_texture(GLcontext *ctx,
stObj->pt->width[0] != firstImage->base.Width2 ||
stObj->pt->height[0] != firstImage->base.Height2 ||
stObj->pt->depth[0] != firstImage->base.Depth2 ||
- stObj->pt->block.size != cpp ||
- stObj->pt->block.width != 1 ||
- stObj->pt->block.height != 1 ||
+ stObj->pt->block.size/stObj->pt->block.width != cpp || /* Nominal bytes per pixel */
stObj->pt->compressed != firstImage->base.IsCompressed) {
pipe_texture_release(&stObj->pt);
ctx->st->dirty.st |= ST_NEW_FRAMEBUFFER;
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index cca808d3288..6d6c9f43329 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -105,7 +105,7 @@ static struct st_context *
st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
{
uint i;
- struct st_context *st = CALLOC_STRUCT( st_context );
+ struct st_context *st = ST_CALLOC_STRUCT( st_context );
ctx->st = st;
@@ -148,7 +148,6 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
/* Need these flags:
*/
st->ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
- st->ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
st->ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
@@ -218,7 +217,7 @@ static void st_destroy_context_priv( struct st_context *st )
st->default_texture = NULL;
}
- free( st );
+ _mesa_free( st );
}
@@ -246,7 +245,7 @@ void st_destroy_context( struct st_context *st )
pipe->destroy( pipe );
- free(ctx);
+ _mesa_free(ctx);
}
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 695ac4a96f4..3547925ad7f 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -242,6 +242,10 @@ st_fb_orientation(const struct gl_framebuffer *fb)
}
+/** clear-alloc a struct-sized object, with casting */
+#define ST_CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T))
+
+
extern int
st_get_msaa(void);
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index e78d98f1e91..b52e4886128 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -223,7 +223,7 @@ setup_edgeflags(GLcontext *ctx, GLenum primMode, GLint start, GLint count,
if (!stobj)
return NULL;
- vec = (unsigned *) calloc(sizeof(unsigned), (count + 31) / 32);
+ vec = (unsigned *) _mesa_calloc(sizeof(unsigned) * ((count + 31) / 32));
if (!vec)
return NULL;
@@ -301,18 +301,17 @@ is_interleaved_arrays(const struct st_vertex_program *vp,
}
*userSpace = (num_client_arrays == vp->num_inputs);
- /*printf("user space: %d\n", (int) *userSpace);*/
+ /* printf("user space: %d (%d %d)\n", (int) *userSpace,num_client_arrays,vp->num_inputs); */
return GL_TRUE;
}
/**
- * Once we know all the arrays are in user space, this function
- * computes the memory range occupied by the arrays.
+ * Compute the memory range occupied by the arrays.
*/
static void
-get_user_arrays_bounds(const struct st_vertex_program *vp,
+get_arrays_bounds(const struct st_vertex_program *vp,
const struct gl_client_array **arrays,
GLuint max_index,
const GLubyte **low, const GLubyte **high)
@@ -366,22 +365,23 @@ setup_interleaved_attribs(GLcontext *ctx,
/*printf("stobj %u = %p\n", attr, (void*)stobj);*/
if (attr == 0) {
+ const GLubyte *low, *high;
+
+ get_arrays_bounds(vp, arrays, max_index, &low, &high);
+ /*printf("buffer range: %p %p %d\n", low, high, high-low);*/
+
+ offset0 = low;
if (userSpace) {
- const GLubyte *low, *high;
- get_user_arrays_bounds(vp, arrays, max_index, &low, &high);
- /*printf("user buffer range: %p %p %d\n", low, high, high-low);*/
vbuffer->buffer =
pipe_user_buffer_create(pipe->screen, (void *) low, high - low);
vbuffer->buffer_offset = 0;
- offset0 = low;
}
else {
vbuffer->buffer = NULL;
pipe_buffer_reference(pipe->screen, &vbuffer->buffer, stobj->buffer);
- vbuffer->buffer_offset = (unsigned) arrays[mesaAttr]->Ptr;
- offset0 = arrays[mesaAttr]->Ptr;
+ vbuffer->buffer_offset = (unsigned) low;
}
- vbuffer->pitch = stride; /* in bytes */
+ vbuffer->stride = stride; /* in bytes */
vbuffer->max_index = max_index;
}
@@ -472,7 +472,7 @@ setup_non_interleaved_attribs(GLcontext *ctx,
assert(velements[attr].src_offset <= 2048); /* 11-bit field */
/* common-case setup */
- vbuffer[attr].pitch = stride; /* in bytes */
+ vbuffer[attr].stride = stride; /* in bytes */
vbuffer[attr].max_index = max_index;
velements[attr].vertex_buffer_index = attr;
velements[attr].nr_components = arrays[mesaAttr]->Size;
@@ -541,9 +541,11 @@ st_draw_vbo(GLcontext *ctx,
vp = ctx->st->vp;
vs = &ctx->st->vp->state;
+#if 0
if (MESA_VERBOSE & VERBOSE_GLSL) {
check_uniforms(ctx);
}
+#endif
/*
* Setup the vbuffer[] and velements[] arrays.
@@ -569,7 +571,7 @@ st_draw_vbo(GLcontext *ctx,
{
GLuint i;
for (i = 0; i < num_vbuffers; i++) {
- printf("buffers[%d].pitch = %u\n", i, vbuffer[i].pitch);
+ printf("buffers[%d].stride = %u\n", i, vbuffer[i].stride);
printf("buffers[%d].max_index = %u\n", i, vbuffer[i].max_index);
printf("buffers[%d].buffer_offset = %u\n", i, vbuffer[i].buffer_offset);
printf("buffers[%d].buffer = %p\n", i, (void*) vbuffer[i].buffer);
diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c
index 834c3844c4f..5c9c4506c22 100644
--- a/src/mesa/state_tracker/st_draw_feedback.c
+++ b/src/mesa/state_tracker/st_draw_feedback.c
@@ -171,7 +171,7 @@ st_feedback_draw_vbo(GLcontext *ctx,
}
/* common-case setup */
- vbuffers[attr].pitch = arrays[mesaAttr]->StrideB; /* in bytes */
+ vbuffers[attr].stride = arrays[mesaAttr]->StrideB; /* in bytes */
vbuffers[attr].max_index = max_index;
velements[attr].vertex_buffer_index = attr;
velements[attr].nr_components = arrays[mesaAttr]->Size;
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 60fd440ef77..cd34529d385 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -1,6 +1,7 @@
/**************************************************************************
*
* Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright (c) 2008 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -83,12 +84,19 @@ void st_init_limits(struct st_context *st)
c->MaxTextureRectSize
= _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE);
- c->MaxTextureUnits
- = c->MaxTextureImageUnits
- = c->MaxTextureCoordUnits
+ c->MaxTextureImageUnits
= _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
MAX_TEXTURE_IMAGE_UNITS);
+ c->MaxVertexTextureImageUnits
+ = _min(screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS),
+ MAX_VERTEX_TEXTURE_IMAGE_UNITS);
+
+ c->MaxTextureCoordUnits
+ = _min(c->MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);
+
+ c->MaxTextureUnits = _min(c->MaxTextureImageUnits, c->MaxTextureCoordUnits);
+
c->MaxDrawBuffers
= _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
1, MAX_DRAW_BUFFERS);
@@ -116,7 +124,11 @@ void st_init_limits(struct st_context *st)
/**
- * XXX this needs careful review
+ * Use pipe_screen::get_param() to query PIPE_CAP_ values to determine
+ * which GL extensions are supported.
+ * Quite a few extensions are always supported because they are standard
+ * features or can be built on top of other gallium features.
+ * Some fine tuning may still be needed.
*/
void st_init_extensions(struct st_context *st)
{
@@ -126,10 +138,10 @@ void st_init_extensions(struct st_context *st)
/*
* Extensions that are supported by all Gallium drivers:
*/
- ctx->Extensions.ARB_multisample = GL_TRUE; /* API support */
+ ctx->Extensions.ARB_multisample = GL_TRUE;
ctx->Extensions.ARB_fragment_program = GL_TRUE;
ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; /* XXX temp */
- ctx->Extensions.ARB_texture_compression = GL_TRUE; /* API support only */
+ ctx->Extensions.ARB_texture_compression = GL_TRUE;
ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
@@ -160,7 +172,7 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.NV_texgen_reflection = GL_TRUE;
ctx->Extensions.SGI_color_matrix = GL_TRUE;
- ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; /* XXX temp */
+ ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
/*
* Extensions that depend on the driver/hardware:
@@ -238,19 +250,24 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
}
+ /* sRGB support */
if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SRGB,
PIPE_TEXTURE_2D,
+ PIPE_TEXTURE_USAGE_SAMPLER, 0) ||
+ screen->is_format_supported(screen, PIPE_FORMAT_A8R8G8B8_SRGB,
+ PIPE_TEXTURE_2D,
PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
}
-#if 01
+ /* s3tc support */
if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA,
PIPE_TEXTURE_2D,
PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE;
}
-#endif
+
+ /* ycbcr support */
if (screen->is_format_supported(screen, PIPE_FORMAT_YCBCR,
PIPE_TEXTURE_2D,
PIPE_TEXTURE_USAGE_SAMPLER, 0) ||
@@ -259,5 +276,4 @@ void st_init_extensions(struct st_context *st)
PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
ctx->Extensions.MESA_ycbcr_texture = GL_TRUE;
}
-
}
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index a8ae30a454f..9e2d60c9269 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -1,6 +1,7 @@
/**************************************************************************
*
* Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright (c) 2008 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -263,6 +264,28 @@ st_mesa_format_to_pipe_format(GLuint mesaFormat)
return PIPE_FORMAT_DXT3_RGBA;
case MESA_FORMAT_RGBA_DXT5:
return PIPE_FORMAT_DXT5_RGBA;
+#if FEATURE_EXT_texture_sRGB
+ case MESA_FORMAT_SRGB_DXT1:
+ return PIPE_FORMAT_DXT1_SRGB;
+ case MESA_FORMAT_SRGBA_DXT1:
+ return PIPE_FORMAT_DXT1_SRGBA;
+ case MESA_FORMAT_SRGBA_DXT3:
+ return PIPE_FORMAT_DXT3_SRGBA;
+ case MESA_FORMAT_SRGBA_DXT5:
+ return PIPE_FORMAT_DXT5_SRGBA;
+#endif
+#endif
+#if FEATURE_EXT_texture_sRGB
+ case MESA_FORMAT_SLA8:
+ return PIPE_FORMAT_A8L8_SRGB;
+ case MESA_FORMAT_SL8:
+ return PIPE_FORMAT_L8_SRGB;
+ case MESA_FORMAT_SRGB8:
+ return PIPE_FORMAT_R8G8B8_SRGB;
+ case MESA_FORMAT_SRGBA8:
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
+ case MESA_FORMAT_SARGB8:
+ return PIPE_FORMAT_A8R8G8B8_SRGB;
#endif
default:
assert(0);
@@ -294,6 +317,28 @@ default_rgba_format(struct pipe_screen *screen,
return PIPE_FORMAT_NONE;
}
+/**
+ * Find an sRGBA format supported by the context/winsys.
+ */
+static enum pipe_format
+default_srgba_format(struct pipe_screen *screen,
+ enum pipe_texture_target target,
+ unsigned tex_usage,
+ unsigned geom_flags)
+{
+ static const enum pipe_format colorFormats[] = {
+ PIPE_FORMAT_A8R8G8B8_SRGB,
+ PIPE_FORMAT_B8G8R8A8_SRGB,
+ PIPE_FORMAT_R8G8B8A8_SRGB,
+ };
+ uint i;
+ for (i = 0; i < Elements(colorFormats); i++) {
+ if (screen->is_format_supported( screen, colorFormats[i], target, tex_usage, geom_flags )) {
+ return colorFormats[i];
+ }
+ }
+ return PIPE_FORMAT_NONE;
+}
/**
* Search list of formats for first RGBA format with >8 bits/channel.
@@ -512,6 +557,36 @@ st_choose_format(struct pipe_context *pipe, GLint internalFormat,
return PIPE_FORMAT_Z24S8_UNORM;
return PIPE_FORMAT_NONE;
+ case GL_SRGB_EXT:
+ case GL_SRGB8_EXT:
+ case GL_COMPRESSED_SRGB_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_EXT:
+ case GL_SRGB_ALPHA_EXT:
+ case GL_SRGB8_ALPHA8_EXT:
+ return default_srgba_format( screen, target, tex_usage, geom_flags );
+ case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ return PIPE_FORMAT_DXT1_SRGB;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ return PIPE_FORMAT_DXT1_SRGBA;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ return PIPE_FORMAT_DXT3_SRGBA;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
+ return PIPE_FORMAT_DXT5_SRGBA;
+
+ case GL_SLUMINANCE_ALPHA_EXT:
+ case GL_SLUMINANCE8_ALPHA8_EXT:
+ case GL_COMPRESSED_SLUMINANCE_EXT:
+ case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
+ if (screen->is_format_supported( screen, PIPE_FORMAT_A8L8_SRGB, target, tex_usage, geom_flags ))
+ return PIPE_FORMAT_A8L8_SRGB;
+ return default_srgba_format( screen, target, tex_usage, geom_flags );
+
+ case GL_SLUMINANCE_EXT:
+ case GL_SLUMINANCE8_EXT:
+ if (screen->is_format_supported( screen, PIPE_FORMAT_L8_SRGB, target, tex_usage, geom_flags ))
+ return PIPE_FORMAT_L8_SRGB;
+ return default_srgba_format( screen, target, tex_usage, geom_flags );
+
default:
return PIPE_FORMAT_NONE;
}
@@ -591,6 +666,28 @@ translate_gallium_format_to_mesa_format(enum pipe_format format)
return &_mesa_texformat_rgba_dxt3;
case PIPE_FORMAT_DXT5_RGBA:
return &_mesa_texformat_rgba_dxt5;
+#if FEATURE_EXT_texture_sRGB
+ case PIPE_FORMAT_DXT1_SRGB:
+ return &_mesa_texformat_srgb_dxt1;
+ case PIPE_FORMAT_DXT1_SRGBA:
+ return &_mesa_texformat_srgba_dxt1;
+ case PIPE_FORMAT_DXT3_SRGBA:
+ return &_mesa_texformat_srgba_dxt3;
+ case PIPE_FORMAT_DXT5_SRGBA:
+ return &_mesa_texformat_srgba_dxt5;
+#endif
+#endif
+#if FEATURE_EXT_texture_sRGB
+ case PIPE_FORMAT_A8L8_SRGB:
+ return &_mesa_texformat_sla8;
+ case PIPE_FORMAT_L8_SRGB:
+ return &_mesa_texformat_sl8;
+ case PIPE_FORMAT_R8G8B8_SRGB:
+ return &_mesa_texformat_srgb8;
+ case PIPE_FORMAT_R8G8B8A8_SRGB:
+ return &_mesa_texformat_srgba8;
+ case PIPE_FORMAT_A8R8G8B8_SRGB:
+ return &_mesa_texformat_sargb8;
#endif
/* XXX add additional cases */
default:
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index 7d270a32729..0d4474a8b3a 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -33,9 +33,9 @@
#include "main/matrix.h"
#include "main/renderbuffer.h"
#include "main/scissor.h"
-#include "st_public.h"
#include "st_context.h"
#include "st_cb_fbo.h"
+#include "st_public.h"
#include "pipe/p_defines.h"
#include "pipe/p_context.h"
#include "pipe/p_inlines.h"
@@ -49,7 +49,7 @@ st_create_framebuffer( const __GLcontextModes *visual,
uint width, uint height,
void *private)
{
- struct st_framebuffer *stfb = CALLOC_STRUCT(st_framebuffer);
+ struct st_framebuffer *stfb = ST_CALLOC_STRUCT(st_framebuffer);
if (stfb) {
int samples = st_get_msaa();
@@ -153,9 +153,9 @@ void st_resize_framebuffer( struct st_framebuffer *stfb,
}
-void st_unreference_framebuffer( struct st_framebuffer **stfb )
+void st_unreference_framebuffer( struct st_framebuffer *stfb )
{
- _mesa_unreference_framebuffer((struct gl_framebuffer **) stfb);
+ _mesa_unreference_framebuffer((struct gl_framebuffer **) &stfb);
}
@@ -169,6 +169,7 @@ void
st_set_framebuffer_surface(struct st_framebuffer *stfb,
uint surfIndex, struct pipe_surface *surf)
{
+ GET_CURRENT_CONTEXT(ctx);
static const GLuint invalid_size = 9999999;
struct st_renderbuffer *strb;
GLuint width, height, i;
@@ -176,12 +177,23 @@ st_set_framebuffer_surface(struct st_framebuffer *stfb,
assert(surfIndex < BUFFER_COUNT);
strb = st_renderbuffer(stfb->Base.Attachment[surfIndex].Renderbuffer);
- assert(strb);
+
+ /* fail */
+ if (!strb) return;
/* replace the renderbuffer's surface/texture pointers */
pipe_surface_reference( &strb->surface, surf );
pipe_texture_reference( &strb->texture, surf->texture );
+ if (ctx) {
+ /* If ctx isn't set, we've likely not made current yet.
+ * But when we do, we need to start setting this dirty bit
+ * to ensure the renderbuffer attachements are up-to-date
+ * via update_framebuffer.
+ */
+ ctx->st->dirty.st |= ST_NEW_FRAMEBUFFER;
+ }
+
/* update renderbuffer's width/height */
strb->Base.Width = surf->width;
strb->Base.Height = surf->height;
@@ -218,8 +230,8 @@ st_set_framebuffer_surface(struct st_framebuffer *stfb,
/**
* Return the pipe_surface for the given renderbuffer.
*/
-struct pipe_surface *
-st_get_framebuffer_surface(struct st_framebuffer *stfb, uint surfIndex)
+int
+st_get_framebuffer_surface(struct st_framebuffer *stfb, uint surfIndex, struct pipe_surface **surface)
{
struct st_renderbuffer *strb;
@@ -230,13 +242,17 @@ st_get_framebuffer_surface(struct st_framebuffer *stfb, uint surfIndex)
assert(ST_SURFACE_BACK_RIGHT == BUFFER_BACK_RIGHT);
strb = st_renderbuffer(stfb->Base.Attachment[surfIndex].Renderbuffer);
- if (strb)
- return strb->surface;
- return NULL;
+ if (strb) {
+ *surface = strb->surface;
+ return GL_TRUE;
+ }
+
+ *surface = NULL;
+ return GL_FALSE;
}
-struct pipe_texture *
-st_get_framebuffer_texture(struct st_framebuffer *stfb, uint surfIndex)
+int
+st_get_framebuffer_texture(struct st_framebuffer *stfb, uint surfIndex, struct pipe_texture **texture)
{
struct st_renderbuffer *strb;
@@ -247,9 +263,13 @@ st_get_framebuffer_texture(struct st_framebuffer *stfb, uint surfIndex)
assert(ST_SURFACE_BACK_RIGHT == BUFFER_BACK_RIGHT);
strb = st_renderbuffer(stfb->Base.Attachment[surfIndex].Renderbuffer);
- if (strb)
- return strb->texture;
- return NULL;
+ if (strb) {
+ *texture = strb->texture;
+ return GL_TRUE;
+ }
+
+ *texture = NULL;
+ return GL_FALSE;
}
/**
@@ -304,3 +324,10 @@ void *st_framebuffer_private( struct st_framebuffer *stfb )
return stfb->Private;
}
+void st_get_framebuffer_dimensions( struct st_framebuffer *stfb,
+ uint *width,
+ uint *height)
+{
+ *width = stfb->Base.Width;
+ *height = stfb->Base.Height;
+}
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index b9d114b1c97..6a3455aaba2 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -128,24 +128,24 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
dstSurf = screen->get_tex_surface(screen, pt, face, dstLevel, zslice,
PIPE_BUFFER_USAGE_CPU_WRITE);
- srcData = (ubyte *) pipe_buffer_map(pipe->screen, srcSurf->buffer,
- PIPE_BUFFER_USAGE_CPU_READ)
+ srcData = (ubyte *) pipe_surface_map(srcSurf,
+ PIPE_BUFFER_USAGE_CPU_READ)
+ srcSurf->offset;
- dstData = (ubyte *) pipe_buffer_map(pipe->screen, dstSurf->buffer,
- PIPE_BUFFER_USAGE_CPU_WRITE)
+ dstData = (ubyte *) pipe_surface_map(dstSurf,
+ PIPE_BUFFER_USAGE_CPU_WRITE)
+ dstSurf->offset;
_mesa_generate_mipmap_level(target, datatype, comps,
0 /*border*/,
pt->width[srcLevel], pt->height[srcLevel], pt->depth[srcLevel],
- srcSurf->stride, /* stride in bytes */
srcData,
+ srcSurf->stride, /* stride in bytes */
pt->width[dstLevel], pt->height[dstLevel], pt->depth[dstLevel],
- dstSurf->stride, /* stride in bytes */
- dstData);
+ dstData,
+ dstSurf->stride); /* stride in bytes */
- pipe_buffer_unmap(pipe->screen, srcSurf->buffer);
- pipe_buffer_unmap(pipe->screen, dstSurf->buffer);
+ pipe_surface_unmap(srcSurf);
+ pipe_surface_unmap(dstSurf);
pipe_surface_reference(&srcSurf, NULL);
pipe_surface_reference(&dstSurf, NULL);
@@ -160,9 +160,14 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
struct st_context *st = ctx->st;
struct pipe_texture *pt = st_get_texobj_texture(texObj);
const uint baseLevel = texObj->BaseLevel;
- const uint lastLevel = pt->last_level;
+ uint lastLevel;
uint dstLevel;
+ if (!pt)
+ return;
+
+ lastLevel = pt->last_level;
+
if (!st_render_mipmap(st, target, pt, baseLevel, lastLevel)) {
fallback_generate_mipmap(ctx, target, texObj);
}
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index b3a9f6594b2..862d29fb1bd 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -41,7 +41,7 @@
#include "shader/prog_instruction.h"
#include "shader/prog_parameter.h"
#include "shader/prog_print.h"
-#include "pipe/p_debug.h"
+#include "util/u_debug.h"
/*
* Map mesa register file to TGSI register file.
@@ -188,7 +188,7 @@ make_immediate(const float *value, uint size)
struct tgsi_full_immediate imm;
imm = tgsi_default_full_immediate();
- imm.Immediate.Size += size;
+ imm.Immediate.NrTokens += size;
imm.Immediate.DataType = TGSI_IMM_FLOAT32;
imm.u.Pointer = value;
return imm;
@@ -346,6 +346,12 @@ compile_instruction(
case OPCODE_DDY:
fullinst->Instruction.Opcode = TGSI_OPCODE_DDY;
break;
+ case OPCODE_DP2:
+ fullinst->Instruction.Opcode = TGSI_OPCODE_DP2;
+ break;
+ case OPCODE_DP2A:
+ fullinst->Instruction.Opcode = TGSI_OPCODE_DP2A;
+ break;
case OPCODE_DP3:
fullinst->Instruction.Opcode = TGSI_OPCODE_DP3;
break;
@@ -389,8 +395,8 @@ compile_instruction(
fullinst->Instruction.Opcode = TGSI_OPCODE_IF;
fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size;
break;
- case OPCODE_INT:
- fullinst->Instruction.Opcode = TGSI_OPCODE_INT;
+ case OPCODE_TRUNC:
+ fullinst->Instruction.Opcode = TGSI_OPCODE_TRUNC;
break;
case OPCODE_KIL:
/* conditional */
@@ -443,6 +449,12 @@ compile_instruction(
case OPCODE_NOP:
fullinst->Instruction.Opcode = TGSI_OPCODE_NOP;
break;
+ case OPCODE_NRM3:
+ fullinst->Instruction.Opcode = TGSI_OPCODE_NRM;
+ break;
+ case OPCODE_NRM4:
+ fullinst->Instruction.Opcode = TGSI_OPCODE_NRM4;
+ break;
case OPCODE_POW:
fullinst->Instruction.Opcode = TGSI_OPCODE_POW;
break;
@@ -463,15 +475,6 @@ compile_instruction(
break;
case OPCODE_RSQ:
fullinst->Instruction.Opcode = TGSI_OPCODE_RSQ;
-
- /* KW: Don't do this here. If particular hardware needs to do
- * this, can do so in the driver..
- */
-#if 0
- tgsi_util_set_full_src_register_sign_mode(
- &fullinst->FullSrcRegisters[0],
- TGSI_UTIL_SIGN_CLEAR );
-#endif
break;
case OPCODE_SCS:
fullinst->Instruction.Opcode = TGSI_OPCODE_SCS;
@@ -498,6 +501,9 @@ compile_instruction(
case OPCODE_SNE:
fullinst->Instruction.Opcode = TGSI_OPCODE_SNE;
break;
+ case OPCODE_SSG:
+ fullinst->Instruction.Opcode = TGSI_OPCODE_SSG;
+ break;
case OPCODE_SUB:
fullinst->Instruction.Opcode = TGSI_OPCODE_SUB;
break;
@@ -730,6 +736,7 @@ find_temporaries(const struct gl_program *program,
*/
GLuint
st_translate_mesa_program(
+ GLcontext *ctx,
uint procType,
const struct gl_program *program,
GLuint numInputs,
@@ -977,7 +984,7 @@ st_translate_mesa_program(
}
/* texture samplers */
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
if (program->SamplersUsed & (1 << i)) {
struct tgsi_full_declaration fulldecl;
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h
index 7b2bee1ab70..b465b3bddcf 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.h
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h
@@ -41,6 +41,7 @@ struct gl_program;
GLuint
st_translate_mesa_program(
+ GLcontext *ctx,
uint procType,
const struct gl_program *program,
GLuint numInputs,
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index cf4b39cee40..d2535b6a2fa 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -61,9 +61,9 @@
static INLINE void *
mem_dup(const void *src, uint size)
{
- void *dup = MALLOC(size);
+ void *dup = _mesa_malloc(size);
if (dup)
- memcpy(dup, src, size);
+ _mesa_memcpy(dup, src, size);
return dup;
}
@@ -307,7 +307,7 @@ st_translate_vertex_program(struct st_context *st,
/* free old shader state, if any */
if (stvp->state.tokens) {
- FREE((void *) stvp->state.tokens);
+ _mesa_free((void *) stvp->state.tokens);
stvp->state.tokens = NULL;
}
if (stvp->driver_shader) {
@@ -317,7 +317,8 @@ st_translate_vertex_program(struct st_context *st,
/* XXX: fix static allocation of tokens:
*/
- num_tokens = st_translate_mesa_program(TGSI_PROCESSOR_VERTEX,
+ num_tokens = st_translate_mesa_program(st->ctx,
+ TGSI_PROCESSOR_VERTEX,
&stvp->Base.Base,
/* inputs */
vs_num_inputs,
@@ -503,7 +504,8 @@ st_translate_fragment_program(struct st_context *st,
/* XXX: fix static allocation of tokens:
*/
- num_tokens = st_translate_mesa_program(TGSI_PROCESSOR_FRAGMENT,
+ num_tokens = st_translate_mesa_program(st->ctx,
+ TGSI_PROCESSOR_FRAGMENT,
&stfp->Base.Base,
/* inputs */
fs_num_inputs,
diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h
index 5cfb2e41f24..414218bb589 100644
--- a/src/mesa/state_tracker/st_public.h
+++ b/src/mesa/state_tracker/st_public.h
@@ -42,6 +42,8 @@
#define ST_SURFACE_DEPTH 8
#define ST_TEXTURE_2D 0x2
+#define ST_TEXTURE_RECT 0x4
+
#define ST_TEXTURE_RGB 0x1
#define ST_TEXTURE_RGBA 0x2
@@ -51,6 +53,7 @@ struct st_framebuffer;
struct pipe_context;
struct pipe_fence_handle;
struct pipe_surface;
+struct pipe_texture;
struct st_context *st_create_context(struct pipe_context *pipe,
@@ -75,15 +78,18 @@ void st_resize_framebuffer( struct st_framebuffer *stfb,
void st_set_framebuffer_surface(struct st_framebuffer *stfb,
uint surfIndex, struct pipe_surface *surf);
-struct pipe_surface *st_get_framebuffer_surface(struct st_framebuffer *stfb,
- uint surfIndex);
+void st_get_framebuffer_dimensions( struct st_framebuffer *stfb,
+ uint *width, uint *height);
+
+int st_get_framebuffer_surface(struct st_framebuffer *stfb,
+ uint surfIndex, struct pipe_surface **surface);
-struct pipe_texture *st_get_framebuffer_texture(struct st_framebuffer *stfb,
- uint surfIndex);
+int st_get_framebuffer_texture(struct st_framebuffer *stfb,
+ uint surfIndex, struct pipe_texture **texture);
void *st_framebuffer_private( struct st_framebuffer *stfb );
-void st_unreference_framebuffer( struct st_framebuffer **stfb );
+void st_unreference_framebuffer( struct st_framebuffer *stfb );
void st_make_current(struct st_context *st,
struct st_framebuffer *draw,
@@ -96,6 +102,7 @@ void st_finish( struct st_context *st );
void st_notify_swapbuffers(struct st_framebuffer *stfb);
void st_notify_swapbuffers_complete(struct st_framebuffer *stfb);
+int st_set_teximage(struct pipe_texture *pt, int target);
/** Redirect rendering into stfb's surface to a texture image */
int st_bind_teximage(struct st_framebuffer *stfb, uint surfIndex,
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 29b16347625..63cfe5fc163 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -32,6 +32,7 @@
#include "st_cb_fbo.h"
#include "main/enums.h"
#include "main/teximage.h"
+#include "main/texstore.h"
#undef Elements /* fix re-defined macro warning */
@@ -352,6 +353,52 @@ st_texture_image_copy(struct pipe_context *pipe,
}
}
+/** Bind a pipe surface for use as a texture image */
+int
+st_set_teximage(struct pipe_texture *pt, int target)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLuint unit = ctx->Texture.CurrentUnit;
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+ struct st_texture_image *stImage;
+ int internalFormat;
+
+ switch (pt->format) {
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ internalFormat = GL_RGBA8;
+ break;
+ default:
+ return 0;
+ };
+
+ switch (target) {
+ case ST_TEXTURE_2D:
+ target = GL_TEXTURE_2D;
+ break;
+ case ST_TEXTURE_RECT:
+ target = GL_TEXTURE_RECTANGLE_ARB;
+ break;
+ default:
+ return 0;
+ }
+
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+ texImage = _mesa_get_tex_image(ctx, texObj, target, 0);
+ stImage = st_texture_image(texImage);
+
+ _mesa_init_teximage_fields(ctx, GL_TEXTURE_2D, texImage, pt->width[0],
+ pt->height[0], 1, 0, internalFormat);
+
+ texImage->TexFormat = st_ChooseTextureFormat(ctx, internalFormat, GL_RGBA,
+ GL_UNSIGNED_BYTE);
+ _mesa_set_fetch_functions(texImage, 2);
+
+ pipe_texture_reference(&stImage->pt, pt);
+
+ return 1;
+}
/** Redirect rendering into stfb's surface to a texture image */
int
diff --git a/src/mesa/state_tracker/wgl/SConscript b/src/mesa/state_tracker/wgl/SConscript
deleted file mode 100644
index bb579930f52..00000000000
--- a/src/mesa/state_tracker/wgl/SConscript
+++ /dev/null
@@ -1,41 +0,0 @@
-import os
-
-Import('*')
-
-if env['platform'] in ['windows']:
-
- env = env.Clone()
-
- env.Append(CPPPATH = [
- '#src/mesa',
- ])
-
- env.Append(CPPDEFINES = [
- '_GDI32_', # prevent wgl* being declared __declspec(dllimport)
- 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
- '__GL_EXPORTS',
- '_GNU_H_WINDOWS32_DEFINES',
- ])
-
- sources = [
- 'stw_device.c',
- 'stw_framebuffer.c',
- 'stw_icd.c',
- 'stw_pixelformat.c',
- 'stw_quirks.c',
- 'stw_wgl_arbextensionsstring.c',
- 'stw_wgl_arbmultisample.c',
- 'stw_wgl_arbpixelformat.c',
- #'stw_wgl.c',
- 'stw_wgl_context.c',
- 'stw_wgl_getprocaddress.c',
- 'stw_wgl_pixelformat.c',
- 'stw_wgl_swapbuffers.c',
- ]
-
- wgl = env.ConvenienceLibrary(
- target ='wgl',
- source = sources,
- )
-
- Export('wgl')
diff --git a/src/mesa/state_tracker/wgl/opengl32.def b/src/mesa/state_tracker/wgl/opengl32.def
deleted file mode 100644
index 238b728f1fe..00000000000
--- a/src/mesa/state_tracker/wgl/opengl32.def
+++ /dev/null
@@ -1,879 +0,0 @@
-; DO NOT EDIT - This file generated automatically by mesadef.py script
-;DESCRIPTION 'Mesa (OpenGL work-alike) for Win32'
-VERSION 6.5
-;
-; Module definition file for Mesa (OPENGL32.DLL)
-;
-; Note: The OpenGL functions use the STDCALL
-; function calling convention. Microsoft's
-; OPENGL32 uses this convention and so must the
-; Mesa OPENGL32 so that the Mesa DLL can be used
-; as a drop-in replacement.
-;
-; The linker exports STDCALL entry points with
-; 'decorated' names; e.g., _glBegin@0, where the
-; trailing number is the number of bytes of
-; parameter data pushed onto the stack. The
-; callee is responsible for popping this data
-; off the stack, usually via a RETF n instruction.
-;
-; However, the Microsoft OPENGL32.DLL does not export
-; the decorated names, even though the calling convention
-; is STDCALL. So, this module definition file is
-; needed to force the Mesa OPENGL32.DLL to export the
-; symbols in the same manner as the Microsoft DLL.
-; Were it not for this problem, this file would not
-; be needed (for the gl* functions) since the entry
-; points are compiled with dllexport declspec.
-;
-; However, this file is still needed to export "internal"
-; Mesa symbols for the benefit of the OSMESA32.DLL.
-;
-EXPORTS
- glNewList
- glEndList
- glCallList
- glCallLists
- glDeleteLists
- glGenLists
- glListBase
- glBegin
- glBitmap
- glColor3b
- glColor3bv
- glColor3d
- glColor3dv
- glColor3f
- glColor3fv
- glColor3i
- glColor3iv
- glColor3s
- glColor3sv
- glColor3ub
- glColor3ubv
- glColor3ui
- glColor3uiv
- glColor3us
- glColor3usv
- glColor4b
- glColor4bv
- glColor4d
- glColor4dv
- glColor4f
- glColor4fv
- glColor4i
- glColor4iv
- glColor4s
- glColor4sv
- glColor4ub
- glColor4ubv
- glColor4ui
- glColor4uiv
- glColor4us
- glColor4usv
- glEdgeFlag
- glEdgeFlagv
- glEnd
- glIndexd
- glIndexdv
- glIndexf
- glIndexfv
- glIndexi
- glIndexiv
- glIndexs
- glIndexsv
- glNormal3b
- glNormal3bv
- glNormal3d
- glNormal3dv
- glNormal3f
- glNormal3fv
- glNormal3i
- glNormal3iv
- glNormal3s
- glNormal3sv
- glRasterPos2d
- glRasterPos2dv
- glRasterPos2f
- glRasterPos2fv
- glRasterPos2i
- glRasterPos2iv
- glRasterPos2s
- glRasterPos2sv
- glRasterPos3d
- glRasterPos3dv
- glRasterPos3f
- glRasterPos3fv
- glRasterPos3i
- glRasterPos3iv
- glRasterPos3s
- glRasterPos3sv
- glRasterPos4d
- glRasterPos4dv
- glRasterPos4f
- glRasterPos4fv
- glRasterPos4i
- glRasterPos4iv
- glRasterPos4s
- glRasterPos4sv
- glRectd
- glRectdv
- glRectf
- glRectfv
- glRecti
- glRectiv
- glRects
- glRectsv
- glTexCoord1d
- glTexCoord1dv
- glTexCoord1f
- glTexCoord1fv
- glTexCoord1i
- glTexCoord1iv
- glTexCoord1s
- glTexCoord1sv
- glTexCoord2d
- glTexCoord2dv
- glTexCoord2f
- glTexCoord2fv
- glTexCoord2i
- glTexCoord2iv
- glTexCoord2s
- glTexCoord2sv
- glTexCoord3d
- glTexCoord3dv
- glTexCoord3f
- glTexCoord3fv
- glTexCoord3i
- glTexCoord3iv
- glTexCoord3s
- glTexCoord3sv
- glTexCoord4d
- glTexCoord4dv
- glTexCoord4f
- glTexCoord4fv
- glTexCoord4i
- glTexCoord4iv
- glTexCoord4s
- glTexCoord4sv
- glVertex2d
- glVertex2dv
- glVertex2f
- glVertex2fv
- glVertex2i
- glVertex2iv
- glVertex2s
- glVertex2sv
- glVertex3d
- glVertex3dv
- glVertex3f
- glVertex3fv
- glVertex3i
- glVertex3iv
- glVertex3s
- glVertex3sv
- glVertex4d
- glVertex4dv
- glVertex4f
- glVertex4fv
- glVertex4i
- glVertex4iv
- glVertex4s
- glVertex4sv
- glClipPlane
- glColorMaterial
- glCullFace
- glFogf
- glFogfv
- glFogi
- glFogiv
- glFrontFace
- glHint
- glLightf
- glLightfv
- glLighti
- glLightiv
- glLightModelf
- glLightModelfv
- glLightModeli
- glLightModeliv
- glLineStipple
- glLineWidth
- glMaterialf
- glMaterialfv
- glMateriali
- glMaterialiv
- glPointSize
- glPolygonMode
- glPolygonStipple
- glScissor
- glShadeModel
- glTexParameterf
- glTexParameterfv
- glTexParameteri
- glTexParameteriv
- glTexImage1D
- glTexImage2D
- glTexEnvf
- glTexEnvfv
- glTexEnvi
- glTexEnviv
- glTexGend
- glTexGendv
- glTexGenf
- glTexGenfv
- glTexGeni
- glTexGeniv
- glFeedbackBuffer
- glSelectBuffer
- glRenderMode
- glInitNames
- glLoadName
- glPassThrough
- glPopName
- glPushName
- glDrawBuffer
- glClear
- glClearAccum
- glClearIndex
- glClearColor
- glClearStencil
- glClearDepth
- glStencilMask
- glColorMask
- glDepthMask
- glIndexMask
- glAccum
- glDisable
- glEnable
- glFinish
- glFlush
- glPopAttrib
- glPushAttrib
- glMap1d
- glMap1f
- glMap2d
- glMap2f
- glMapGrid1d
- glMapGrid1f
- glMapGrid2d
- glMapGrid2f
- glEvalCoord1d
- glEvalCoord1dv
- glEvalCoord1f
- glEvalCoord1fv
- glEvalCoord2d
- glEvalCoord2dv
- glEvalCoord2f
- glEvalCoord2fv
- glEvalMesh1
- glEvalPoint1
- glEvalMesh2
- glEvalPoint2
- glAlphaFunc
- glBlendFunc
- glLogicOp
- glStencilFunc
- glStencilOp
- glDepthFunc
- glPixelZoom
- glPixelTransferf
- glPixelTransferi
- glPixelStoref
- glPixelStorei
- glPixelMapfv
- glPixelMapuiv
- glPixelMapusv
- glReadBuffer
- glCopyPixels
- glReadPixels
- glDrawPixels
- glGetBooleanv
- glGetClipPlane
- glGetDoublev
- glGetError
- glGetFloatv
- glGetIntegerv
- glGetLightfv
- glGetLightiv
- glGetMapdv
- glGetMapfv
- glGetMapiv
- glGetMaterialfv
- glGetMaterialiv
- glGetPixelMapfv
- glGetPixelMapuiv
- glGetPixelMapusv
- glGetPolygonStipple
- glGetString
- glGetTexEnvfv
- glGetTexEnviv
- glGetTexGendv
- glGetTexGenfv
- glGetTexGeniv
- glGetTexImage
- glGetTexParameterfv
- glGetTexParameteriv
- glGetTexLevelParameterfv
- glGetTexLevelParameteriv
- glIsEnabled
- glIsList
- glDepthRange
- glFrustum
- glLoadIdentity
- glLoadMatrixf
- glLoadMatrixd
- glMatrixMode
- glMultMatrixf
- glMultMatrixd
- glOrtho
- glPopMatrix
- glPushMatrix
- glRotated
- glRotatef
- glScaled
- glScalef
- glTranslated
- glTranslatef
- glViewport
- glArrayElement
- glColorPointer
- glDisableClientState
- glDrawArrays
- glDrawElements
- glEdgeFlagPointer
- glEnableClientState
- glGetPointerv
- glIndexPointer
- glInterleavedArrays
- glNormalPointer
- glTexCoordPointer
- glVertexPointer
- glPolygonOffset
- glCopyTexImage1D
- glCopyTexImage2D
- glCopyTexSubImage1D
- glCopyTexSubImage2D
- glTexSubImage1D
- glTexSubImage2D
- glAreTexturesResident
- glBindTexture
- glDeleteTextures
- glGenTextures
- glIsTexture
- glPrioritizeTextures
- glIndexub
- glIndexubv
- glPopClientAttrib
- glPushClientAttrib
- glBlendColor
- glBlendEquation
- glDrawRangeElements
- glColorTable
- glColorTableParameterfv
- glColorTableParameteriv
- glCopyColorTable
- glGetColorTable
- glGetColorTableParameterfv
- glGetColorTableParameteriv
- glColorSubTable
- glCopyColorSubTable
- glConvolutionFilter1D
- glConvolutionFilter2D
- glConvolutionParameterf
- glConvolutionParameterfv
- glConvolutionParameteri
- glConvolutionParameteriv
- glCopyConvolutionFilter1D
- glCopyConvolutionFilter2D
- glGetConvolutionFilter
- glGetConvolutionParameterfv
- glGetConvolutionParameteriv
- glGetSeparableFilter
- glSeparableFilter2D
- glGetHistogram
- glGetHistogramParameterfv
- glGetHistogramParameteriv
- glGetMinmax
- glGetMinmaxParameterfv
- glGetMinmaxParameteriv
- glHistogram
- glMinmax
- glResetHistogram
- glResetMinmax
- glTexImage3D
- glTexSubImage3D
- glCopyTexSubImage3D
- glActiveTextureARB
- glClientActiveTextureARB
- glMultiTexCoord1dARB
- glMultiTexCoord1dvARB
- glMultiTexCoord1fARB
- glMultiTexCoord1fvARB
- glMultiTexCoord1iARB
- glMultiTexCoord1ivARB
- glMultiTexCoord1sARB
- glMultiTexCoord1svARB
- glMultiTexCoord2dARB
- glMultiTexCoord2dvARB
- glMultiTexCoord2fARB
- glMultiTexCoord2fvARB
- glMultiTexCoord2iARB
- glMultiTexCoord2ivARB
- glMultiTexCoord2sARB
- glMultiTexCoord2svARB
- glMultiTexCoord3dARB
- glMultiTexCoord3dvARB
- glMultiTexCoord3fARB
- glMultiTexCoord3fvARB
- glMultiTexCoord3iARB
- glMultiTexCoord3ivARB
- glMultiTexCoord3sARB
- glMultiTexCoord3svARB
- glMultiTexCoord4dARB
- glMultiTexCoord4dvARB
- glMultiTexCoord4fARB
- glMultiTexCoord4fvARB
- glMultiTexCoord4iARB
- glMultiTexCoord4ivARB
- glMultiTexCoord4sARB
- glMultiTexCoord4svARB
- glLoadTransposeMatrixfARB
- glLoadTransposeMatrixdARB
- glMultTransposeMatrixfARB
- glMultTransposeMatrixdARB
- glSampleCoverageARB
- glCompressedTexImage3DARB
- glCompressedTexImage2DARB
- glCompressedTexImage1DARB
- glCompressedTexSubImage3DARB
- glCompressedTexSubImage2DARB
- glCompressedTexSubImage1DARB
- glGetCompressedTexImageARB
- glActiveTexture
- glClientActiveTexture
- glMultiTexCoord1d
- glMultiTexCoord1dv
- glMultiTexCoord1f
- glMultiTexCoord1fv
- glMultiTexCoord1i
- glMultiTexCoord1iv
- glMultiTexCoord1s
- glMultiTexCoord1sv
- glMultiTexCoord2d
- glMultiTexCoord2dv
- glMultiTexCoord2f
- glMultiTexCoord2fv
- glMultiTexCoord2i
- glMultiTexCoord2iv
- glMultiTexCoord2s
- glMultiTexCoord2sv
- glMultiTexCoord3d
- glMultiTexCoord3dv
- glMultiTexCoord3f
- glMultiTexCoord3fv
- glMultiTexCoord3i
- glMultiTexCoord3iv
- glMultiTexCoord3s
- glMultiTexCoord3sv
- glMultiTexCoord4d
- glMultiTexCoord4dv
- glMultiTexCoord4f
- glMultiTexCoord4fv
- glMultiTexCoord4i
- glMultiTexCoord4iv
- glMultiTexCoord4s
- glMultiTexCoord4sv
- glLoadTransposeMatrixf
- glLoadTransposeMatrixd
- glMultTransposeMatrixf
- glMultTransposeMatrixd
- glSampleCoverage
- glCompressedTexImage3D
- glCompressedTexImage2D
- glCompressedTexImage1D
- glCompressedTexSubImage3D
- glCompressedTexSubImage2D
- glCompressedTexSubImage1D
- glGetCompressedTexImage
- glBlendColorEXT
- glPolygonOffsetEXT
- glTexImage3DEXT
- glTexSubImage3DEXT
- glTexSubImage1DEXT
- glTexSubImage2DEXT
- glCopyTexImage1DEXT
- glCopyTexImage2DEXT
- glCopyTexSubImage1DEXT
- glCopyTexSubImage2DEXT
- glCopyTexSubImage3DEXT
- glAreTexturesResidentEXT
- glBindTextureEXT
- glDeleteTexturesEXT
- glGenTexturesEXT
- glIsTextureEXT
- glPrioritizeTexturesEXT
- glArrayElementEXT
- glColorPointerEXT
- glDrawArraysEXT
- glEdgeFlagPointerEXT
- glGetPointervEXT
- glIndexPointerEXT
- glNormalPointerEXT
- glTexCoordPointerEXT
- glVertexPointerEXT
- glBlendEquationEXT
- glPointParameterfEXT
- glPointParameterfvEXT
- glPointParameterfARB
- glPointParameterfvARB
- glColorTableEXT
- glGetColorTableEXT
- glGetColorTableParameterivEXT
- glGetColorTableParameterfvEXT
- glLockArraysEXT
- glUnlockArraysEXT
- glDrawRangeElementsEXT
- glSecondaryColor3bEXT
- glSecondaryColor3bvEXT
- glSecondaryColor3dEXT
- glSecondaryColor3dvEXT
- glSecondaryColor3fEXT
- glSecondaryColor3fvEXT
- glSecondaryColor3iEXT
- glSecondaryColor3ivEXT
- glSecondaryColor3sEXT
- glSecondaryColor3svEXT
- glSecondaryColor3ubEXT
- glSecondaryColor3ubvEXT
- glSecondaryColor3uiEXT
- glSecondaryColor3uivEXT
- glSecondaryColor3usEXT
- glSecondaryColor3usvEXT
- glSecondaryColorPointerEXT
- glMultiDrawArraysEXT
- glMultiDrawElementsEXT
- glFogCoordfEXT
- glFogCoordfvEXT
- glFogCoorddEXT
- glFogCoorddvEXT
- glFogCoordPointerEXT
- glBlendFuncSeparateEXT
- glFlushVertexArrayRangeNV
- glVertexArrayRangeNV
- glCombinerParameterfvNV
- glCombinerParameterfNV
- glCombinerParameterivNV
- glCombinerParameteriNV
- glCombinerInputNV
- glCombinerOutputNV
- glFinalCombinerInputNV
- glGetCombinerInputParameterfvNV
- glGetCombinerInputParameterivNV
- glGetCombinerOutputParameterfvNV
- glGetCombinerOutputParameterivNV
- glGetFinalCombinerInputParameterfvNV
- glGetFinalCombinerInputParameterivNV
- glResizeBuffersMESA
- glWindowPos2dMESA
- glWindowPos2dvMESA
- glWindowPos2fMESA
- glWindowPos2fvMESA
- glWindowPos2iMESA
- glWindowPos2ivMESA
- glWindowPos2sMESA
- glWindowPos2svMESA
- glWindowPos3dMESA
- glWindowPos3dvMESA
- glWindowPos3fMESA
- glWindowPos3fvMESA
- glWindowPos3iMESA
- glWindowPos3ivMESA
- glWindowPos3sMESA
- glWindowPos3svMESA
- glWindowPos4dMESA
- glWindowPos4dvMESA
- glWindowPos4fMESA
- glWindowPos4fvMESA
- glWindowPos4iMESA
- glWindowPos4ivMESA
- glWindowPos4sMESA
- glWindowPos4svMESA
- glWindowPos2dARB
- glWindowPos2fARB
- glWindowPos2iARB
- glWindowPos2sARB
- glWindowPos2dvARB
- glWindowPos2fvARB
- glWindowPos2ivARB
- glWindowPos2svARB
- glWindowPos3dARB
- glWindowPos3fARB
- glWindowPos3iARB
- glWindowPos3sARB
- glWindowPos3dvARB
- glWindowPos3fvARB
- glWindowPos3ivARB
- glWindowPos3svARB
- glAreProgramsResidentNV
- glBindProgramNV
- glDeleteProgramsNV
- glExecuteProgramNV
- glGenProgramsNV
- glGetProgramParameterdvNV
- glGetProgramParameterfvNV
- glGetProgramivNV
- glGetProgramStringNV
- glGetTrackMatrixivNV
- glGetVertexAttribdvNV
- glGetVertexAttribfvNV
- glGetVertexAttribivNV
- glGetVertexAttribPointervNV
- glIsProgramNV
- glLoadProgramNV
- glProgramParameter4dNV
- glProgramParameter4dvNV
- glProgramParameter4fNV
- glProgramParameter4fvNV
- glProgramParameters4dvNV
- glProgramParameters4fvNV
- glRequestResidentProgramsNV
- glTrackMatrixNV
- glVertexAttribPointerNV
- glVertexAttrib1dNV
- glVertexAttrib1dvNV
- glVertexAttrib1fNV
- glVertexAttrib1fvNV
- glVertexAttrib1sNV
- glVertexAttrib1svNV
- glVertexAttrib2dNV
- glVertexAttrib2dvNV
- glVertexAttrib2fNV
- glVertexAttrib2fvNV
- glVertexAttrib2sNV
- glVertexAttrib2svNV
- glVertexAttrib3dNV
- glVertexAttrib3dvNV
- glVertexAttrib3fNV
- glVertexAttrib3fvNV
- glVertexAttrib3sNV
- glVertexAttrib3svNV
- glVertexAttrib4dNV
- glVertexAttrib4dvNV
- glVertexAttrib4fNV
- glVertexAttrib4fvNV
- glVertexAttrib4sNV
- glVertexAttrib4svNV
- glVertexAttrib4ubNV
- glVertexAttrib4ubvNV
- glVertexAttribs1dvNV
- glVertexAttribs1fvNV
- glVertexAttribs1svNV
- glVertexAttribs2dvNV
- glVertexAttribs2fvNV
- glVertexAttribs2svNV
- glVertexAttribs3dvNV
- glVertexAttribs3fvNV
- glVertexAttribs3svNV
- glVertexAttribs4dvNV
- glVertexAttribs4fvNV
- glVertexAttribs4svNV
- glVertexAttribs4ubvNV
- glPointParameteriNV
- glPointParameterivNV
- glFogCoordf
- glFogCoordfv
- glFogCoordd
- glFogCoorddv
- glFogCoordPointer
- glMultiDrawArrays
- glMultiDrawElements
- glPointParameterf
- glPointParameterfv
- glPointParameteri
- glPointParameteriv
- glSecondaryColor3b
- glSecondaryColor3bv
- glSecondaryColor3d
- glSecondaryColor3dv
- glSecondaryColor3f
- glSecondaryColor3fv
- glSecondaryColor3i
- glSecondaryColor3iv
- glSecondaryColor3s
- glSecondaryColor3sv
- glSecondaryColor3ub
- glSecondaryColor3ubv
- glSecondaryColor3ui
- glSecondaryColor3uiv
- glSecondaryColor3us
- glSecondaryColor3usv
- glSecondaryColorPointer
- glWindowPos2d
- glWindowPos2dv
- glWindowPos2f
- glWindowPos2fv
- glWindowPos2i
- glWindowPos2iv
- glWindowPos2s
- glWindowPos2sv
- glWindowPos3d
- glWindowPos3dv
- glWindowPos3f
- glWindowPos3fv
- glWindowPos3i
- glWindowPos3iv
- glWindowPos3s
- glWindowPos3sv
- glVertexAttrib1sARB
- glVertexAttrib1fARB
- glVertexAttrib1dARB
- glVertexAttrib2sARB
- glVertexAttrib2fARB
- glVertexAttrib2dARB
- glVertexAttrib3sARB
- glVertexAttrib3fARB
- glVertexAttrib3dARB
- glVertexAttrib4sARB
- glVertexAttrib4fARB
- glVertexAttrib4dARB
- glVertexAttrib4NubARB
- glVertexAttrib1svARB
- glVertexAttrib1fvARB
- glVertexAttrib1dvARB
- glVertexAttrib2svARB
- glVertexAttrib2fvARB
- glVertexAttrib2dvARB
- glVertexAttrib3svARB
- glVertexAttrib3fvARB
- glVertexAttrib3dvARB
- glVertexAttrib4bvARB
- glVertexAttrib4svARB
- glVertexAttrib4ivARB
- glVertexAttrib4ubvARB
- glVertexAttrib4usvARB
- glVertexAttrib4uivARB
- glVertexAttrib4fvARB
- glVertexAttrib4dvARB
- glVertexAttrib4NbvARB
- glVertexAttrib4NsvARB
- glVertexAttrib4NivARB
- glVertexAttrib4NubvARB
- glVertexAttrib4NusvARB
- glVertexAttrib4NuivARB
- glVertexAttribPointerARB
- glEnableVertexAttribArrayARB
- glDisableVertexAttribArrayARB
- glProgramStringARB
- glBindProgramARB
- glDeleteProgramsARB
- glGenProgramsARB
- glIsProgramARB
- glProgramEnvParameter4dARB
- glProgramEnvParameter4dvARB
- glProgramEnvParameter4fARB
- glProgramEnvParameter4fvARB
- glProgramLocalParameter4dARB
- glProgramLocalParameter4dvARB
- glProgramLocalParameter4fARB
- glProgramLocalParameter4fvARB
- glGetProgramEnvParameterdvARB
- glGetProgramEnvParameterfvARB
- glGetProgramLocalParameterdvARB
- glGetProgramLocalParameterfvARB
- glGetProgramivARB
- glGetProgramStringARB
- glGetVertexAttribdvARB
- glGetVertexAttribfvARB
- glGetVertexAttribivARB
- glGetVertexAttribPointervARB
- glProgramNamedParameter4fNV
- glProgramNamedParameter4dNV
- glProgramNamedParameter4fvNV
- glProgramNamedParameter4dvNV
- glGetProgramNamedParameterfvNV
- glGetProgramNamedParameterdvNV
- glBindBufferARB
- glBufferDataARB
- glBufferSubDataARB
- glDeleteBuffersARB
- glGenBuffersARB
- glGetBufferParameterivARB
- glGetBufferPointervARB
- glGetBufferSubDataARB
- glIsBufferARB
- glMapBufferARB
- glUnmapBufferARB
- glGenQueriesARB
- glDeleteQueriesARB
- glIsQueryARB
- glBeginQueryARB
- glEndQueryARB
- glGetQueryivARB
- glGetQueryObjectivARB
- glGetQueryObjectuivARB
- glBindBuffer
- glBufferData
- glBufferSubData
- glDeleteBuffers
- glGenBuffers
- glGetBufferParameteriv
- glGetBufferPointerv
- glGetBufferSubData
- glIsBuffer
- glMapBuffer
- glUnmapBuffer
- glGenQueries
- glDeleteQueries
- glIsQuery
- glBeginQuery
- glEndQuery
- glGetQueryiv
- glGetQueryObjectiv
- glGetQueryObjectuiv
-;
-; WGL API
- wglChoosePixelFormat
- wglCopyContext
- wglCreateContext
- wglCreateLayerContext
- wglDeleteContext
- wglDescribeLayerPlane
- wglDescribePixelFormat
- wglGetCurrentContext
- wglGetCurrentDC
- wglGetLayerPaletteEntries
- wglGetPixelFormat
- wglGetProcAddress
- wglMakeCurrent
- wglRealizeLayerPalette
- wglSetLayerPaletteEntries
- wglSetPixelFormat
- wglShareLists
- wglSwapBuffers
- wglSwapLayerBuffers
- wglUseFontBitmapsA
- wglUseFontBitmapsW
- wglUseFontOutlinesA
- wglUseFontOutlinesW
- wglGetExtensionsStringARB
-;
-; ICD API
- DrvCopyContext
- DrvCreateContext
- DrvCreateLayerContext
- DrvDeleteContext
- DrvDescribeLayerPlane
- DrvDescribePixelFormat
- DrvGetLayerPaletteEntries
- DrvGetProcAddress
- DrvRealizeLayerPalette
- DrvReleaseContext
- DrvSetCallbackProcs
- DrvSetContext
- DrvSetLayerPaletteEntries
- DrvSetPixelFormat
- DrvShareLists
- DrvSwapBuffers
- DrvSwapLayerBuffers
- DrvValidateVersion
diff --git a/src/mesa/state_tracker/wgl/stw_device.c b/src/mesa/state_tracker/wgl/stw_device.c
deleted file mode 100644
index e2a17d83ac6..00000000000
--- a/src/mesa/state_tracker/wgl/stw_device.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-
-#include "pipe/p_debug.h"
-
-#include "stw_device.h"
-#include "stw_winsys.h"
-#include "stw_pixelformat.h"
-
-
-struct stw_device *stw_dev = NULL;
-
-
-boolean
-st_init(const struct stw_winsys *stw_winsys)
-{
- static struct stw_device stw_dev_storage;
-
- assert(!stw_dev);
-
- stw_dev = &stw_dev_storage;
- memset(stw_dev, 0, sizeof(*stw_dev));
-
- stw_dev->stw_winsys = stw_winsys;
-
- stw_dev->screen = stw_winsys->create_screen();
- if(!stw_dev->screen)
- goto error1;
-
- pixelformat_init();
-
- return TRUE;
-
-error1:
- stw_dev = NULL;
- return FALSE;
-}
-
-
-void
-st_cleanup(void)
-{
- DHGLRC dhglrc;
-
- if(!stw_dev)
- return;
-
- /* Ensure all contexts are destroyed */
- for (dhglrc = 1; dhglrc <= DRV_CONTEXT_MAX; dhglrc++)
- if (stw_dev->ctx_array[dhglrc - 1].hglrc)
- DrvDeleteContext( dhglrc );
-
- stw_dev = NULL;
-}
diff --git a/src/mesa/state_tracker/wgl/stw_device.h b/src/mesa/state_tracker/wgl/stw_device.h
deleted file mode 100644
index e2020bf0554..00000000000
--- a/src/mesa/state_tracker/wgl/stw_device.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef ST_DEVICE_H_
-#define ST_DEVICE_H_
-
-
-#include "stw_icd.h"
-
-struct pipe_screen;
-
-
-struct drv_context
-{
- HGLRC hglrc;
-};
-
-#define DRV_CONTEXT_MAX 32
-
-
-struct stw_device
-{
- const struct stw_winsys *stw_winsys;
-
- struct pipe_screen *screen;
-
- struct drv_context ctx_array[DRV_CONTEXT_MAX];
-
- DHGLRC ctx_current;
-};
-
-
-extern struct stw_device *stw_dev;
-
-
-#endif /* ST_DEVICE_H_ */
diff --git a/src/mesa/state_tracker/wgl/stw_framebuffer.c b/src/mesa/state_tracker/wgl/stw_framebuffer.c
deleted file mode 100644
index 1ecafa451ee..00000000000
--- a/src/mesa/state_tracker/wgl/stw_framebuffer.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-
-#include "main/context.h"
-#include "pipe/p_format.h"
-#include "state_tracker/st_context.h"
-#include "state_tracker/st_public.h"
-#include "stw_framebuffer.h"
-
-void
-framebuffer_resize(
- struct stw_framebuffer *fb,
- GLuint width,
- GLuint height )
-{
- if (fb->hbmDIB == NULL || fb->stfb->Base.Width != width || fb->stfb->Base.Height != height) {
- if (fb->hbmDIB)
- DeleteObject( fb->hbmDIB );
-
- fb->hbmDIB = CreateCompatibleBitmap(
- fb->hDC,
- width,
- height );
- }
-
- st_resize_framebuffer( fb->stfb, width, height );
-}
-
-static struct stw_framebuffer *fb_head = NULL;
-
-static LRESULT CALLBACK
-window_proc(
- HWND hWnd,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam )
-{
- struct stw_framebuffer *fb;
-
- for (fb = fb_head; fb != NULL; fb = fb->next)
- if (fb->hWnd == hWnd)
- break;
- assert( fb != NULL );
-
- if (uMsg == WM_SIZE && wParam != SIZE_MINIMIZED)
- framebuffer_resize( fb, LOWORD( lParam ), HIWORD( lParam ) );
-
- return CallWindowProc( fb->WndProc, hWnd, uMsg, wParam, lParam );
-}
-
-/* Create a new framebuffer object which will correspond to the given HDC.
- */
-struct stw_framebuffer *
-framebuffer_create(
- HDC hdc,
- GLvisual *visual,
- GLuint width,
- GLuint height )
-{
- struct stw_framebuffer *fb;
- enum pipe_format colorFormat, depthFormat, stencilFormat;
-
- fb = CALLOC_STRUCT( stw_framebuffer );
- if (fb == NULL)
- return NULL;
-
- /* Determine PIPE_FORMATs for buffers.
- */
- colorFormat = PIPE_FORMAT_A8R8G8B8_UNORM;
-
- if (visual->depthBits == 0)
- depthFormat = PIPE_FORMAT_NONE;
- else if (visual->depthBits <= 16)
- depthFormat = PIPE_FORMAT_Z16_UNORM;
- else if (visual->depthBits <= 24)
- depthFormat = PIPE_FORMAT_S8Z24_UNORM;
- else
- depthFormat = PIPE_FORMAT_Z32_UNORM;
-
- if (visual->stencilBits == 8) {
- if (depthFormat == PIPE_FORMAT_S8Z24_UNORM)
- stencilFormat = depthFormat;
- else
- stencilFormat = PIPE_FORMAT_S8_UNORM;
- }
- else {
- stencilFormat = PIPE_FORMAT_NONE;
- }
-
- fb->stfb = st_create_framebuffer(
- visual,
- colorFormat,
- depthFormat,
- stencilFormat,
- width,
- height,
- (void *) fb );
-
- fb->cColorBits = GetDeviceCaps( hdc, BITSPIXEL );
- fb->hDC = hdc;
-
- /* Subclass a window associated with the device context.
- */
- fb->hWnd = WindowFromDC( hdc );
- if (fb->hWnd != NULL) {
- fb->WndProc = (WNDPROC) SetWindowLong(
- fb->hWnd,
- GWL_WNDPROC,
- (LONG) window_proc );
- }
-
- fb->next = fb_head;
- fb_head = fb;
- return fb;
-}
-
-void
-framebuffer_destroy(
- struct stw_framebuffer *fb )
-{
- struct stw_framebuffer **link = &fb_head;
- struct stw_framebuffer *pfb = fb_head;
-
- while (pfb != NULL) {
- if (pfb == fb) {
- if (fb->hWnd != NULL) {
- SetWindowLong(
- fb->hWnd,
- GWL_WNDPROC,
- (LONG) fb->WndProc );
- }
-
- *link = fb->next;
- FREE( fb );
- return;
- }
-
- link = &pfb->next;
- pfb = pfb->next;
- }
-}
-
-/* Given an hdc, return the corresponding wgl_context.
- */
-struct stw_framebuffer *
-framebuffer_from_hdc(
- HDC hdc )
-{
- struct stw_framebuffer *fb;
-
- for (fb = fb_head; fb != NULL; fb = fb->next)
- if (fb->hDC == hdc)
- return fb;
- return NULL;
-}
diff --git a/src/mesa/state_tracker/wgl/stw_framebuffer.h b/src/mesa/state_tracker/wgl/stw_framebuffer.h
deleted file mode 100644
index 2e16e421f2c..00000000000
--- a/src/mesa/state_tracker/wgl/stw_framebuffer.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef STW_FRAMEBUFFER_H
-#define STW_FRAMEBUFFER_H
-
-#include "main/mtypes.h"
-
-/* Windows framebuffer, derived from gl_framebuffer.
- */
-struct stw_framebuffer
-{
- struct st_framebuffer *stfb;
- HDC hDC;
- int pixelformat;
- BYTE cColorBits;
- HDC dib_hDC;
- HBITMAP hbmDIB;
- HBITMAP hOldBitmap;
- PBYTE pbPixels;
- HWND hWnd;
- WNDPROC WndProc;
- struct stw_framebuffer *next;
-};
-
-struct stw_framebuffer *
-framebuffer_create(
- HDC hdc,
- GLvisual *visual,
- GLuint width,
- GLuint height );
-
-void
-framebuffer_destroy(
- struct stw_framebuffer *fb );
-
-void
-framebuffer_resize(
- struct stw_framebuffer *fb,
- GLuint width,
- GLuint height );
-
-struct stw_framebuffer *
-framebuffer_from_hdc(
- HDC hdc );
-
-#endif /* STW_FRAMEBUFFER_H */
diff --git a/src/mesa/state_tracker/wgl/stw_icd.c b/src/mesa/state_tracker/wgl/stw_icd.c
deleted file mode 100644
index 1dddc242097..00000000000
--- a/src/mesa/state_tracker/wgl/stw_icd.c
+++ /dev/null
@@ -1,637 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-#include <stdio.h>
-
-#include "GL/gl.h"
-
-#include "pipe/p_debug.h"
-
-#include "stw_device.h"
-#include "stw_icd.h"
-#include "stw_wgl.h"
-
-
-static HGLRC
-_drv_lookup_hglrc( DHGLRC dhglrc )
-{
- if (dhglrc == 0 || dhglrc >= DRV_CONTEXT_MAX)
- return NULL;
- return stw_dev->ctx_array[dhglrc - 1].hglrc;
-}
-
-BOOL APIENTRY
-DrvCopyContext(
- DHGLRC dhrcSource,
- DHGLRC dhrcDest,
- UINT fuMask )
-{
- debug_printf( "%s\n", __FUNCTION__ );
-
- return FALSE;
-}
-
-DHGLRC APIENTRY
-DrvCreateLayerContext(
- HDC hdc,
- INT iLayerPlane )
-{
- DHGLRC dhglrc = 0;
-
- if (iLayerPlane == 0) {
- DWORD i;
-
- for (i = 0; i < DRV_CONTEXT_MAX; i++) {
- if (stw_dev->ctx_array[i].hglrc == NULL)
- break;
- }
-
- if (i < DRV_CONTEXT_MAX) {
- stw_dev->ctx_array[i].hglrc = wglCreateContext( hdc );
- if (stw_dev->ctx_array[i].hglrc != NULL)
- dhglrc = i + 1;
- }
- }
-
- debug_printf( "%s( 0x%p, %d ) = %u\n", __FUNCTION__, hdc, iLayerPlane, dhglrc );
-
- return dhglrc;
-}
-
-DHGLRC APIENTRY
-DrvCreateContext(
- HDC hdc )
-{
- return DrvCreateLayerContext( hdc, 0 );
-}
-
-BOOL APIENTRY
-DrvDeleteContext(
- DHGLRC dhglrc )
-{
- HGLRC hglrc = _drv_lookup_hglrc( dhglrc );
- BOOL success = FALSE;
-
- if (hglrc != NULL) {
- success = wglDeleteContext( hglrc );
- if (success)
- stw_dev->ctx_array[dhglrc - 1].hglrc = NULL;
- }
-
- debug_printf( "%s( %u ) = %s\n", __FUNCTION__, dhglrc, success ? "TRUE" : "FALSE" );
-
- return success;
-}
-
-BOOL APIENTRY
-DrvDescribeLayerPlane(
- HDC hdc,
- INT iPixelFormat,
- INT iLayerPlane,
- UINT nBytes,
- LPLAYERPLANEDESCRIPTOR plpd )
-{
- debug_printf( "%s\n", __FUNCTION__ );
-
- return FALSE;
-}
-
-LONG APIENTRY
-DrvDescribePixelFormat(
- HDC hdc,
- INT iPixelFormat,
- ULONG cjpfd,
- PIXELFORMATDESCRIPTOR *ppfd )
-{
- LONG r;
-
- r = wglDescribePixelFormat( hdc, iPixelFormat, cjpfd, ppfd );
-
- debug_printf( "%s( 0x%p, %d, %u, 0x%p ) = %d\n", __FUNCTION__, hdc, iPixelFormat, cjpfd, ppfd, r );
-
- return r;
-}
-
-int APIENTRY
-DrvGetLayerPaletteEntries(
- HDC hdc,
- INT iLayerPlane,
- INT iStart,
- INT cEntries,
- COLORREF *pcr )
-{
- debug_printf( "%s\n", __FUNCTION__ );
-
- return 0;
-}
-
-PROC APIENTRY
-DrvGetProcAddress(
- LPCSTR lpszProc )
-{
- PROC r;
-
- r = wglGetProcAddress( lpszProc );
-
- debug_printf( "%s( \", __FUNCTION__%s\" ) = 0x%p\n", lpszProc, r );
-
- return r;
-}
-
-BOOL APIENTRY
-DrvRealizeLayerPalette(
- HDC hdc,
- INT iLayerPlane,
- BOOL bRealize )
-{
- debug_printf( "%s\n", __FUNCTION__ );
-
- return FALSE;
-}
-
-BOOL APIENTRY
-DrvReleaseContext(
- DHGLRC dhglrc )
-{
- BOOL success = FALSE;
-
- if (dhglrc == stw_dev->ctx_current) {
- HGLRC hglrc = _drv_lookup_hglrc( dhglrc );
-
- if (hglrc != NULL) {
- success = wglMakeCurrent( NULL, NULL );
- if (success)
- stw_dev->ctx_current = 0;
- }
- }
-
- debug_printf( "%s( %u ) = %s\n", __FUNCTION__, dhglrc, success ? "TRUE" : "FALSE" );
-
- return success;
-}
-
-void APIENTRY
-DrvSetCallbackProcs(
- INT nProcs,
- PROC *pProcs )
-{
- debug_printf( "%s( %d, 0x%p )\n", __FUNCTION__, nProcs, pProcs );
-
- return;
-}
-
-#define GPA_GL( NAME ) disp->NAME = gl##NAME
-
-static GLCLTPROCTABLE cpt;
-
-PGLCLTPROCTABLE APIENTRY
-DrvSetContext(
- HDC hdc,
- DHGLRC dhglrc,
- PFN_SETPROCTABLE pfnSetProcTable )
-{
- HGLRC hglrc = _drv_lookup_hglrc( dhglrc );
- GLDISPATCHTABLE *disp = &cpt.glDispatchTable;
-
- debug_printf( "%s( 0x%p, %u, 0x%p )\n", __FUNCTION__, hdc, dhglrc, pfnSetProcTable );
-
- if (hglrc == NULL)
- return NULL;
-
- if (!wglMakeCurrent( hdc, hglrc ))
- return NULL;
-
- memset( &cpt, 0, sizeof( cpt ) );
- cpt.cEntries = OPENGL_VERSION_110_ENTRIES;
-
- GPA_GL( NewList );
- GPA_GL( EndList );
- GPA_GL( CallList );
- GPA_GL( CallLists );
- GPA_GL( DeleteLists );
- GPA_GL( GenLists );
- GPA_GL( ListBase );
- GPA_GL( Begin );
- GPA_GL( Bitmap );
- GPA_GL( Color3b );
- GPA_GL( Color3bv );
- GPA_GL( Color3d );
- GPA_GL( Color3dv );
- GPA_GL( Color3f );
- GPA_GL( Color3fv );
- GPA_GL( Color3i );
- GPA_GL( Color3iv );
- GPA_GL( Color3s );
- GPA_GL( Color3sv );
- GPA_GL( Color3ub );
- GPA_GL( Color3ubv );
- GPA_GL( Color3ui );
- GPA_GL( Color3uiv );
- GPA_GL( Color3us );
- GPA_GL( Color3usv );
- GPA_GL( Color4b );
- GPA_GL( Color4bv );
- GPA_GL( Color4d );
- GPA_GL( Color4dv );
- GPA_GL( Color4f );
- GPA_GL( Color4fv );
- GPA_GL( Color4i );
- GPA_GL( Color4iv );
- GPA_GL( Color4s );
- GPA_GL( Color4sv );
- GPA_GL( Color4ub );
- GPA_GL( Color4ubv );
- GPA_GL( Color4ui );
- GPA_GL( Color4uiv );
- GPA_GL( Color4us );
- GPA_GL( Color4usv );
- GPA_GL( EdgeFlag );
- GPA_GL( EdgeFlagv );
- GPA_GL( End );
- GPA_GL( Indexd );
- GPA_GL( Indexdv );
- GPA_GL( Indexf );
- GPA_GL( Indexfv );
- GPA_GL( Indexi );
- GPA_GL( Indexiv );
- GPA_GL( Indexs );
- GPA_GL( Indexsv );
- GPA_GL( Normal3b );
- GPA_GL( Normal3bv );
- GPA_GL( Normal3d );
- GPA_GL( Normal3dv );
- GPA_GL( Normal3f );
- GPA_GL( Normal3fv );
- GPA_GL( Normal3i );
- GPA_GL( Normal3iv );
- GPA_GL( Normal3s );
- GPA_GL( Normal3sv );
- GPA_GL( RasterPos2d );
- GPA_GL( RasterPos2dv );
- GPA_GL( RasterPos2f );
- GPA_GL( RasterPos2fv );
- GPA_GL( RasterPos2i );
- GPA_GL( RasterPos2iv );
- GPA_GL( RasterPos2s );
- GPA_GL( RasterPos2sv );
- GPA_GL( RasterPos3d );
- GPA_GL( RasterPos3dv );
- GPA_GL( RasterPos3f );
- GPA_GL( RasterPos3fv );
- GPA_GL( RasterPos3i );
- GPA_GL( RasterPos3iv );
- GPA_GL( RasterPos3s );
- GPA_GL( RasterPos3sv );
- GPA_GL( RasterPos4d );
- GPA_GL( RasterPos4dv );
- GPA_GL( RasterPos4f );
- GPA_GL( RasterPos4fv );
- GPA_GL( RasterPos4i );
- GPA_GL( RasterPos4iv );
- GPA_GL( RasterPos4s );
- GPA_GL( RasterPos4sv );
- GPA_GL( Rectd );
- GPA_GL( Rectdv );
- GPA_GL( Rectf );
- GPA_GL( Rectfv );
- GPA_GL( Recti );
- GPA_GL( Rectiv );
- GPA_GL( Rects );
- GPA_GL( Rectsv );
- GPA_GL( TexCoord1d );
- GPA_GL( TexCoord1dv );
- GPA_GL( TexCoord1f );
- GPA_GL( TexCoord1fv );
- GPA_GL( TexCoord1i );
- GPA_GL( TexCoord1iv );
- GPA_GL( TexCoord1s );
- GPA_GL( TexCoord1sv );
- GPA_GL( TexCoord2d );
- GPA_GL( TexCoord2dv );
- GPA_GL( TexCoord2f );
- GPA_GL( TexCoord2fv );
- GPA_GL( TexCoord2i );
- GPA_GL( TexCoord2iv );
- GPA_GL( TexCoord2s );
- GPA_GL( TexCoord2sv );
- GPA_GL( TexCoord3d );
- GPA_GL( TexCoord3dv );
- GPA_GL( TexCoord3f );
- GPA_GL( TexCoord3fv );
- GPA_GL( TexCoord3i );
- GPA_GL( TexCoord3iv );
- GPA_GL( TexCoord3s );
- GPA_GL( TexCoord3sv );
- GPA_GL( TexCoord4d );
- GPA_GL( TexCoord4dv );
- GPA_GL( TexCoord4f );
- GPA_GL( TexCoord4fv );
- GPA_GL( TexCoord4i );
- GPA_GL( TexCoord4iv );
- GPA_GL( TexCoord4s );
- GPA_GL( TexCoord4sv );
- GPA_GL( Vertex2d );
- GPA_GL( Vertex2dv );
- GPA_GL( Vertex2f );
- GPA_GL( Vertex2fv );
- GPA_GL( Vertex2i );
- GPA_GL( Vertex2iv );
- GPA_GL( Vertex2s );
- GPA_GL( Vertex2sv );
- GPA_GL( Vertex3d );
- GPA_GL( Vertex3dv );
- GPA_GL( Vertex3f );
- GPA_GL( Vertex3fv );
- GPA_GL( Vertex3i );
- GPA_GL( Vertex3iv );
- GPA_GL( Vertex3s );
- GPA_GL( Vertex3sv );
- GPA_GL( Vertex4d );
- GPA_GL( Vertex4dv );
- GPA_GL( Vertex4f );
- GPA_GL( Vertex4fv );
- GPA_GL( Vertex4i );
- GPA_GL( Vertex4iv );
- GPA_GL( Vertex4s );
- GPA_GL( Vertex4sv );
- GPA_GL( ClipPlane );
- GPA_GL( ColorMaterial );
- GPA_GL( CullFace );
- GPA_GL( Fogf );
- GPA_GL( Fogfv );
- GPA_GL( Fogi );
- GPA_GL( Fogiv );
- GPA_GL( FrontFace );
- GPA_GL( Hint );
- GPA_GL( Lightf );
- GPA_GL( Lightfv );
- GPA_GL( Lighti );
- GPA_GL( Lightiv );
- GPA_GL( LightModelf );
- GPA_GL( LightModelfv );
- GPA_GL( LightModeli );
- GPA_GL( LightModeliv );
- GPA_GL( LineStipple );
- GPA_GL( LineWidth );
- GPA_GL( Materialf );
- GPA_GL( Materialfv );
- GPA_GL( Materiali );
- GPA_GL( Materialiv );
- GPA_GL( PointSize );
- GPA_GL( PolygonMode );
- GPA_GL( PolygonStipple );
- GPA_GL( Scissor );
- GPA_GL( ShadeModel );
- GPA_GL( TexParameterf );
- GPA_GL( TexParameterfv );
- GPA_GL( TexParameteri );
- GPA_GL( TexParameteriv );
- GPA_GL( TexImage1D );
- GPA_GL( TexImage2D );
- GPA_GL( TexEnvf );
- GPA_GL( TexEnvfv );
- GPA_GL( TexEnvi );
- GPA_GL( TexEnviv );
- GPA_GL( TexGend );
- GPA_GL( TexGendv );
- GPA_GL( TexGenf );
- GPA_GL( TexGenfv );
- GPA_GL( TexGeni );
- GPA_GL( TexGeniv );
- GPA_GL( FeedbackBuffer );
- GPA_GL( SelectBuffer );
- GPA_GL( RenderMode );
- GPA_GL( InitNames );
- GPA_GL( LoadName );
- GPA_GL( PassThrough );
- GPA_GL( PopName );
- GPA_GL( PushName );
- GPA_GL( DrawBuffer );
- GPA_GL( Clear );
- GPA_GL( ClearAccum );
- GPA_GL( ClearIndex );
- GPA_GL( ClearColor );
- GPA_GL( ClearStencil );
- GPA_GL( ClearDepth );
- GPA_GL( StencilMask );
- GPA_GL( ColorMask );
- GPA_GL( DepthMask );
- GPA_GL( IndexMask );
- GPA_GL( Accum );
- GPA_GL( Disable );
- GPA_GL( Enable );
- GPA_GL( Finish );
- GPA_GL( Flush );
- GPA_GL( PopAttrib );
- GPA_GL( PushAttrib );
- GPA_GL( Map1d );
- GPA_GL( Map1f );
- GPA_GL( Map2d );
- GPA_GL( Map2f );
- GPA_GL( MapGrid1d );
- GPA_GL( MapGrid1f );
- GPA_GL( MapGrid2d );
- GPA_GL( MapGrid2f );
- GPA_GL( EvalCoord1d );
- GPA_GL( EvalCoord1dv );
- GPA_GL( EvalCoord1f );
- GPA_GL( EvalCoord1fv );
- GPA_GL( EvalCoord2d );
- GPA_GL( EvalCoord2dv );
- GPA_GL( EvalCoord2f );
- GPA_GL( EvalCoord2fv );
- GPA_GL( EvalMesh1 );
- GPA_GL( EvalPoint1 );
- GPA_GL( EvalMesh2 );
- GPA_GL( EvalPoint2 );
- GPA_GL( AlphaFunc );
- GPA_GL( BlendFunc );
- GPA_GL( LogicOp );
- GPA_GL( StencilFunc );
- GPA_GL( StencilOp );
- GPA_GL( DepthFunc );
- GPA_GL( PixelZoom );
- GPA_GL( PixelTransferf );
- GPA_GL( PixelTransferi );
- GPA_GL( PixelStoref );
- GPA_GL( PixelStorei );
- GPA_GL( PixelMapfv );
- GPA_GL( PixelMapuiv );
- GPA_GL( PixelMapusv );
- GPA_GL( ReadBuffer );
- GPA_GL( CopyPixels );
- GPA_GL( ReadPixels );
- GPA_GL( DrawPixels );
- GPA_GL( GetBooleanv );
- GPA_GL( GetClipPlane );
- GPA_GL( GetDoublev );
- GPA_GL( GetError );
- GPA_GL( GetFloatv );
- GPA_GL( GetIntegerv );
- GPA_GL( GetLightfv );
- GPA_GL( GetLightiv );
- GPA_GL( GetMapdv );
- GPA_GL( GetMapfv );
- GPA_GL( GetMapiv );
- GPA_GL( GetMaterialfv );
- GPA_GL( GetMaterialiv );
- GPA_GL( GetPixelMapfv );
- GPA_GL( GetPixelMapuiv );
- GPA_GL( GetPixelMapusv );
- GPA_GL( GetPolygonStipple );
- GPA_GL( GetString );
- GPA_GL( GetTexEnvfv );
- GPA_GL( GetTexEnviv );
- GPA_GL( GetTexGendv );
- GPA_GL( GetTexGenfv );
- GPA_GL( GetTexGeniv );
- GPA_GL( GetTexImage );
- GPA_GL( GetTexParameterfv );
- GPA_GL( GetTexParameteriv );
- GPA_GL( GetTexLevelParameterfv );
- GPA_GL( GetTexLevelParameteriv );
- GPA_GL( IsEnabled );
- GPA_GL( IsList );
- GPA_GL( DepthRange );
- GPA_GL( Frustum );
- GPA_GL( LoadIdentity );
- GPA_GL( LoadMatrixf );
- GPA_GL( LoadMatrixd );
- GPA_GL( MatrixMode );
- GPA_GL( MultMatrixf );
- GPA_GL( MultMatrixd );
- GPA_GL( Ortho );
- GPA_GL( PopMatrix );
- GPA_GL( PushMatrix );
- GPA_GL( Rotated );
- GPA_GL( Rotatef );
- GPA_GL( Scaled );
- GPA_GL( Scalef );
- GPA_GL( Translated );
- GPA_GL( Translatef );
- GPA_GL( Viewport );
- GPA_GL( ArrayElement );
- GPA_GL( BindTexture );
- GPA_GL( ColorPointer );
- GPA_GL( DisableClientState );
- GPA_GL( DrawArrays );
- GPA_GL( DrawElements );
- GPA_GL( EdgeFlagPointer );
- GPA_GL( EnableClientState );
- GPA_GL( IndexPointer );
- GPA_GL( Indexub );
- GPA_GL( Indexubv );
- GPA_GL( InterleavedArrays );
- GPA_GL( NormalPointer );
- GPA_GL( PolygonOffset );
- GPA_GL( TexCoordPointer );
- GPA_GL( VertexPointer );
- GPA_GL( AreTexturesResident );
- GPA_GL( CopyTexImage1D );
- GPA_GL( CopyTexImage2D );
- GPA_GL( CopyTexSubImage1D );
- GPA_GL( CopyTexSubImage2D );
- GPA_GL( DeleteTextures );
- GPA_GL( GenTextures );
- GPA_GL( GetPointerv );
- GPA_GL( IsTexture );
- GPA_GL( PrioritizeTextures );
- GPA_GL( TexSubImage1D );
- GPA_GL( TexSubImage2D );
- GPA_GL( PopClientAttrib );
- GPA_GL( PushClientAttrib );
-
- return &cpt;
-}
-
-int APIENTRY
-DrvSetLayerPaletteEntries(
- HDC hdc,
- INT iLayerPlane,
- INT iStart,
- INT cEntries,
- CONST COLORREF *pcr )
-{
- debug_printf( "%s\n", __FUNCTION__ );
-
- return 0;
-}
-
-BOOL APIENTRY
-DrvSetPixelFormat(
- HDC hdc,
- LONG iPixelFormat )
-{
- PIXELFORMATDESCRIPTOR pfd;
- BOOL r;
-
- wglDescribePixelFormat( hdc, iPixelFormat, sizeof( pfd ), &pfd );
- r = wglSetPixelFormat( hdc, iPixelFormat, &pfd );
-
- debug_printf( "%s( 0x%p, %d ) = %s\n", __FUNCTION__, hdc, iPixelFormat, r ? "TRUE" : "FALSE" );
-
- return r;
-}
-
-BOOL APIENTRY
-DrvShareLists(
- DHGLRC dhglrc1,
- DHGLRC dhglrc2 )
-{
- debug_printf( "%s\n", __FUNCTION__ );
-
- return FALSE;
-}
-
-BOOL APIENTRY
-DrvSwapBuffers(
- HDC hdc )
-{
- debug_printf( "%s( 0x%p )\n", __FUNCTION__, hdc );
-
- return wglSwapBuffers( hdc );
-}
-
-BOOL APIENTRY
-DrvSwapLayerBuffers(
- HDC hdc,
- UINT fuPlanes )
-{
- debug_printf( "%s\n", __FUNCTION__ );
-
- return FALSE;
-}
-
-BOOL APIENTRY
-DrvValidateVersion(
- ULONG ulVersion )
-{
- debug_printf( "%s( %u )\n", __FUNCTION__, ulVersion );
-
- return ulVersion == 1;
-}
diff --git a/src/mesa/state_tracker/wgl/stw_icd.h b/src/mesa/state_tracker/wgl/stw_icd.h
deleted file mode 100644
index 8e676fb5b74..00000000000
--- a/src/mesa/state_tracker/wgl/stw_icd.h
+++ /dev/null
@@ -1,489 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef DRV_H
-#define DRV_H
-
-
-#include <windows.h>
-
-#include "GL/gl.h"
-
-
-typedef ULONG DHGLRC;
-
-#define OPENGL_VERSION_110_ENTRIES 336
-
-struct __GLdispatchTableRec
-{
- void (GLAPIENTRY * NewList)(GLuint, GLenum);
- void (GLAPIENTRY * EndList)(void);
- void (GLAPIENTRY * CallList)(GLuint);
- void (GLAPIENTRY * CallLists)(GLsizei, GLenum, const GLvoid *);
- void (GLAPIENTRY * DeleteLists)(GLuint, GLsizei);
- GLuint (GLAPIENTRY * GenLists)(GLsizei);
- void (GLAPIENTRY * ListBase)(GLuint);
- void (GLAPIENTRY * Begin)(GLenum);
- void (GLAPIENTRY * Bitmap)(GLsizei, GLsizei, GLfloat, GLfloat, GLfloat, GLfloat, const GLubyte *);
- void (GLAPIENTRY * Color3b)(GLbyte, GLbyte, GLbyte);
- void (GLAPIENTRY * Color3bv)(const GLbyte *);
- void (GLAPIENTRY * Color3d)(GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * Color3dv)(const GLdouble *);
- void (GLAPIENTRY * Color3f)(GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * Color3fv)(const GLfloat *);
- void (GLAPIENTRY * Color3i)(GLint, GLint, GLint);
- void (GLAPIENTRY * Color3iv)(const GLint *);
- void (GLAPIENTRY * Color3s)(GLshort, GLshort, GLshort);
- void (GLAPIENTRY * Color3sv)(const GLshort *);
- void (GLAPIENTRY * Color3ub)(GLubyte, GLubyte, GLubyte);
- void (GLAPIENTRY * Color3ubv)(const GLubyte *);
- void (GLAPIENTRY * Color3ui)(GLuint, GLuint, GLuint);
- void (GLAPIENTRY * Color3uiv)(const GLuint *);
- void (GLAPIENTRY * Color3us)(GLushort, GLushort, GLushort);
- void (GLAPIENTRY * Color3usv)(const GLushort *);
- void (GLAPIENTRY * Color4b)(GLbyte, GLbyte, GLbyte, GLbyte);
- void (GLAPIENTRY * Color4bv)(const GLbyte *);
- void (GLAPIENTRY * Color4d)(GLdouble, GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * Color4dv)(const GLdouble *);
- void (GLAPIENTRY * Color4f)(GLfloat, GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * Color4fv)(const GLfloat *);
- void (GLAPIENTRY * Color4i)(GLint, GLint, GLint, GLint);
- void (GLAPIENTRY * Color4iv)(const GLint *);
- void (GLAPIENTRY * Color4s)(GLshort, GLshort, GLshort, GLshort);
- void (GLAPIENTRY * Color4sv)(const GLshort *);
- void (GLAPIENTRY * Color4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
- void (GLAPIENTRY * Color4ubv)(const GLubyte *);
- void (GLAPIENTRY * Color4ui)(GLuint, GLuint, GLuint, GLuint);
- void (GLAPIENTRY * Color4uiv)(const GLuint *);
- void (GLAPIENTRY * Color4us)(GLushort, GLushort, GLushort, GLushort);
- void (GLAPIENTRY * Color4usv)(const GLushort *);
- void (GLAPIENTRY * EdgeFlag)(GLboolean);
- void (GLAPIENTRY * EdgeFlagv)(const GLboolean *);
- void (GLAPIENTRY * End)(void);
- void (GLAPIENTRY * Indexd)(GLdouble);
- void (GLAPIENTRY * Indexdv)(const GLdouble *);
- void (GLAPIENTRY * Indexf)(GLfloat);
- void (GLAPIENTRY * Indexfv)(const GLfloat *);
- void (GLAPIENTRY * Indexi)(GLint);
- void (GLAPIENTRY * Indexiv)(const GLint *);
- void (GLAPIENTRY * Indexs)(GLshort);
- void (GLAPIENTRY * Indexsv)(const GLshort *);
- void (GLAPIENTRY * Normal3b)(GLbyte, GLbyte, GLbyte);
- void (GLAPIENTRY * Normal3bv)(const GLbyte *);
- void (GLAPIENTRY * Normal3d)(GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * Normal3dv)(const GLdouble *);
- void (GLAPIENTRY * Normal3f)(GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * Normal3fv)(const GLfloat *);
- void (GLAPIENTRY * Normal3i)(GLint, GLint, GLint);
- void (GLAPIENTRY * Normal3iv)(const GLint *);
- void (GLAPIENTRY * Normal3s)(GLshort, GLshort, GLshort);
- void (GLAPIENTRY * Normal3sv)(const GLshort *);
- void (GLAPIENTRY * RasterPos2d)(GLdouble, GLdouble);
- void (GLAPIENTRY * RasterPos2dv)(const GLdouble *);
- void (GLAPIENTRY * RasterPos2f)(GLfloat, GLfloat);
- void (GLAPIENTRY * RasterPos2fv)(const GLfloat *);
- void (GLAPIENTRY * RasterPos2i)(GLint, GLint);
- void (GLAPIENTRY * RasterPos2iv)(const GLint *);
- void (GLAPIENTRY * RasterPos2s)(GLshort, GLshort);
- void (GLAPIENTRY * RasterPos2sv)(const GLshort *);
- void (GLAPIENTRY * RasterPos3d)(GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * RasterPos3dv)(const GLdouble *);
- void (GLAPIENTRY * RasterPos3f)(GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * RasterPos3fv)(const GLfloat *);
- void (GLAPIENTRY * RasterPos3i)(GLint, GLint, GLint);
- void (GLAPIENTRY * RasterPos3iv)(const GLint *);
- void (GLAPIENTRY * RasterPos3s)(GLshort, GLshort, GLshort);
- void (GLAPIENTRY * RasterPos3sv)(const GLshort *);
- void (GLAPIENTRY * RasterPos4d)(GLdouble, GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * RasterPos4dv)(const GLdouble *);
- void (GLAPIENTRY * RasterPos4f)(GLfloat, GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * RasterPos4fv)(const GLfloat *);
- void (GLAPIENTRY * RasterPos4i)(GLint, GLint, GLint, GLint);
- void (GLAPIENTRY * RasterPos4iv)(const GLint *);
- void (GLAPIENTRY * RasterPos4s)(GLshort, GLshort, GLshort, GLshort);
- void (GLAPIENTRY * RasterPos4sv)(const GLshort *);
- void (GLAPIENTRY * Rectd)(GLdouble, GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * Rectdv)(const GLdouble *, const GLdouble *);
- void (GLAPIENTRY * Rectf)(GLfloat, GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * Rectfv)(const GLfloat *, const GLfloat *);
- void (GLAPIENTRY * Recti)(GLint, GLint, GLint, GLint);
- void (GLAPIENTRY * Rectiv)(const GLint *, const GLint *);
- void (GLAPIENTRY * Rects)(GLshort, GLshort, GLshort, GLshort);
- void (GLAPIENTRY * Rectsv)(const GLshort *, const GLshort *);
- void (GLAPIENTRY * TexCoord1d)(GLdouble);
- void (GLAPIENTRY * TexCoord1dv)(const GLdouble *);
- void (GLAPIENTRY * TexCoord1f)(GLfloat);
- void (GLAPIENTRY * TexCoord1fv)(const GLfloat *);
- void (GLAPIENTRY * TexCoord1i)(GLint);
- void (GLAPIENTRY * TexCoord1iv)(const GLint *);
- void (GLAPIENTRY * TexCoord1s)(GLshort);
- void (GLAPIENTRY * TexCoord1sv)(const GLshort *);
- void (GLAPIENTRY * TexCoord2d)(GLdouble, GLdouble);
- void (GLAPIENTRY * TexCoord2dv)(const GLdouble *);
- void (GLAPIENTRY * TexCoord2f)(GLfloat, GLfloat);
- void (GLAPIENTRY * TexCoord2fv)(const GLfloat *);
- void (GLAPIENTRY * TexCoord2i)(GLint, GLint);
- void (GLAPIENTRY * TexCoord2iv)(const GLint *);
- void (GLAPIENTRY * TexCoord2s)(GLshort, GLshort);
- void (GLAPIENTRY * TexCoord2sv)(const GLshort *);
- void (GLAPIENTRY * TexCoord3d)(GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * TexCoord3dv)(const GLdouble *);
- void (GLAPIENTRY * TexCoord3f)(GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * TexCoord3fv)(const GLfloat *);
- void (GLAPIENTRY * TexCoord3i)(GLint, GLint, GLint);
- void (GLAPIENTRY * TexCoord3iv)(const GLint *);
- void (GLAPIENTRY * TexCoord3s)(GLshort, GLshort, GLshort);
- void (GLAPIENTRY * TexCoord3sv)(const GLshort *);
- void (GLAPIENTRY * TexCoord4d)(GLdouble, GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * TexCoord4dv)(const GLdouble *);
- void (GLAPIENTRY * TexCoord4f)(GLfloat, GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * TexCoord4fv)(const GLfloat *);
- void (GLAPIENTRY * TexCoord4i)(GLint, GLint, GLint, GLint);
- void (GLAPIENTRY * TexCoord4iv)(const GLint *);
- void (GLAPIENTRY * TexCoord4s)(GLshort, GLshort, GLshort, GLshort);
- void (GLAPIENTRY * TexCoord4sv)(const GLshort *);
- void (GLAPIENTRY * Vertex2d)(GLdouble, GLdouble);
- void (GLAPIENTRY * Vertex2dv)(const GLdouble *);
- void (GLAPIENTRY * Vertex2f)(GLfloat, GLfloat);
- void (GLAPIENTRY * Vertex2fv)(const GLfloat *);
- void (GLAPIENTRY * Vertex2i)(GLint, GLint);
- void (GLAPIENTRY * Vertex2iv)(const GLint *);
- void (GLAPIENTRY * Vertex2s)(GLshort, GLshort);
- void (GLAPIENTRY * Vertex2sv)(const GLshort *);
- void (GLAPIENTRY * Vertex3d)(GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * Vertex3dv)(const GLdouble *);
- void (GLAPIENTRY * Vertex3f)(GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * Vertex3fv)(const GLfloat *);
- void (GLAPIENTRY * Vertex3i)(GLint, GLint, GLint);
- void (GLAPIENTRY * Vertex3iv)(const GLint *);
- void (GLAPIENTRY * Vertex3s)(GLshort, GLshort, GLshort);
- void (GLAPIENTRY * Vertex3sv)(const GLshort *);
- void (GLAPIENTRY * Vertex4d)(GLdouble, GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * Vertex4dv)(const GLdouble *);
- void (GLAPIENTRY * Vertex4f)(GLfloat, GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * Vertex4fv)(const GLfloat *);
- void (GLAPIENTRY * Vertex4i)(GLint, GLint, GLint, GLint);
- void (GLAPIENTRY * Vertex4iv)(const GLint *);
- void (GLAPIENTRY * Vertex4s)(GLshort, GLshort, GLshort, GLshort);
- void (GLAPIENTRY * Vertex4sv)(const GLshort *);
- void (GLAPIENTRY * ClipPlane)(GLenum, const GLdouble *);
- void (GLAPIENTRY * ColorMaterial)(GLenum, GLenum);
- void (GLAPIENTRY * CullFace)(GLenum);
- void (GLAPIENTRY * Fogf)(GLenum, GLfloat);
- void (GLAPIENTRY * Fogfv)(GLenum, const GLfloat *);
- void (GLAPIENTRY * Fogi)(GLenum, GLint);
- void (GLAPIENTRY * Fogiv)(GLenum, const GLint *);
- void (GLAPIENTRY * FrontFace)(GLenum);
- void (GLAPIENTRY * Hint)(GLenum, GLenum);
- void (GLAPIENTRY * Lightf)(GLenum, GLenum, GLfloat);
- void (GLAPIENTRY * Lightfv)(GLenum, GLenum, const GLfloat *);
- void (GLAPIENTRY * Lighti)(GLenum, GLenum, GLint);
- void (GLAPIENTRY * Lightiv)(GLenum, GLenum, const GLint *);
- void (GLAPIENTRY * LightModelf)(GLenum, GLfloat);
- void (GLAPIENTRY * LightModelfv)(GLenum, const GLfloat *);
- void (GLAPIENTRY * LightModeli)(GLenum, GLint);
- void (GLAPIENTRY * LightModeliv)(GLenum, const GLint *);
- void (GLAPIENTRY * LineStipple)(GLint, GLushort);
- void (GLAPIENTRY * LineWidth)(GLfloat);
- void (GLAPIENTRY * Materialf)(GLenum, GLenum, GLfloat);
- void (GLAPIENTRY * Materialfv)(GLenum, GLenum, const GLfloat *);
- void (GLAPIENTRY * Materiali)(GLenum, GLenum, GLint);
- void (GLAPIENTRY * Materialiv)(GLenum, GLenum, const GLint *);
- void (GLAPIENTRY * PointSize)(GLfloat);
- void (GLAPIENTRY * PolygonMode)(GLenum, GLenum);
- void (GLAPIENTRY * PolygonStipple)(const GLubyte *);
- void (GLAPIENTRY * Scissor)(GLint, GLint, GLsizei, GLsizei);
- void (GLAPIENTRY * ShadeModel)(GLenum);
- void (GLAPIENTRY * TexParameterf)(GLenum, GLenum, GLfloat);
- void (GLAPIENTRY * TexParameterfv)(GLenum, GLenum, const GLfloat *);
- void (GLAPIENTRY * TexParameteri)(GLenum, GLenum, GLint);
- void (GLAPIENTRY * TexParameteriv)(GLenum, GLenum, const GLint *);
- void (GLAPIENTRY * TexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
- void (GLAPIENTRY * TexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
- void (GLAPIENTRY * TexEnvf)(GLenum, GLenum, GLfloat);
- void (GLAPIENTRY * TexEnvfv)(GLenum, GLenum, const GLfloat *);
- void (GLAPIENTRY * TexEnvi)(GLenum, GLenum, GLint);
- void (GLAPIENTRY * TexEnviv)(GLenum, GLenum, const GLint *);
- void (GLAPIENTRY * TexGend)(GLenum, GLenum, GLdouble);
- void (GLAPIENTRY * TexGendv)(GLenum, GLenum, const GLdouble *);
- void (GLAPIENTRY * TexGenf)(GLenum, GLenum, GLfloat);
- void (GLAPIENTRY * TexGenfv)(GLenum, GLenum, const GLfloat *);
- void (GLAPIENTRY * TexGeni)(GLenum, GLenum, GLint);
- void (GLAPIENTRY * TexGeniv)(GLenum, GLenum, const GLint *);
- void (GLAPIENTRY * FeedbackBuffer)(GLsizei, GLenum, GLfloat *);
- void (GLAPIENTRY * SelectBuffer)(GLsizei, GLuint *);
- GLint (GLAPIENTRY * RenderMode)(GLenum);
- void (GLAPIENTRY * InitNames)(void);
- void (GLAPIENTRY * LoadName)(GLuint);
- void (GLAPIENTRY * PassThrough)(GLfloat);
- void (GLAPIENTRY * PopName)(void);
- void (GLAPIENTRY * PushName)(GLuint);
- void (GLAPIENTRY * DrawBuffer)(GLenum);
- void (GLAPIENTRY * Clear)(GLbitfield);
- void (GLAPIENTRY * ClearAccum)(GLfloat, GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * ClearIndex)(GLfloat);
- void (GLAPIENTRY * ClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
- void (GLAPIENTRY * ClearStencil)(GLint);
- void (GLAPIENTRY * ClearDepth)(GLclampd);
- void (GLAPIENTRY * StencilMask)(GLuint);
- void (GLAPIENTRY * ColorMask)(GLboolean, GLboolean, GLboolean, GLboolean);
- void (GLAPIENTRY * DepthMask)(GLboolean);
- void (GLAPIENTRY * IndexMask)(GLuint);
- void (GLAPIENTRY * Accum)(GLenum, GLfloat);
- void (GLAPIENTRY * Disable)(GLenum);
- void (GLAPIENTRY * Enable)(GLenum);
- void (GLAPIENTRY * Finish)(void);
- void (GLAPIENTRY * Flush)(void);
- void (GLAPIENTRY * PopAttrib)(void);
- void (GLAPIENTRY * PushAttrib)(GLbitfield);
- void (GLAPIENTRY * Map1d)(GLenum, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
- void (GLAPIENTRY * Map1f)(GLenum, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
- void (GLAPIENTRY * Map2d)(GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
- void (GLAPIENTRY * Map2f)(GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
- void (GLAPIENTRY * MapGrid1d)(GLint, GLdouble, GLdouble);
- void (GLAPIENTRY * MapGrid1f)(GLint, GLfloat, GLfloat);
- void (GLAPIENTRY * MapGrid2d)(GLint, GLdouble, GLdouble, GLint, GLdouble, GLdouble);
- void (GLAPIENTRY * MapGrid2f)(GLint, GLfloat, GLfloat, GLint, GLfloat, GLfloat);
- void (GLAPIENTRY * EvalCoord1d)(GLdouble);
- void (GLAPIENTRY * EvalCoord1dv)(const GLdouble *);
- void (GLAPIENTRY * EvalCoord1f)(GLfloat);
- void (GLAPIENTRY * EvalCoord1fv)(const GLfloat *);
- void (GLAPIENTRY * EvalCoord2d)(GLdouble, GLdouble);
- void (GLAPIENTRY * EvalCoord2dv)(const GLdouble *);
- void (GLAPIENTRY * EvalCoord2f)(GLfloat, GLfloat);
- void (GLAPIENTRY * EvalCoord2fv)(const GLfloat *);
- void (GLAPIENTRY * EvalMesh1)(GLenum, GLint, GLint);
- void (GLAPIENTRY * EvalPoint1)(GLint);
- void (GLAPIENTRY * EvalMesh2)(GLenum, GLint, GLint, GLint, GLint);
- void (GLAPIENTRY * EvalPoint2)(GLint, GLint);
- void (GLAPIENTRY * AlphaFunc)(GLenum, GLclampf);
- void (GLAPIENTRY * BlendFunc)(GLenum, GLenum);
- void (GLAPIENTRY * LogicOp)(GLenum);
- void (GLAPIENTRY * StencilFunc)(GLenum, GLint, GLuint);
- void (GLAPIENTRY * StencilOp)(GLenum, GLenum, GLenum);
- void (GLAPIENTRY * DepthFunc)(GLenum);
- void (GLAPIENTRY * PixelZoom)(GLfloat, GLfloat);
- void (GLAPIENTRY * PixelTransferf)(GLenum, GLfloat);
- void (GLAPIENTRY * PixelTransferi)(GLenum, GLint);
- void (GLAPIENTRY * PixelStoref)(GLenum, GLfloat);
- void (GLAPIENTRY * PixelStorei)(GLenum, GLint);
- void (GLAPIENTRY * PixelMapfv)(GLenum, GLint, const GLfloat *);
- void (GLAPIENTRY * PixelMapuiv)(GLenum, GLint, const GLuint *);
- void (GLAPIENTRY * PixelMapusv)(GLenum, GLint, const GLushort *);
- void (GLAPIENTRY * ReadBuffer)(GLenum);
- void (GLAPIENTRY * CopyPixels)(GLint, GLint, GLsizei, GLsizei, GLenum);
- void (GLAPIENTRY * ReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *);
- void (GLAPIENTRY * DrawPixels)(GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
- void (GLAPIENTRY * GetBooleanv)(GLenum, GLboolean *);
- void (GLAPIENTRY * GetClipPlane)(GLenum, GLdouble *);
- void (GLAPIENTRY * GetDoublev)(GLenum, GLdouble *);
- GLenum (GLAPIENTRY * GetError)(void);
- void (GLAPIENTRY * GetFloatv)(GLenum, GLfloat *);
- void (GLAPIENTRY * GetIntegerv)(GLenum, GLint *);
- void (GLAPIENTRY * GetLightfv)(GLenum, GLenum, GLfloat *);
- void (GLAPIENTRY * GetLightiv)(GLenum, GLenum, GLint *);
- void (GLAPIENTRY * GetMapdv)(GLenum, GLenum, GLdouble *);
- void (GLAPIENTRY * GetMapfv)(GLenum, GLenum, GLfloat *);
- void (GLAPIENTRY * GetMapiv)(GLenum, GLenum, GLint *);
- void (GLAPIENTRY * GetMaterialfv)(GLenum, GLenum, GLfloat *);
- void (GLAPIENTRY * GetMaterialiv)(GLenum, GLenum, GLint *);
- void (GLAPIENTRY * GetPixelMapfv)(GLenum, GLfloat *);
- void (GLAPIENTRY * GetPixelMapuiv)(GLenum, GLuint *);
- void (GLAPIENTRY * GetPixelMapusv)(GLenum, GLushort *);
- void (GLAPIENTRY * GetPolygonStipple)(GLubyte *);
- const GLubyte * (GLAPIENTRY * GetString)(GLenum);
- void (GLAPIENTRY * GetTexEnvfv)(GLenum, GLenum, GLfloat *);
- void (GLAPIENTRY * GetTexEnviv)(GLenum, GLenum, GLint *);
- void (GLAPIENTRY * GetTexGendv)(GLenum, GLenum, GLdouble *);
- void (GLAPIENTRY * GetTexGenfv)(GLenum, GLenum, GLfloat *);
- void (GLAPIENTRY * GetTexGeniv)(GLenum, GLenum, GLint *);
- void (GLAPIENTRY * GetTexImage)(GLenum, GLint, GLenum, GLenum, GLvoid *);
- void (GLAPIENTRY * GetTexParameterfv)(GLenum, GLenum, GLfloat *);
- void (GLAPIENTRY * GetTexParameteriv)(GLenum, GLenum, GLint *);
- void (GLAPIENTRY * GetTexLevelParameterfv)(GLenum, GLint, GLenum, GLfloat *);
- void (GLAPIENTRY * GetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint *);
- GLboolean (GLAPIENTRY * IsEnabled)(GLenum);
- GLboolean (GLAPIENTRY * IsList)(GLuint);
- void (GLAPIENTRY * DepthRange)(GLclampd, GLclampd);
- void (GLAPIENTRY * Frustum)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * LoadIdentity)(void);
- void (GLAPIENTRY * LoadMatrixf)(const GLfloat *);
- void (GLAPIENTRY * LoadMatrixd)(const GLdouble *);
- void (GLAPIENTRY * MatrixMode)(GLenum);
- void (GLAPIENTRY * MultMatrixf)(const GLfloat *);
- void (GLAPIENTRY * MultMatrixd)(const GLdouble *);
- void (GLAPIENTRY * Ortho)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * PopMatrix)(void);
- void (GLAPIENTRY * PushMatrix)(void);
- void (GLAPIENTRY * Rotated)(GLdouble, GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * Rotatef)(GLfloat, GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * Scaled)(GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * Scalef)(GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * Translated)(GLdouble, GLdouble, GLdouble);
- void (GLAPIENTRY * Translatef)(GLfloat, GLfloat, GLfloat);
- void (GLAPIENTRY * Viewport)(GLint, GLint, GLsizei, GLsizei);
- void (GLAPIENTRY * ArrayElement)(GLint);
- void (GLAPIENTRY * BindTexture)(GLenum, GLuint);
- void (GLAPIENTRY * ColorPointer)(GLint, GLenum, GLsizei, const GLvoid *);
- void (GLAPIENTRY * DisableClientState)(GLenum);
- void (GLAPIENTRY * DrawArrays)(GLenum, GLint, GLsizei);
- void (GLAPIENTRY * DrawElements)(GLenum, GLsizei, GLenum, const GLvoid *);
- void (GLAPIENTRY * EdgeFlagPointer)(GLsizei, const GLvoid *);
- void (GLAPIENTRY * EnableClientState)(GLenum);
- void (GLAPIENTRY * IndexPointer)(GLenum, GLsizei, const GLvoid *);
- void (GLAPIENTRY * Indexub)(GLubyte);
- void (GLAPIENTRY * Indexubv)(const GLubyte *);
- void (GLAPIENTRY * InterleavedArrays)(GLenum, GLsizei, const GLvoid *);
- void (GLAPIENTRY * NormalPointer)(GLenum, GLsizei, const GLvoid *);
- void (GLAPIENTRY * PolygonOffset)(GLfloat, GLfloat);
- void (GLAPIENTRY * TexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid *);
- void (GLAPIENTRY * VertexPointer)(GLint, GLenum, GLsizei, const GLvoid *);
- GLboolean (GLAPIENTRY * AreTexturesResident)(GLsizei, const GLuint *, GLboolean *);
- void (GLAPIENTRY * CopyTexImage1D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
- void (GLAPIENTRY * CopyTexImage2D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
- void (GLAPIENTRY * CopyTexSubImage1D)(GLenum, GLint, GLint, GLint, GLint, GLsizei);
- void (GLAPIENTRY * CopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
- void (GLAPIENTRY * DeleteTextures)(GLsizei, const GLuint *);
- void (GLAPIENTRY * GenTextures)(GLsizei, GLuint *);
- void (GLAPIENTRY * GetPointerv)(GLenum, GLvoid **);
- GLboolean (GLAPIENTRY * IsTexture)(GLuint);
- void (GLAPIENTRY * PrioritizeTextures)(GLsizei, const GLuint *, const GLclampf *);
- void (GLAPIENTRY * TexSubImage1D)(GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
- void (GLAPIENTRY * TexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
- void (GLAPIENTRY * PopClientAttrib)(void);
- void (GLAPIENTRY * PushClientAttrib)(GLbitfield);
-};
-
-typedef struct __GLdispatchTableRec GLDISPATCHTABLE;
-
-typedef struct _GLCLTPROCTABLE
-{
- int cEntries;
- GLDISPATCHTABLE glDispatchTable;
-} GLCLTPROCTABLE, * PGLCLTPROCTABLE;
-
-typedef VOID (APIENTRY * PFN_SETPROCTABLE)(PGLCLTPROCTABLE);
-
-BOOL APIENTRY
-DrvCopyContext(
- DHGLRC dhrcSource,
- DHGLRC dhrcDest,
- UINT fuMask );
-
-DHGLRC APIENTRY
-DrvCreateLayerContext(
- HDC hdc,
- INT iLayerPlane );
-
-DHGLRC APIENTRY
-DrvCreateContext(
- HDC hdc );
-
-BOOL APIENTRY
-DrvDeleteContext(
- DHGLRC dhglrc );
-
-BOOL APIENTRY
-DrvDescribeLayerPlane(
- HDC hdc,
- INT iPixelFormat,
- INT iLayerPlane,
- UINT nBytes,
- LPLAYERPLANEDESCRIPTOR plpd );
-
-LONG APIENTRY
-DrvDescribePixelFormat(
- HDC hdc,
- INT iPixelFormat,
- ULONG cjpfd,
- PIXELFORMATDESCRIPTOR *ppfd );
-
-int APIENTRY
-DrvGetLayerPaletteEntries(
- HDC hdc,
- INT iLayerPlane,
- INT iStart,
- INT cEntries,
- COLORREF *pcr );
-
-PROC APIENTRY
-DrvGetProcAddress(
- LPCSTR lpszProc );
-
-BOOL APIENTRY
-DrvRealizeLayerPalette(
- HDC hdc,
- INT iLayerPlane,
- BOOL bRealize );
-
-BOOL APIENTRY
-DrvReleaseContext(
- DHGLRC dhglrc );
-
-void APIENTRY
-DrvSetCallbackProcs(
- INT nProcs,
- PROC *pProcs );
-
-PGLCLTPROCTABLE APIENTRY
-DrvSetContext(
- HDC hdc,
- DHGLRC dhglrc,
- PFN_SETPROCTABLE pfnSetProcTable );
-
-int APIENTRY
-DrvSetLayerPaletteEntries(
- HDC hdc,
- INT iLayerPlane,
- INT iStart,
- INT cEntries,
- CONST COLORREF *pcr );
-
-BOOL APIENTRY
-DrvSetPixelFormat(
- HDC hdc,
- LONG iPixelFormat );
-
-BOOL APIENTRY
-DrvShareLists(
- DHGLRC dhglrc1,
- DHGLRC dhglrc2 );
-
-BOOL APIENTRY
-DrvSwapBuffers(
- HDC hdc );
-
-BOOL APIENTRY
-DrvSwapLayerBuffers(
- HDC hdc,
- UINT fuPlanes );
-
-BOOL APIENTRY
-DrvValidateVersion(
- ULONG ulVersion );
-
-#endif /* DRV_H */
diff --git a/src/mesa/state_tracker/wgl/stw_pixelformat.c b/src/mesa/state_tracker/wgl/stw_pixelformat.c
deleted file mode 100644
index 7a054af3d3e..00000000000
--- a/src/mesa/state_tracker/wgl/stw_pixelformat.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "pipe/p_debug.h"
-#include "stw_pixelformat.h"
-
-#define MAX_PIXELFORMATS 16
-
-static struct pixelformat_info pixelformats[MAX_PIXELFORMATS];
-static uint pixelformat_count = 0;
-static uint pixelformat_extended_count = 0;
-
-static void
-add_standard_pixelformats(
- struct pixelformat_info **ppf,
- uint flags )
-{
- struct pixelformat_info *pf = *ppf;
- struct pixelformat_color_info color24 = { 8, 0, 8, 8, 8, 16 };
- struct pixelformat_alpha_info alpha8 = { 8, 24 };
- struct pixelformat_alpha_info noalpha = { 0, 0 };
- struct pixelformat_depth_info depth24s8 = { 24, 8 };
- struct pixelformat_depth_info depth16 = { 16, 0 };
-
- pf->flags = PF_FLAG_DOUBLEBUFFER | flags;
- pf->color = color24;
- pf->alpha = alpha8;
- pf->depth = depth16;
- pf++;
-
- pf->flags = PF_FLAG_DOUBLEBUFFER | flags;
- pf->color = color24;
- pf->alpha = alpha8;
- pf->depth = depth24s8;
- pf++;
-
- pf->flags = PF_FLAG_DOUBLEBUFFER | flags;
- pf->color = color24;
- pf->alpha = noalpha;
- pf->depth = depth16;
- pf++;
-
- pf->flags = PF_FLAG_DOUBLEBUFFER | flags;
- pf->color = color24;
- pf->alpha = noalpha;
- pf->depth = depth24s8;
- pf++;
-
- pf->flags = flags;
- pf->color = color24;
- pf->alpha = noalpha;
- pf->depth = depth16;
- pf++;
-
- pf->flags = flags;
- pf->color = color24;
- pf->alpha = noalpha;
- pf->depth = depth24s8;
- pf++;
-
- *ppf = pf;
-}
-
-void
-pixelformat_init( void )
-{
- struct pixelformat_info *pf = pixelformats;
-
- add_standard_pixelformats( &pf, 0 );
- pixelformat_count = pf - pixelformats;
-
- add_standard_pixelformats( &pf, PF_FLAG_MULTISAMPLED );
- pixelformat_extended_count = pf - pixelformats;
-
- assert( pixelformat_extended_count <= MAX_PIXELFORMATS );
-}
-
-uint
-pixelformat_get_count( void )
-{
- return pixelformat_count;
-}
-
-uint
-pixelformat_get_extended_count( void )
-{
- return pixelformat_extended_count;
-}
-
-const struct pixelformat_info *
-pixelformat_get_info( uint index )
-{
- assert( index < pixelformat_extended_count );
-
- return &pixelformats[index];
-}
diff --git a/src/mesa/state_tracker/wgl/stw_pixelformat.h b/src/mesa/state_tracker/wgl/stw_pixelformat.h
deleted file mode 100644
index 0b67da8d25c..00000000000
--- a/src/mesa/state_tracker/wgl/stw_pixelformat.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef PIXELFORMAT_H
-#define PIXELFORMAT_H
-
-#define PF_FLAG_DOUBLEBUFFER 0x00000001
-#define PF_FLAG_MULTISAMPLED 0x00000002
-
-struct pixelformat_color_info
-{
- uint redbits;
- uint redshift;
- uint greenbits;
- uint greenshift;
- uint bluebits;
- uint blueshift;
-};
-
-struct pixelformat_alpha_info
-{
- uint alphabits;
- uint alphashift;
-};
-
-struct pixelformat_depth_info
-{
- uint depthbits;
- uint stencilbits;
-};
-
-struct pixelformat_info
-{
- uint flags;
- struct pixelformat_color_info color;
- struct pixelformat_alpha_info alpha;
- struct pixelformat_depth_info depth;
-};
-
-void
-pixelformat_init( void );
-
-uint
-pixelformat_get_count( void );
-
-uint
-pixelformat_get_extended_count( void );
-
-const struct pixelformat_info *
-pixelformat_get_info( uint index );
-
-#endif /* PIXELFORMAT_H */
diff --git a/src/mesa/state_tracker/wgl/stw_quirks.c b/src/mesa/state_tracker/wgl/stw_quirks.c
deleted file mode 100644
index bf1ec3fee76..00000000000
--- a/src/mesa/state_tracker/wgl/stw_quirks.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-/**
- * @file
- *
- * This is hopefully a temporary hack to define some needed dispatch
- * table entries. Hopefully, I'll find a better solution. The
- * dispatch table generation scripts ought to be making these dummy
- * stubs as well.
- */
-
-void gl_dispatch_stub_543(void){}
-void gl_dispatch_stub_544(void){}
-void gl_dispatch_stub_545(void){}
-void gl_dispatch_stub_546(void){}
-void gl_dispatch_stub_547(void){}
-void gl_dispatch_stub_548(void){}
-void gl_dispatch_stub_549(void){}
-void gl_dispatch_stub_550(void){}
-void gl_dispatch_stub_551(void){}
-void gl_dispatch_stub_552(void){}
-void gl_dispatch_stub_553(void){}
-void gl_dispatch_stub_554(void){}
-void gl_dispatch_stub_555(void){}
-void gl_dispatch_stub_556(void){}
-void gl_dispatch_stub_557(void){}
-void gl_dispatch_stub_558(void){}
-void gl_dispatch_stub_559(void){}
-void gl_dispatch_stub_560(void){}
-void gl_dispatch_stub_561(void){}
-void gl_dispatch_stub_565(void){}
-void gl_dispatch_stub_566(void){}
-void gl_dispatch_stub_577(void){}
-void gl_dispatch_stub_578(void){}
-void gl_dispatch_stub_603(void){}
-void gl_dispatch_stub_645(void){}
-void gl_dispatch_stub_646(void){}
-void gl_dispatch_stub_647(void){}
-void gl_dispatch_stub_648(void){}
-void gl_dispatch_stub_649(void){}
-void gl_dispatch_stub_650(void){}
-void gl_dispatch_stub_651(void){}
-void gl_dispatch_stub_652(void){}
-void gl_dispatch_stub_653(void){}
-void gl_dispatch_stub_733(void){}
-void gl_dispatch_stub_734(void){}
-void gl_dispatch_stub_735(void){}
-void gl_dispatch_stub_736(void){}
-void gl_dispatch_stub_737(void){}
-void gl_dispatch_stub_738(void){}
-void gl_dispatch_stub_744(void){}
-void gl_dispatch_stub_745(void){}
-void gl_dispatch_stub_746(void){}
-void gl_dispatch_stub_760(void){}
-void gl_dispatch_stub_761(void){}
-void gl_dispatch_stub_763(void){}
-void gl_dispatch_stub_765(void){}
-void gl_dispatch_stub_766(void){}
-void gl_dispatch_stub_767(void){}
-void gl_dispatch_stub_768(void){}
-
-void gl_dispatch_stub_562(void){}
-void gl_dispatch_stub_563(void){}
-void gl_dispatch_stub_564(void){}
-void gl_dispatch_stub_567(void){}
-void gl_dispatch_stub_568(void){}
-void gl_dispatch_stub_569(void){}
-void gl_dispatch_stub_580(void){}
-void gl_dispatch_stub_581(void){}
-void gl_dispatch_stub_606(void){}
-void gl_dispatch_stub_654(void){}
-void gl_dispatch_stub_655(void){}
-void gl_dispatch_stub_656(void){}
-void gl_dispatch_stub_739(void){}
-void gl_dispatch_stub_740(void){}
-void gl_dispatch_stub_741(void){}
-void gl_dispatch_stub_748(void){}
-void gl_dispatch_stub_749(void){}
-void gl_dispatch_stub_769(void){}
-void gl_dispatch_stub_770(void){}
-void gl_dispatch_stub_771(void){}
-void gl_dispatch_stub_772(void){}
-void gl_dispatch_stub_773(void){}
diff --git a/src/mesa/state_tracker/wgl/stw_wgl.c b/src/mesa/state_tracker/wgl/stw_wgl.c
deleted file mode 100644
index 0528c369fc8..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-
-#include "pipe/p_debug.h"
-
-WINGDIAPI BOOL APIENTRY
-wglUseFontBitmapsA(
- HDC hdc,
- DWORD first,
- DWORD count,
- DWORD listBase )
-{
- (void) hdc;
- (void) first;
- (void) count;
- (void) listBase;
-
- assert( 0 );
-
- return FALSE;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglShareLists(
- HGLRC hglrc1,
- HGLRC hglrc2 )
-{
- (void) hglrc1;
- (void) hglrc2;
-
- assert( 0 );
-
- return FALSE;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglUseFontBitmapsW(
- HDC hdc,
- DWORD first,
- DWORD count,
- DWORD listBase )
-{
- (void) hdc;
- (void) first;
- (void) count;
- (void) listBase;
-
- assert( 0 );
-
- return FALSE;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglUseFontOutlinesA(
- HDC hdc,
- DWORD first,
- DWORD count,
- DWORD listBase,
- FLOAT deviation,
- FLOAT extrusion,
- int format,
- LPGLYPHMETRICSFLOAT lpgmf )
-{
- (void) hdc;
- (void) first;
- (void) count;
- (void) listBase;
- (void) deviation;
- (void) extrusion;
- (void) format;
- (void) lpgmf;
-
- assert( 0 );
-
- return FALSE;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglUseFontOutlinesW(
- HDC hdc,
- DWORD first,
- DWORD count,
- DWORD listBase,
- FLOAT deviation,
- FLOAT extrusion,
- int format,
- LPGLYPHMETRICSFLOAT lpgmf )
-{
- (void) hdc;
- (void) first;
- (void) count;
- (void) listBase;
- (void) deviation;
- (void) extrusion;
- (void) format;
- (void) lpgmf;
-
- assert( 0 );
-
- return FALSE;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglDescribeLayerPlane(
- HDC hdc,
- int iPixelFormat,
- int iLayerPlane,
- UINT nBytes,
- LPLAYERPLANEDESCRIPTOR plpd )
-{
- (void) hdc;
- (void) iPixelFormat;
- (void) iLayerPlane;
- (void) nBytes;
- (void) plpd;
-
- assert( 0 );
-
- return FALSE;
-}
-
-WINGDIAPI int APIENTRY
-wglSetLayerPaletteEntries(
- HDC hdc,
- int iLayerPlane,
- int iStart,
- int cEntries,
- CONST COLORREF *pcr )
-{
- (void) hdc;
- (void) iLayerPlane;
- (void) iStart;
- (void) cEntries;
- (void) pcr;
-
- assert( 0 );
-
- return 0;
-}
-
-WINGDIAPI int APIENTRY
-wglGetLayerPaletteEntries(
- HDC hdc,
- int iLayerPlane,
- int iStart,
- int cEntries,
- COLORREF *pcr )
-{
- (void) hdc;
- (void) iLayerPlane;
- (void) iStart;
- (void) cEntries;
- (void) pcr;
-
- assert( 0 );
-
- return 0;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglRealizeLayerPalette(
- HDC hdc,
- int iLayerPlane,
- BOOL bRealize )
-{
- (void) hdc;
- (void) iLayerPlane;
- (void) bRealize;
-
- assert( 0 );
-
- return FALSE;
-}
diff --git a/src/mesa/state_tracker/wgl/stw_wgl.h b/src/mesa/state_tracker/wgl/stw_wgl.h
deleted file mode 100644
index b86cc240f28..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef STW_WGL_H_
-#define STW_WGL_H_
-
-
-#include <windows.h>
-
-#include "GL/gl.h"
-
-
-/*
- * Undeclared APIs exported by opengl32.dll
- */
-
-WINGDIAPI BOOL WINAPI
-wglSwapBuffers(HDC hdc);
-
-WINGDIAPI int WINAPI
-wglChoosePixelFormat(HDC hdc,
- CONST PIXELFORMATDESCRIPTOR *ppfd);
-
-WINGDIAPI int WINAPI
-wglDescribePixelFormat(HDC hdc,
- int iPixelFormat,
- UINT nBytes,
- LPPIXELFORMATDESCRIPTOR ppfd);
-
-WINGDIAPI int WINAPI
-wglGetPixelFormat(HDC hdc);
-
-WINGDIAPI BOOL WINAPI
-wglSetPixelFormat(HDC hdc,
- int iPixelFormat,
- CONST PIXELFORMATDESCRIPTOR *ppfd);
-
-
-#endif /* STW_WGL_H_ */
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.c b/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.c
deleted file mode 100644
index 04865796ec8..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-
-#include "stw_wgl_arbextensionsstring.h"
-
-WINGDIAPI const char * APIENTRY
-wglGetExtensionsStringARB(
- HDC hdc )
-{
- (void) hdc;
-
- return
- "WGL_ARB_extensions_string "
- "WGL_ARB_multisample "
- "WGL_ARB_pixel_format";
-}
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.h b/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.h
deleted file mode 100644
index a0e4c5d98e8..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef WGL_ARBEXTENSIONSSTRING_H
-#define WGL_ARBEXTENSIONSSTRING_H
-
-WINGDIAPI const char * APIENTRY
-wglGetExtensionsStringARB(
- HDC hdc );
-
-#endif /* WGL_ARBEXTENSIONSSTRING_H */
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_arbmultisample.c b/src/mesa/state_tracker/wgl/stw_wgl_arbmultisample.c
deleted file mode 100644
index aad04e3e8a2..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_arbmultisample.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-#include "stw_wgl_arbmultisample.h"
-
-int
-wgl_query_sample_buffers( void )
-{
- return 1;
-}
-
-int
-wgl_query_samples( void )
-{
- return 4;
-}
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_arbmultisample.h b/src/mesa/state_tracker/wgl/stw_wgl_arbmultisample.h
deleted file mode 100644
index de3e2cc6a33..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_arbmultisample.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef WGL_ARBMULTISAMPLE_H
-#define WGL_ARBMULTISAMPLE_H
-
-#define WGL_SAMPLE_BUFFERS_ARB 0x2041
-#define WGL_SAMPLES_ARB 0x2042
-
-int
-wgl_query_sample_buffers( void );
-
-int
-wgl_query_samples( void );
-
-#endif /* WGL_ARBMULTISAMPLE_H */
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.c b/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.c
deleted file mode 100644
index 344bb15d3c1..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.c
+++ /dev/null
@@ -1,513 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-
-#include "pipe/p_compiler.h"
-#include "util/u_memory.h"
-#include "stw_pixelformat.h"
-#include "stw_wgl_arbmultisample.h"
-#include "stw_wgl_arbpixelformat.h"
-
-#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
-#define WGL_DRAW_TO_WINDOW_ARB 0x2001
-#define WGL_DRAW_TO_BITMAP_ARB 0x2002
-#define WGL_ACCELERATION_ARB 0x2003
-#define WGL_NEED_PALETTE_ARB 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
-#define WGL_SWAP_METHOD_ARB 0x2007
-#define WGL_NUMBER_OVERLAYS_ARB 0x2008
-#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
-#define WGL_TRANSPARENT_ARB 0x200A
-#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
-#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
-#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
-#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
-#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
-#define WGL_SHARE_DEPTH_ARB 0x200C
-#define WGL_SHARE_STENCIL_ARB 0x200D
-#define WGL_SHARE_ACCUM_ARB 0x200E
-#define WGL_SUPPORT_GDI_ARB 0x200F
-#define WGL_SUPPORT_OPENGL_ARB 0x2010
-#define WGL_DOUBLE_BUFFER_ARB 0x2011
-#define WGL_STEREO_ARB 0x2012
-#define WGL_PIXEL_TYPE_ARB 0x2013
-#define WGL_COLOR_BITS_ARB 0x2014
-#define WGL_RED_BITS_ARB 0x2015
-#define WGL_RED_SHIFT_ARB 0x2016
-#define WGL_GREEN_BITS_ARB 0x2017
-#define WGL_GREEN_SHIFT_ARB 0x2018
-#define WGL_BLUE_BITS_ARB 0x2019
-#define WGL_BLUE_SHIFT_ARB 0x201A
-#define WGL_ALPHA_BITS_ARB 0x201B
-#define WGL_ALPHA_SHIFT_ARB 0x201C
-#define WGL_ACCUM_BITS_ARB 0x201D
-#define WGL_ACCUM_RED_BITS_ARB 0x201E
-#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
-#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
-#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
-#define WGL_DEPTH_BITS_ARB 0x2022
-#define WGL_STENCIL_BITS_ARB 0x2023
-#define WGL_AUX_BUFFERS_ARB 0x2024
-
-#define WGL_NO_ACCELERATION_ARB 0x2025
-#define WGL_GENERIC_ACCELERATION_ARB 0x2026
-#define WGL_FULL_ACCELERATION_ARB 0x2027
-
-#define WGL_SWAP_EXCHANGE_ARB 0x2028
-#define WGL_SWAP_COPY_ARB 0x2029
-#define WGL_SWAP_UNDEFINED_ARB 0x202A
-
-#define WGL_TYPE_RGBA_ARB 0x202B
-#define WGL_TYPE_COLORINDEX_ARB 0x202C
-
-static boolean
-query_attrib(
- int iPixelFormat,
- int iLayerPlane,
- int attrib,
- int *pvalue )
-{
- uint count;
- uint index;
- const struct pixelformat_info *pf;
-
- count = pixelformat_get_extended_count();
-
- if (attrib == WGL_NUMBER_PIXEL_FORMATS_ARB) {
- *pvalue = (int) count;
- return TRUE;
- }
-
- index = (uint) iPixelFormat - 1;
- if (index >= count)
- return FALSE;
-
- pf = pixelformat_get_info( index );
-
- switch (attrib) {
- case WGL_DRAW_TO_WINDOW_ARB:
- *pvalue = TRUE;
- return TRUE;
-
- case WGL_DRAW_TO_BITMAP_ARB:
- *pvalue = FALSE;
- return TRUE;
-
- case WGL_NEED_PALETTE_ARB:
- *pvalue = FALSE;
- return TRUE;
-
- case WGL_NEED_SYSTEM_PALETTE_ARB:
- *pvalue = FALSE;
- return TRUE;
-
- case WGL_SWAP_METHOD_ARB:
- if (pf->flags & PF_FLAG_DOUBLEBUFFER)
- *pvalue = WGL_SWAP_COPY_ARB;
- else
- *pvalue = WGL_SWAP_UNDEFINED_ARB;
- return TRUE;
-
- case WGL_SWAP_LAYER_BUFFERS_ARB:
- *pvalue = FALSE;
- return TRUE;
-
- case WGL_NUMBER_OVERLAYS_ARB:
- *pvalue = 0;
- return TRUE;
-
- case WGL_NUMBER_UNDERLAYS_ARB:
- *pvalue = 0;
- return TRUE;
- }
-
- if (iLayerPlane != 0)
- return FALSE;
-
- switch (attrib) {
- case WGL_ACCELERATION_ARB:
- *pvalue = WGL_FULL_ACCELERATION_ARB;
- break;
-
- case WGL_TRANSPARENT_ARB:
- *pvalue = FALSE;
- break;
-
- case WGL_TRANSPARENT_RED_VALUE_ARB:
- case WGL_TRANSPARENT_GREEN_VALUE_ARB:
- case WGL_TRANSPARENT_BLUE_VALUE_ARB:
- case WGL_TRANSPARENT_ALPHA_VALUE_ARB:
- case WGL_TRANSPARENT_INDEX_VALUE_ARB:
- break;
-
- case WGL_SHARE_DEPTH_ARB:
- case WGL_SHARE_STENCIL_ARB:
- case WGL_SHARE_ACCUM_ARB:
- *pvalue = TRUE;
- break;
-
- case WGL_SUPPORT_GDI_ARB:
- *pvalue = FALSE;
- break;
-
- case WGL_SUPPORT_OPENGL_ARB:
- *pvalue = TRUE;
- break;
-
- case WGL_DOUBLE_BUFFER_ARB:
- if (pf->flags & PF_FLAG_DOUBLEBUFFER)
- *pvalue = TRUE;
- else
- *pvalue = FALSE;
- break;
-
- case WGL_STEREO_ARB:
- *pvalue = FALSE;
- break;
-
- case WGL_PIXEL_TYPE_ARB:
- *pvalue = WGL_TYPE_RGBA_ARB;
- break;
-
- case WGL_COLOR_BITS_ARB:
- *pvalue = (int) (pf->color.redbits + pf->color.greenbits + pf->color.bluebits);
- break;
-
- case WGL_RED_BITS_ARB:
- *pvalue = (int) pf->color.redbits;
- break;
-
- case WGL_RED_SHIFT_ARB:
- *pvalue = (int) pf->color.redshift;
- break;
-
- case WGL_GREEN_BITS_ARB:
- *pvalue = (int) pf->color.greenbits;
- break;
-
- case WGL_GREEN_SHIFT_ARB:
- *pvalue = (int) pf->color.greenshift;
- break;
-
- case WGL_BLUE_BITS_ARB:
- *pvalue = (int) pf->color.bluebits;
- break;
-
- case WGL_BLUE_SHIFT_ARB:
- *pvalue = (int) pf->color.blueshift;
- break;
-
- case WGL_ALPHA_BITS_ARB:
- *pvalue = (int) pf->alpha.alphabits;
- break;
-
- case WGL_ALPHA_SHIFT_ARB:
- *pvalue = (int) pf->alpha.alphashift;
- break;
-
- case WGL_ACCUM_BITS_ARB:
- case WGL_ACCUM_RED_BITS_ARB:
- case WGL_ACCUM_GREEN_BITS_ARB:
- case WGL_ACCUM_BLUE_BITS_ARB:
- case WGL_ACCUM_ALPHA_BITS_ARB:
- *pvalue = 0;
- break;
-
- case WGL_DEPTH_BITS_ARB:
- *pvalue = (int) pf->depth.depthbits;
- break;
-
- case WGL_STENCIL_BITS_ARB:
- *pvalue = (int) pf->depth.stencilbits;
- break;
-
- case WGL_AUX_BUFFERS_ARB:
- *pvalue = 0;
- break;
-
- case WGL_SAMPLE_BUFFERS_ARB:
- if (pf->flags & PF_FLAG_MULTISAMPLED)
- *pvalue = wgl_query_sample_buffers();
- else
- *pvalue = 0;
- break;
-
- case WGL_SAMPLES_ARB:
- if (pf->flags & PF_FLAG_MULTISAMPLED)
- *pvalue = wgl_query_samples();
- else
- *pvalue = 0;
- break;
-
- default:
- return FALSE;
- }
-
- return TRUE;
-}
-
-struct attrib_match_info
-{
- int attribute;
- int weight;
- BOOL exact;
-};
-
-static struct attrib_match_info attrib_match[] = {
-
- /* WGL_ARB_pixel_format */
- { WGL_DRAW_TO_WINDOW_ARB, 0, TRUE },
- { WGL_DRAW_TO_BITMAP_ARB, 0, TRUE },
- { WGL_ACCELERATION_ARB, 0, TRUE },
- { WGL_NEED_PALETTE_ARB, 0, TRUE },
- { WGL_NEED_SYSTEM_PALETTE_ARB, 0, TRUE },
- { WGL_SWAP_LAYER_BUFFERS_ARB, 0, TRUE },
- { WGL_SWAP_METHOD_ARB, 0, TRUE },
- { WGL_NUMBER_OVERLAYS_ARB, 4, FALSE },
- { WGL_NUMBER_UNDERLAYS_ARB, 4, FALSE },
- /*{ WGL_SHARE_DEPTH_ARB, 0, TRUE },*/ /* no overlays -- ignore */
- /*{ WGL_SHARE_STENCIL_ARB, 0, TRUE },*/ /* no overlays -- ignore */
- /*{ WGL_SHARE_ACCUM_ARB, 0, TRUE },*/ /* no overlays -- ignore */
- { WGL_SUPPORT_GDI_ARB, 0, TRUE },
- { WGL_SUPPORT_OPENGL_ARB, 0, TRUE },
- { WGL_DOUBLE_BUFFER_ARB, 0, TRUE },
- { WGL_STEREO_ARB, 0, TRUE },
- { WGL_PIXEL_TYPE_ARB, 0, TRUE },
- { WGL_COLOR_BITS_ARB, 1, FALSE },
- { WGL_RED_BITS_ARB, 1, FALSE },
- { WGL_GREEN_BITS_ARB, 1, FALSE },
- { WGL_BLUE_BITS_ARB, 1, FALSE },
- { WGL_ALPHA_BITS_ARB, 1, FALSE },
- { WGL_ACCUM_BITS_ARB, 1, FALSE },
- { WGL_ACCUM_RED_BITS_ARB, 1, FALSE },
- { WGL_ACCUM_GREEN_BITS_ARB, 1, FALSE },
- { WGL_ACCUM_BLUE_BITS_ARB, 1, FALSE },
- { WGL_ACCUM_ALPHA_BITS_ARB, 1, FALSE },
- { WGL_DEPTH_BITS_ARB, 1, FALSE },
- { WGL_STENCIL_BITS_ARB, 1, FALSE },
- { WGL_AUX_BUFFERS_ARB, 2, FALSE },
-
- /* WGL_ARB_multisample */
- { WGL_SAMPLE_BUFFERS_ARB, 2, FALSE },
- { WGL_SAMPLES_ARB, 2, FALSE }
-};
-
-struct pixelformat_score
-{
- int points;
- uint index;
-};
-
-static BOOL
-score_pixelformats(
- struct pixelformat_score *scores,
- uint count,
- int attribute,
- int expected_value )
-{
- uint i;
- struct attrib_match_info *ami = NULL;
- uint index;
-
- /* Find out if a given attribute should be considered for score calculation.
- */
- for (i = 0; i < sizeof( attrib_match ) / sizeof( attrib_match[0] ); i++) {
- if (attrib_match[i].attribute == attribute) {
- ami = &attrib_match[i];
- break;
- }
- }
- if (ami == NULL)
- return TRUE;
-
- /* Iterate all pixelformats, query the requested attribute and calculate
- * score points.
- */
- for (index = 0; index < count; index++) {
- int actual_value;
-
- if (!query_attrib( index + 1, 0, attribute, &actual_value ))
- return FALSE;
-
- if (ami->exact) {
- /* For an exact match criteria, if the actual and expected values differ,
- * the score is set to 0 points, effectively removing the pixelformat
- * from a list of matching pixelformats.
- */
- if (actual_value != expected_value)
- scores[index].points = 0;
- }
- else {
- /* For a minimum match criteria, if the actual value is smaller than the expected
- * value, the pixelformat is rejected (score set to 0). However, if the actual
- * value is bigger, the pixelformat is given a penalty to favour pixelformats that
- * more closely match the expected values.
- */
- if (actual_value < expected_value)
- scores[index].points = 0;
- else if (actual_value > expected_value)
- scores[index].points -= (actual_value - expected_value) * ami->weight;
- }
- }
-
- return TRUE;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglChoosePixelFormatARB(
- HDC hdc,
- const int *piAttribIList,
- const FLOAT *pfAttribFList,
- UINT nMaxFormats,
- int *piFormats,
- UINT *nNumFormats )
-{
- uint count;
- struct pixelformat_score *scores;
- uint i;
-
- *nNumFormats = 0;
-
- /* Allocate and initialize pixelformat score table -- better matches
- * have higher scores. Start with a high score and take out penalty
- * points for a mismatch when the match does not have to be exact.
- * Set a score to 0 if there is a mismatch for an exact match criteria.
- */
- count = pixelformat_get_extended_count();
- scores = (struct pixelformat_score *) MALLOC( count * sizeof( struct pixelformat_score ) );
- if (scores == NULL)
- return FALSE;
- for (i = 0; i < count; i++) {
- scores[i].points = 0x7fffffff;
- scores[i].index = i;
- }
-
- /* Given the attribute list calculate a score for each pixelformat.
- */
- if (piAttribIList != NULL) {
- while (*piAttribIList != 0) {
- if (!score_pixelformats( scores, count, piAttribIList[0], piAttribIList[1] )) {
- FREE( scores );
- return FALSE;
- }
- piAttribIList += 2;
- }
- }
- if (pfAttribFList != NULL) {
- while (*pfAttribFList != 0) {
- if (!score_pixelformats( scores, count, (int) pfAttribFList[0], (int) pfAttribFList[1] )) {
- FREE( scores );
- return FALSE;
- }
- pfAttribFList += 2;
- }
- }
-
- /* Bubble-sort the resulting scores. Pixelformats with higher scores go first.
- * TODO: Find out if there are any patent issues with it.
- */
- if (count > 1) {
- uint n = count;
- boolean swapped;
-
- do {
- swapped = FALSE;
- for (i = 1; i < n; i++) {
- if (scores[i - 1].points < scores[i].points) {
- struct pixelformat_score score = scores[i - 1];
-
- scores[i - 1] = scores[i];
- scores[i] = score;
- swapped = TRUE;
- }
- }
- n--;
- }
- while (swapped);
- }
-
- /* Return a list of pixelformats that are the best match.
- * Reject pixelformats with non-positive scores.
- */
- for (i = 0; i < count; i++) {
- if (scores[i].points > 0) {
- if (*nNumFormats < nMaxFormats)
- piFormats[*nNumFormats] = scores[i].index + 1;
- (*nNumFormats)++;
- }
- }
-
- FREE( scores );
- return TRUE;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglGetPixelFormatAttribfvARB(
- HDC hdc,
- int iPixelFormat,
- int iLayerPlane,
- UINT nAttributes,
- const int *piAttributes,
- FLOAT *pfValues )
-{
- UINT i;
-
- (void) hdc;
-
- for (i = 0; i < nAttributes; i++) {
- int value;
-
- if (!query_attrib( iPixelFormat, iLayerPlane, piAttributes[i], &value ))
- return FALSE;
- pfValues[i] = (FLOAT) value;
- }
-
- return TRUE;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglGetPixelFormatAttribivARB(
- HDC hdc,
- int iPixelFormat,
- int iLayerPlane,
- UINT nAttributes,
- const int *piAttributes,
- int *piValues )
-{
- UINT i;
-
- (void) hdc;
-
- for (i = 0; i < nAttributes; i++) {
- if (!query_attrib( iPixelFormat, iLayerPlane, piAttributes[i], &piValues[i] ))
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.h b/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.h
deleted file mode 100644
index 5e480b822b3..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef WGL_ARBPIXELFORMAT_H
-#define WGL_ARBPIXELFORMAT_H
-
-WINGDIAPI BOOL APIENTRY
-wglChoosePixelFormatARB(
- HDC hdc,
- const int *piAttribIList,
- const FLOAT *pfAttribFList,
- UINT nMaxFormats,
- int *piFormats,
- UINT *nNumFormats );
-
-WINGDIAPI BOOL APIENTRY
-wglGetPixelFormatAttribfvARB(
- HDC hdc,
- int iPixelFormat,
- int iLayerPlane,
- UINT nAttributes,
- const int *piAttributes,
- FLOAT *pfValues );
-
-WINGDIAPI BOOL APIENTRY
-wglGetPixelFormatAttribivARB(
- HDC hdc,
- int iPixelFormat,
- int iLayerPlane,
- UINT nAttributes,
- const int *piAttributes,
- int *piValues );
-
-#endif /* WGL_ARBPIXELFORMAT_H */
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_context.c b/src/mesa/state_tracker/wgl/stw_wgl_context.c
deleted file mode 100644
index 0c13c6b68ab..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_context.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-
-#include "main/mtypes.h"
-#include "main/context.h"
-#include "pipe/p_compiler.h"
-#include "pipe/p_context.h"
-#include "state_tracker/st_context.h"
-#include "state_tracker/st_public.h"
-#include "stw_device.h"
-#include "stw_winsys.h"
-#include "stw_framebuffer.h"
-#include "stw_pixelformat.h"
-#include "stw_wgl_arbmultisample.h"
-#include "stw_wgl_context.h"
-#include "stw_wgl.h"
-
-static struct wgl_context *ctx_head = NULL;
-
-static HDC current_hdc = NULL;
-static HGLRC current_hrc = NULL;
-
-WINGDIAPI BOOL APIENTRY
-wglCopyContext(
- HGLRC hglrcSrc,
- HGLRC hglrcDst,
- UINT mask )
-{
- (void) hglrcSrc;
- (void) hglrcDst;
- (void) mask;
-
- return FALSE;
-}
-
-WINGDIAPI HGLRC APIENTRY
-wglCreateContext(
- HDC hdc )
-{
- uint pfi;
- const struct pixelformat_info *pf;
- struct wgl_context *ctx;
- GLvisual *visual;
- struct pipe_context *pipe;
-
- pfi = wglGetPixelFormat( hdc );
- if (pfi == 0)
- return NULL;
-
- pf = pixelformat_get_info( pfi - 1 );
-
- ctx = CALLOC_STRUCT( wgl_context );
- if (ctx == NULL)
- return NULL;
-
- ctx->hdc = hdc;
- ctx->color_bits = GetDeviceCaps( ctx->hdc, BITSPIXEL );
-
- /* Create visual based on flags
- */
- visual = _mesa_create_visual(
- GL_TRUE,
- (pf->flags & PF_FLAG_DOUBLEBUFFER) ? GL_TRUE : GL_FALSE,
- GL_FALSE,
- pf->color.redbits,
- pf->color.greenbits,
- pf->color.bluebits,
- pf->alpha.alphabits,
- 0,
- pf->depth.depthbits,
- pf->depth.stencilbits,
- 0,
- 0,
- 0,
- 0,
- (pf->flags & PF_FLAG_MULTISAMPLED) ? wgl_query_samples() : 0 );
- if (visual == NULL) {
- FREE( ctx );
- return NULL;
- }
-
- pipe = stw_dev->stw_winsys->create_context( stw_dev->screen );
- if (!pipe) {
- _mesa_destroy_visual( visual );
- FREE( ctx );
- return NULL;
- }
-
- ctx->st = st_create_context( pipe, visual, NULL );
- if (ctx->st == NULL) {
- pipe->destroy( pipe );
- _mesa_destroy_visual( visual );
- FREE( ctx );
- return NULL;
- }
- ctx->st->ctx->DriverCtx = ctx;
-
- ctx->next = ctx_head;
- ctx_head = ctx;
-
- return (HGLRC) ctx;
-}
-
-WINGDIAPI HGLRC APIENTRY
-wglCreateLayerContext(
- HDC hdc,
- int iLayerPlane )
-{
- (void) hdc;
- (void) iLayerPlane;
-
- return NULL;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglDeleteContext(
- HGLRC hglrc )
-{
- struct wgl_context **link = &ctx_head;
- struct wgl_context *ctx = ctx_head;
-
- while (ctx != NULL) {
- if (ctx == (struct wgl_context *) hglrc) {
- GLcontext *glctx = ctx->st->ctx;
- GET_CURRENT_CONTEXT( glcurctx );
- struct stw_framebuffer *fb;
-
- /* Unbind current if deleting current context.
- */
- if (glcurctx == glctx)
- st_make_current( NULL, NULL, NULL );
-
- fb = framebuffer_from_hdc( ctx->hdc );
- if (fb)
- framebuffer_destroy( fb );
-
- if (WindowFromDC( ctx->hdc ) != NULL)
- ReleaseDC( WindowFromDC( ctx->hdc ), ctx->hdc );
-
- st_destroy_context( ctx->st );
-
- *link = ctx->next;
- FREE( ctx );
- return TRUE;
- }
-
- link = &ctx->next;
- ctx = ctx->next;
- }
-
- return FALSE;
-}
-
-/* Find the width and height of the window named by hdc.
- */
-static void
-get_window_size( HDC hdc, GLuint *width, GLuint *height )
-{
- if (WindowFromDC( hdc )) {
- RECT rect;
-
- GetClientRect( WindowFromDC( hdc ), &rect );
- *width = rect.right - rect.left;
- *height = rect.bottom - rect.top;
- }
- else {
- *width = GetDeviceCaps( hdc, HORZRES );
- *height = GetDeviceCaps( hdc, VERTRES );
- }
-}
-
-WINGDIAPI HGLRC APIENTRY
-wglGetCurrentContext( VOID )
-{
- return current_hrc;
-}
-
-WINGDIAPI HDC APIENTRY
-wglGetCurrentDC( VOID )
-{
- return current_hdc;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglMakeCurrent(
- HDC hdc,
- HGLRC hglrc )
-{
- struct wgl_context *ctx = ctx_head;
- GET_CURRENT_CONTEXT( glcurctx );
- struct stw_framebuffer *fb;
- GLuint width = 0;
- GLuint height = 0;
-
- current_hdc = hdc;
- current_hrc = hglrc;
-
- if (hdc == NULL || hglrc == NULL) {
- st_make_current( NULL, NULL, NULL );
- return TRUE;
- }
-
- while (ctx != NULL) {
- if (ctx == (struct wgl_context *) hglrc)
- break;
- ctx = ctx->next;
- }
- if (ctx == NULL)
- return FALSE;
-
- /* Return if already current.
- */
- if (glcurctx != NULL) {
- struct wgl_context *curctx = (struct wgl_context *) glcurctx->DriverCtx;
-
- if (curctx != NULL && curctx == ctx && ctx->hdc == hdc)
- return TRUE;
- }
-
- fb = framebuffer_from_hdc( hdc );
-
- if (hdc != NULL)
- get_window_size( hdc, &width, &height );
-
- /* Lazy creation of framebuffers.
- */
- if (fb == NULL && ctx != NULL && hdc != NULL) {
- GLvisual *visual = &ctx->st->ctx->Visual;
-
- fb = framebuffer_create( hdc, visual, width, height );
- if (fb == NULL)
- return FALSE;
-
- fb->dib_hDC = CreateCompatibleDC( hdc );
- fb->hbmDIB = NULL;
- fb->pbPixels = NULL;
- }
-
- if (ctx && fb) {
- st_make_current( ctx->st, fb->stfb, fb->stfb );
- framebuffer_resize( fb, width, height );
- }
- else {
- /* Detach */
- st_make_current( NULL, NULL, NULL );
- }
-
- return TRUE;
-}
-
-struct wgl_context *
-wgl_context_from_hdc(
- HDC hdc )
-{
- struct wgl_context *ctx = ctx_head;
-
- while (ctx != NULL) {
- if (ctx->hdc == hdc)
- return ctx;
- ctx = ctx->next;
- }
- return NULL;
-}
-
-#include "stw_wgl.c"
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_context.h b/src/mesa/state_tracker/wgl/stw_wgl_context.h
deleted file mode 100644
index d87b3bdce23..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_context.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef WGL_CONTEXT_H
-#define WGL_CONTEXT_H
-
-#include <windows.h>
-
-struct st_context;
-
-struct wgl_context
-{
- struct st_context *st;
- HDC hdc;
- DWORD color_bits;
- struct wgl_context *next;
-};
-
-struct wgl_context *
-wgl_context_from_hdc(HDC hdc );
-
-#endif /* WGL_CONTEXT_H */
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_getprocaddress.c b/src/mesa/state_tracker/wgl/stw_wgl_getprocaddress.c
deleted file mode 100644
index ec92d2dfce2..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_getprocaddress.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-
-#include "glapi/glapi.h"
-#include "stw_wgl_arbextensionsstring.h"
-#include "stw_wgl_arbpixelformat.h"
-
-struct extension_entry
-{
- const char *name;
- PROC proc;
-};
-
-#define EXTENTRY(P) { #P, (PROC) P }
-
-static struct extension_entry extension_entries[] = {
-
- /* WGL_ARB_extensions_string */
- EXTENTRY( wglGetExtensionsStringARB ),
-
- /* WGL_ARB_pixel_format */
- EXTENTRY( wglChoosePixelFormatARB ),
- EXTENTRY( wglGetPixelFormatAttribfvARB ),
- EXTENTRY( wglGetPixelFormatAttribivARB ),
-
- { NULL, NULL }
-};
-
-WINGDIAPI PROC APIENTRY
-wglGetProcAddress(
- LPCSTR lpszProc )
-{
- struct extension_entry *entry;
-
- PROC p = (PROC) _glapi_get_proc_address( (const char *) lpszProc );
- if (p)
- return p;
-
- for (entry = extension_entries; entry->name; entry++)
- if (strcmp( lpszProc, entry->name ) == 0)
- return entry->proc;
-
- return NULL;
-}
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c b/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c
deleted file mode 100644
index 7a8a2e22e49..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_debug.h"
-#include "stw_pixelformat.h"
-#include "stw_wgl.h"
-
-static uint currentpixelformat = 0;
-
-WINGDIAPI int APIENTRY
-wglChoosePixelFormat(
- HDC hdc,
- CONST PIXELFORMATDESCRIPTOR *ppfd )
-{
- uint count;
- uint index;
- uint bestindex;
- uint bestdelta;
-
- (void) hdc;
-
- count = pixelformat_get_count();
- bestindex = count;
- bestdelta = 0xffffffff;
-
- if (ppfd->nSize != sizeof( PIXELFORMATDESCRIPTOR ) || ppfd->nVersion != 1)
- return 0;
- if (ppfd->iPixelType != PFD_TYPE_RGBA)
- return 0;
- if (!(ppfd->dwFlags & PFD_DRAW_TO_WINDOW))
- return 0;
- if (!(ppfd->dwFlags & PFD_SUPPORT_OPENGL))
- return 0;
- if (ppfd->dwFlags & PFD_DRAW_TO_BITMAP)
- return 0;
- if (ppfd->dwFlags & PFD_SUPPORT_GDI)
- return 0;
- if (!(ppfd->dwFlags & PFD_STEREO_DONTCARE) && (ppfd->dwFlags & PFD_STEREO))
- return 0;
-
- for (index = 0; index < count; index++) {
- uint delta = 0;
- const struct pixelformat_info *pf = pixelformat_get_info( index );
-
- if (!(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE)) {
- if ((ppfd->dwFlags & PFD_DOUBLEBUFFER) && !(pf->flags & PF_FLAG_DOUBLEBUFFER))
- continue;
- if (!(ppfd->dwFlags & PFD_DOUBLEBUFFER) && (pf->flags & PF_FLAG_DOUBLEBUFFER))
- continue;
- }
-
- if (ppfd->cColorBits != pf->color.redbits + pf->color.greenbits + pf->color.bluebits)
- delta += 8;
-
- if (ppfd->cDepthBits != pf->depth.depthbits)
- delta += 4;
-
- if (ppfd->cStencilBits != pf->depth.stencilbits)
- delta += 2;
-
- if (ppfd->cAlphaBits != pf->alpha.alphabits)
- delta++;
-
- if (delta < bestdelta) {
- bestindex = index;
- bestdelta = delta;
- if (bestdelta == 0)
- break;
- }
- }
-
- if (bestindex == count)
- return 0;
- return bestindex + 1;
-}
-
-WINGDIAPI int APIENTRY
-wglDescribePixelFormat(
- HDC hdc,
- int iPixelFormat,
- UINT nBytes,
- LPPIXELFORMATDESCRIPTOR ppfd )
-{
- uint count;
- uint index;
- const struct pixelformat_info *pf;
-
- (void) hdc;
-
- count = pixelformat_get_extended_count();
- index = (uint) iPixelFormat - 1;
-
- if (ppfd == NULL)
- return count;
- if (index >= count || nBytes != sizeof( PIXELFORMATDESCRIPTOR ))
- return 0;
-
- pf = pixelformat_get_info( index );
-
- ppfd->nSize = sizeof( PIXELFORMATDESCRIPTOR );
- ppfd->nVersion = 1;
- ppfd->dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
- if (pf->flags & PF_FLAG_DOUBLEBUFFER)
- ppfd->dwFlags |= PFD_DOUBLEBUFFER | PFD_SWAP_COPY;
- ppfd->iPixelType = PFD_TYPE_RGBA;
- ppfd->cColorBits = pf->color.redbits + pf->color.greenbits + pf->color.bluebits;
- ppfd->cRedBits = pf->color.redbits;
- ppfd->cRedShift = pf->color.redshift;
- ppfd->cGreenBits = pf->color.greenbits;
- ppfd->cGreenShift = pf->color.greenshift;
- ppfd->cBlueBits = pf->color.bluebits;
- ppfd->cBlueShift = pf->color.blueshift;
- ppfd->cAlphaBits = pf->alpha.alphabits;
- ppfd->cAlphaShift = pf->alpha.alphashift;
- ppfd->cAccumBits = 0;
- ppfd->cAccumRedBits = 0;
- ppfd->cAccumGreenBits = 0;
- ppfd->cAccumBlueBits = 0;
- ppfd->cAccumAlphaBits = 0;
- ppfd->cDepthBits = pf->depth.depthbits;
- ppfd->cStencilBits = pf->depth.stencilbits;
- ppfd->cAuxBuffers = 0;
- ppfd->iLayerType = 0;
- ppfd->bReserved = 0;
- ppfd->dwLayerMask = 0;
- ppfd->dwVisibleMask = 0;
- ppfd->dwDamageMask = 0;
-
- return count;
-}
-
-WINGDIAPI int APIENTRY
-wglGetPixelFormat(
- HDC hdc )
-{
- (void) hdc;
-
- return currentpixelformat;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglSetPixelFormat(
- HDC hdc,
- int iPixelFormat,
- const PIXELFORMATDESCRIPTOR *ppfd )
-{
- uint count;
- uint index;
-
- (void) hdc;
-
- count = pixelformat_get_extended_count();
- index = (uint) iPixelFormat - 1;
-
- if (index >= count || ppfd->nSize != sizeof( PIXELFORMATDESCRIPTOR ))
- return FALSE;
-
- currentpixelformat = index + 1;
- return TRUE;
-}
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c b/src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c
deleted file mode 100644
index bd86501ac04..00000000000
--- a/src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <windows.h>
-
-#include "pipe/p_winsys.h"
-#include "pipe/p_screen.h"
-#include "pipe/p_context.h"
-#include "state_tracker/st_context.h"
-#include "state_tracker/st_public.h"
-#include "stw_winsys.h"
-#include "stw_device.h"
-#include "stw_framebuffer.h"
-#include "stw_wgl.h"
-
-WINGDIAPI BOOL APIENTRY
-wglSwapBuffers(
- HDC hdc )
-{
- struct stw_framebuffer *fb;
- struct pipe_surface *surf;
-
- fb = framebuffer_from_hdc( hdc );
- if (fb == NULL)
- return FALSE;
-
- /* If we're swapping the buffer associated with the current context
- * we have to flush any pending rendering commands first.
- */
- st_notify_swapbuffers( fb->stfb );
-
- surf = st_get_framebuffer_surface( fb->stfb, ST_SURFACE_BACK_LEFT );
-
- stw_dev->stw_winsys->flush_frontbuffer(stw_dev->screen->winsys,
- surf,
- hdc );
-
- return TRUE;
-}
-
-WINGDIAPI BOOL APIENTRY
-wglSwapLayerBuffers(
- HDC hdc,
- UINT fuPlanes )
-{
- (void) hdc;
- (void) fuPlanes;
-
- return FALSE;
-}
diff --git a/src/mesa/state_tracker/wgl/stw_winsys.h b/src/mesa/state_tracker/wgl/stw_winsys.h
deleted file mode 100644
index 8557327ccdd..00000000000
--- a/src/mesa/state_tracker/wgl/stw_winsys.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef STW_WINSYS_H
-#define STW_WINSYS_H
-
-#include <windows.h> /* for HDC */
-
-#include "pipe/p_compiler.h"
-
-struct pipe_screen;
-struct pipe_context;
-struct pipe_winsys;
-struct pipe_surface;
-
-struct stw_winsys
-{
- struct pipe_screen *
- (*create_screen)( void );
-
- struct pipe_context *
- (*create_context)( struct pipe_screen *screen );
-
- void
- (*flush_frontbuffer)( struct pipe_winsys *winsys,
- struct pipe_surface *surf,
- HDC hDC );
-};
-
-boolean
-st_init(const struct stw_winsys *stw_winsys);
-
-void
-st_cleanup(void);
-
-#endif /* STW_WINSYS_H */