diff options
author | David Reveman <davidr@novell.com> | 2004-04-03 17:53:54 +0000 |
---|---|---|
committer | David Reveman <davidr@novell.com> | 2004-04-03 17:53:54 +0000 |
commit | 7da7e0d70a0cbc7e5d54eae6ea32cc17355334f5 (patch) | |
tree | e686456036a485d35a189df9e33a41efbb14c5a3 | |
parent | 2ab47ef84bc9b4f94852561d41a597804d711c1b (diff) |
Removed ATI_render_texture support
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | src/glitz.h | 1 | ||||
-rw-r--r-- | src/glitz_agl_surface.c | 4 | ||||
-rw-r--r-- | src/glitz_glx_context.c | 12 | ||||
-rw-r--r-- | src/glitz_glx_extension.c | 14 | ||||
-rw-r--r-- | src/glitz_glx_pbuffer.c | 11 | ||||
-rw-r--r-- | src/glitz_glx_surface.c | 68 | ||||
-rw-r--r-- | src/glitz_glxext.h | 56 | ||||
-rw-r--r-- | src/glitz_glxint.h | 11 | ||||
-rw-r--r-- | src/glitz_surface.c | 5 | ||||
-rw-r--r-- | src/glitzint.h | 6 |
11 files changed, 60 insertions, 141 deletions
@@ -1,3 +1,16 @@ +2004-04-03 <c99drn@cs.umu.se> + + * src/glitz_agl_surface.c (_glitz_agl_set_features): + * src/glitz_glx_surface.c (_glitz_glx_set_features): Fixed + detection of convolution filter support. + + * src/glitz_glx_pbuffer.c: + * src/glitz_glx_context.c: + * src/glitz_glx_surface.c: + * src/glitz_glxint.h: + * src/glitzint.h: + * src/glitz_glxext.h: Removed ATI_render_texture support. + 2004-04-01 <c99drn@cs.umu.se> * src/glitzint.h: Removed __internal_linkage from functions that diff --git a/src/glitz.h b/src/glitz.h index 0719ad5..cea4291 100644 --- a/src/glitz.h +++ b/src/glitz.h @@ -144,7 +144,6 @@ typedef enum { #define GLITZ_FEATURE_OFFSCREEN_MULTISAMPLE_MASK (1L << 6) #define GLITZ_FEATURE_ARB_VERTEX_PROGRAM_MASK (1L << 7) #define GLITZ_FEATURE_ARB_FRAGMENT_PROGRAM_MASK (1L << 8) -#define GLITZ_FEATURE_ATI_RENDER_TEXTURE_MASK (1L << 9) typedef enum { GLITZ_STANDARD_ARGB32, diff --git a/src/glitz_agl_surface.c b/src/glitz_agl_surface.c index f1faa02..cd0ac33 100644 --- a/src/glitz_agl_surface.c +++ b/src/glitz_agl_surface.c @@ -149,9 +149,9 @@ _glitz_agl_set_features (glitz_agl_surface_t *surface) GLITZ_GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB, &texture_indirections); - /* Convolution filter programs require support for at least six + /* Convolution filter programs require support for at least nine texture indirections. */ - if (texture_indirections >= 5) + if (texture_indirections >= 9) surface->base.feature_mask |= GLITZ_FEATURE_CONVOLUTION_FILTER_MASK; } diff --git a/src/glitz_glx_context.c b/src/glitz_glx_context.c index ed0b2af..53cb448 100644 --- a/src/glitz_glx_context.c +++ b/src/glitz_glx_context.c @@ -150,12 +150,12 @@ glitz_glx_context_get (glitz_glx_screen_info_t *screen_info, void glitz_glx_context_proc_address_lookup (glitz_glx_context_t *context) { - context->glx.bind_tex_image_ati = - (glitz_glx_bind_tex_image_ati_t) - glitz_glx_get_proc_address ("glXBindTexImageATI"); - context->glx.release_tex_image_ati = - (glitz_glx_release_tex_image_ati_t) - glitz_glx_get_proc_address ("glXReleaseTexImageATI"); + context->glx.bind_tex_image_arb = + (glitz_glx_bind_tex_image_arb_t) + glitz_glx_get_proc_address ("glXBindTexImageARB"); + context->glx.release_tex_image_arb = + (glitz_glx_release_tex_image_arb_t) + glitz_glx_get_proc_address ("glXReleaseTexImageARB"); context->gl.active_texture_arb = (glitz_gl_active_texture_arb_t) diff --git a/src/glitz_glx_extension.c b/src/glitz_glx_extension.c index d462eee..cdf15d3 100644 --- a/src/glitz_glx_extension.c +++ b/src/glitz_glx_extension.c @@ -34,7 +34,9 @@ extern glitz_glx_static_proc_address_list_t _glitz_glx_proc_address; static glitz_extension_map client_glx_extensions[] = { - { "GLX_ATI_render_texture", GLITZ_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK }, + /* NYI: Don't know of any driver that supports GLX_ARB_render_texture + { "GLX_ARB_render_texture", GLITZ_GLX_FEATURE_ARB_RENDER_TEXTURE_MASK }, + */ { "GLX_ARB_multisample", GLITZ_GLX_FEATURE_CLIENT_MULTISAMPLE_MASK }, { NULL, 0 } }, gl_extensions[] = { @@ -120,14 +122,8 @@ glitz_glx_query_extensions (glitz_glx_screen_info_t *screen_info) screen_info->feature_mask |= GLITZ_FEATURE_TEXTURE_MIRRORED_REPEAT_MASK; if (screen_info->glx_feature_mask & - GLITZ_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK) { - screen_info->glx_feature_mask |= GLITZ_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK; - screen_info->feature_mask |= GLITZ_FEATURE_ATI_RENDER_TEXTURE_MASK; - - /* ATI render texture doesn't seem to support texture rectangle */ - screen_info->texture_mask &= ~GLITZ_TEXTURE_TARGET_RECTANGLE_MASK; - screen_info->feature_mask &= ~GLITZ_FEATURE_TEXTURE_RECTANGLE_MASK; - } + GLITZ_GLX_FEATURE_ARB_RENDER_TEXTURE_MASK) + screen_info->glx_feature_mask |= GLITZ_GLX_FEATURE_ARB_RENDER_TEXTURE_MASK; if (screen_info->glx_feature_mask & GLITZ_GLX_FEATURE_ARB_VERTEX_PROGRAM_MASK) { diff --git a/src/glitz_glx_pbuffer.c b/src/glitz_glx_pbuffer.c index 451c665..7ca56b8 100644 --- a/src/glitz_glx_pbuffer.c +++ b/src/glitz_glx_pbuffer.c @@ -36,8 +36,7 @@ extern glitz_glx_static_proc_address_list_t _glitz_glx_proc_address; GLXPbuffer glitz_glx_pbuffer_create (Display *display, GLXFBConfig fbconfig, - glitz_texture_t *texture, - glitz_bool_t render_texture) + glitz_texture_t *texture) { int pbuffer_attr[13], i = 0; @@ -49,14 +48,6 @@ glitz_glx_pbuffer_create (Display *display, pbuffer_attr[i++] = 1; pbuffer_attr[i++] = GLX_LARGEST_PBUFFER; pbuffer_attr[i++] = 0; - - if (render_texture) { - pbuffer_attr[i++] = GLX_TEXTURE_FORMAT_ATI; - pbuffer_attr[i++] = GLX_TEXTURE_RGBA_ATI; - pbuffer_attr[i++] = GLX_TEXTURE_TARGET_ATI; - pbuffer_attr[i++] = GLX_TEXTURE_2D_ATI; - } - pbuffer_attr[i++] = 0; return diff --git a/src/glitz_glx_surface.c b/src/glitz_glx_surface.c index dee7885..a8e3d67 100644 --- a/src/glitz_glx_surface.c +++ b/src/glitz_glx_surface.c @@ -56,16 +56,8 @@ _glitz_glx_surface_push_current (void *abstract_surface, { glitz_glx_surface_t *surface = (glitz_glx_surface_t *) abstract_surface; - if (constraint == GLITZ_CN_SURFACE_DRAWABLE_CURRENT) { - if (surface->render_texture) { - surface->context->glx.release_tex_image_ati - (surface->screen_info->display_info->display, surface->pbuffer, - (surface->base.format->doublebuffer)? - GLX_BACK_LEFT_ATI: GLX_FRONT_LEFT_ATI); - } - if (!surface->drawable) - constraint = GLITZ_CN_ANY_CONTEXT_CURRENT; - } + if (constraint == GLITZ_CN_SURFACE_DRAWABLE_CURRENT && (!surface->drawable)) + constraint = GLITZ_CN_ANY_CONTEXT_CURRENT; surface = glitz_glx_context_push_current (surface, constraint); @@ -123,19 +115,9 @@ _glitz_glx_surface_ensure_texture (glitz_glx_surface_t *surface) { if (!(surface->base.hint_mask & GLITZ_INT_HINT_DIRTY_MASK)) return; - - if (surface->render_texture) { - glitz_texture_bind (surface->base.gl, surface->base.texture); - surface->context->glx.bind_tex_image_ati - (surface->screen_info->display_info->display, surface->pbuffer, - (surface->base.format->doublebuffer)? - GLX_BACK_LEFT_ATI: GLX_FRONT_LEFT_ATI); - - glitz_texture_unbind (surface->base.gl, surface->base.texture); - - } else - glitz_texture_copy_surface (surface->base.texture, &surface->base, - &surface->base.dirty_region); + + glitz_texture_copy_surface (surface->base.texture, &surface->base, + &surface->base.dirty_region); surface->base.hint_mask &= ~GLITZ_INT_HINT_DIRTY_MASK; } @@ -158,7 +140,6 @@ _glitz_glx_set_features (glitz_glx_surface_t *surface) { surface->base.feature_mask = surface->screen_info->feature_mask; - surface->base.feature_mask &= ~GLITZ_FEATURE_ATI_RENDER_TEXTURE_MASK; surface->base.feature_mask &= ~GLITZ_FEATURE_ARB_VERTEX_PROGRAM_MASK; surface->base.feature_mask &= ~GLITZ_FEATURE_ARB_FRAGMENT_PROGRAM_MASK; surface->base.feature_mask &= ~GLITZ_FEATURE_CONVOLUTION_FILTER_MASK; @@ -170,12 +151,12 @@ _glitz_glx_set_features (glitz_glx_surface_t *surface) GLITZ_CN_SURFACE_CONTEXT_CURRENT); glitz_surface_pop_current (&surface->base); } - - if ((surface->screen_info->feature_mask & - GLITZ_FEATURE_ATI_RENDER_TEXTURE_MASK) && - surface->context->glx.bind_tex_image_ati && - surface->context->glx.release_tex_image_ati) - surface->base.feature_mask |= GLITZ_FEATURE_ATI_RENDER_TEXTURE_MASK; + + if ((surface->screen_info->glx_feature_mask & + GLITZ_GLX_FEATURE_ARB_RENDER_TEXTURE_MASK) && + surface->context->glx.bind_tex_image_arb && + surface->context->glx.release_tex_image_arb) + surface->render_texture = 1; if (surface->context->gl.active_texture_arb && surface->context->gl.multi_tex_coord_2d_arb && @@ -203,10 +184,10 @@ _glitz_glx_set_features (glitz_glx_surface_t *surface) (GLITZ_GL_FRAGMENT_PROGRAM_ARB, GLITZ_GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB, &texture_indirections); - - /* Convolution filter programs require support for at least six + + /* Convolution filter programs require support for at least nine texture indirections. */ - if (texture_indirections >= 5) + if (texture_indirections >= 9) surface->base.feature_mask |= GLITZ_FEATURE_CONVOLUTION_FILTER_MASK; } } @@ -251,9 +232,6 @@ _glitz_glx_surface_create (glitz_glx_screen_info_t *screen_info, texture_format = glitz_get_gl_format_from_bpp (format->bpp); - if (screen_info->feature_mask & GLITZ_FEATURE_ATI_RENDER_TEXTURE_MASK) - surface->render_texture = 1; - glitz_surface_push_current (&surface->base, GLITZ_CN_ANY_CONTEXT_CURRENT); surface->base.texture = @@ -271,18 +249,11 @@ _glitz_glx_surface_create (glitz_glx_screen_info_t *screen_info, surface->drawable = surface->pbuffer = glitz_glx_pbuffer_create (screen_info->display_info->display, surface->context->fbconfig, - surface->base.texture, - surface->render_texture); + surface->base.texture); _glitz_glx_set_features (surface); - - if (surface->base.feature_mask & GLITZ_FEATURE_ATI_RENDER_TEXTURE_MASK) { - if (format->red_size || format->green_size || format->blue_size) - surface->base.hint_mask |= GLITZ_INT_HINT_REQUIRES_NO_FLIPPING_MASK; - } else - surface->render_texture = 0; - if ((!surface->render_texture) && (!surface->pbuffer)) + if (!surface->pbuffer) glitz_texture_allocate (surface->base.gl, surface->base.texture); glitz_surface_pop_current (&surface->base); @@ -384,13 +355,6 @@ _glitz_glx_surface_destroy (void *abstract_surface) glitz_surface_push_current (&surface->base, GLITZ_CN_ANY_CONTEXT_CURRENT); - if (surface->render_texture) { - surface->context->glx.release_tex_image_ati - (surface->screen_info->display_info->display, surface->pbuffer, - (surface->base.format->doublebuffer)? - GLX_BACK_LEFT_ATI: GLX_FRONT_LEFT_ATI); - } - if (surface->base.texture) glitz_texture_destroy (surface->base.gl, surface->base.texture); diff --git a/src/glitz_glxext.h b/src/glitz_glxext.h index a2e8eb4..91da349 100644 --- a/src/glitz_glxext.h +++ b/src/glitz_glxext.h @@ -95,62 +95,24 @@ typedef XID GLXPbuffer; #endif typedef GLXFBConfig *(* glitz_glx_get_fbconfigs_t) - (Display *, int, int *); + (Display *display, int screen, int *n_elements); typedef int (* glitz_glx_get_fbconfig_attrib_t) - (Display *, GLXFBConfig, int, int *); + (Display *display, GLXFBConfig config, int attribute, int *value); typedef XVisualInfo *(* glitz_glx_get_visual_from_fbconfig_t) - (Display *, GLXFBConfig); + (Display *display, GLXFBConfig config); typedef GLXPbuffer (* glitz_glx_create_pbuffer_t) - (Display *, GLXFBConfig, const int *); + (Display *display, GLXFBConfig config, const int *attrib_list); typedef void (* glitz_glx_destroy_pbuffer_t) - (Display *, GLXPbuffer); + (Display *display, GLXPbuffer pbuffer); #ifndef GLX_ARB_multisample #define GLX_SAMPLE_BUFFERS_ARB 0x186a0 #define GLX_SAMPLES_ARB 0x186a1 #endif -#ifndef GLX_ATI_render_texture -#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 -#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 -#define GLX_TEXTURE_FORMAT_ATI 0x9802 -#define GLX_TEXTURE_TARGET_ATI 0x9803 -#define GLX_MIPMAP_TEXTURE_ATI 0x9804 -#define GLX_TEXTURE_RGB_ATI 0x9805 -#define GLX_TEXTURE_RGBA_ATI 0x9806 -#define GLX_NO_TEXTURE_ATI 0x9807 -#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 -#define GLX_TEXTURE_1D_ATI 0x9809 -#define GLX_TEXTURE_2D_ATI 0x980A -#define GLX_MIPMAP_LEVEL_ATI 0x980B -#define GLX_CUBE_MAP_FACE_ATI 0x980C -#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D -#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E -#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F -#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 -#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 -#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 -#define GLX_FRONT_LEFT_ATI 0x9813 -#define GLX_FRONT_RIGHT_ATI 0x9814 -#define GLX_BACK_LEFT_ATI 0x9815 -#define GLX_BACK_RIGHT_ATI 0x9816 -#define GLX_AUX0_ATI 0x9817 -#define GLX_AUX1_ATI 0x9818 -#define GLX_AUX2_ATI 0x9819 -#define GLX_AUX3_ATI 0x981A -#define GLX_AUX4_ATI 0x981B -#define GLX_AUX5_ATI 0x981C -#define GLX_AUX6_ATI 0x981D -#define GLX_AUX7_ATI 0x981E -#define GLX_AUX8_ATI 0x981F -#define GLX_AUX9_ATI 0x9820 -#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 -#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 -#endif - -typedef void (* glitz_glx_bind_tex_image_ati_t) - (Display *, GLXPbuffer, int); -typedef void (* glitz_glx_release_tex_image_ati_t) - (Display *, GLXPbuffer, int); +typedef Bool *(* glitz_glx_bind_tex_image_arb_t) + (Display *display, GLXPbuffer pbuffer, int buffer); +typedef Bool (* glitz_glx_release_tex_image_arb_t) + (Display *display, GLXPbuffer pbuffer, int buffer); #endif /* GLITZ_GLXEXT_H_INCLUDED */ diff --git a/src/glitz_glxint.h b/src/glitz_glxint.h index 94986ea..d6a2d28 100644 --- a/src/glitz_glxint.h +++ b/src/glitz_glxint.h @@ -45,8 +45,8 @@ #define GLITZ_GLX_FEATURE_MULTISAMPLE_FILTER_MASK (1L << 5) #define GLITZ_GLX_FEATURE_ARB_VERTEX_PROGRAM_MASK (1L << 6) #define GLITZ_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK (1L << 7) -#define GLITZ_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK (1L << 8) -#define GLITZ_GLX_FEATURE_GLX13_MASK (1L << 9) +#define GLITZ_GLX_FEATURE_GLX13_MASK (1L << 8) +#define GLITZ_GLX_FEATURE_ARB_RENDER_TEXTURE_MASK (1L << 9) typedef struct _glitz_glx_surface glitz_glx_surface_t; typedef struct _glitz_glx_screen_info_t glitz_glx_screen_info_t; @@ -62,8 +62,8 @@ typedef struct _glitz_glx_static_proc_address_list_t { } glitz_glx_static_proc_address_list_t; typedef struct _glitz_glx_proc_address_list_t { - glitz_glx_bind_tex_image_ati_t bind_tex_image_ati; - glitz_glx_release_tex_image_ati_t release_tex_image_ati; + glitz_glx_bind_tex_image_arb_t bind_tex_image_arb; + glitz_glx_release_tex_image_arb_t release_tex_image_arb; glitz_bool_t supported; } glitz_glx_proc_address_list_t; @@ -168,8 +168,7 @@ glitz_glx_query_formats (glitz_glx_screen_info_t *screen_info); extern GLXPbuffer __internal_linkage glitz_glx_pbuffer_create (Display *display, GLXFBConfig fbconfig, - glitz_texture_t *texture, - glitz_bool_t render_texture); + glitz_texture_t *texture); extern void __internal_linkage glitz_glx_pbuffer_destroy (Display *display, diff --git a/src/glitz_surface.c b/src/glitz_surface.c index f008a92..39eb298 100644 --- a/src/glitz_surface.c +++ b/src/glitz_surface.c @@ -621,9 +621,8 @@ glitz_surface_draw_pixels (glitz_surface_t *surface, surface->gl->disable (GLITZ_GL_SCISSOR_TEST); surface->gl->disable (GLITZ_GL_DITHER); glitz_set_operator (surface->gl, GLITZ_OPERATOR_SRC); - - if (!SURFACE_REQUIRES_NO_FLIPPING(surface)) - surface->gl->pixel_zoom (1.0, -1.0); + + surface->gl->pixel_zoom (1.0, -1.0); _glitz_set_raster_pos (surface->gl, x, surface->height - y); surface->gl->draw_pixels (width, height, format, type, pixels); diff --git a/src/glitzint.h b/src/glitzint.h index 4f22eaf..ef77243 100644 --- a/src/glitzint.h +++ b/src/glitzint.h @@ -269,8 +269,7 @@ typedef struct glitz_surface_backend { #define GLITZ_INT_HINT_REPEAT_MASK (1L << 4) #define GLITZ_INT_HINT_IMPLICIT_MASK_MASK (1L << 5) #define GLITZ_INT_HINT_DIRTY_MASK (1L << 6) -#define GLITZ_INT_HINT_REQUIRES_NO_FLIPPING_MASK (1L << 7) -#define GLITZ_INT_HINT_CLEAR_EXTERIOR_MASK (1L << 8) +#define GLITZ_INT_HINT_CLEAR_EXTERIOR_MASK (1L << 7) #define SURFACE_PROGRAMMATIC(surface) \ (surface->hint_mask & GLITZ_HINT_PROGRAMMATIC_MASK) @@ -284,9 +283,6 @@ typedef struct glitz_surface_backend { #define SURFACE_DIRTY(surface) \ (surface->hint_mask & GLITZ_INT_HINT_DIRTY_MASK) -#define SURFACE_REQUIRES_NO_FLIPPING(surface) \ - (surface->hint_mask & GLITZ_INT_HINT_REQUIRES_NO_FLIPPING_MASK) - #define SURFACE_CLEAR_EXTERIOR(surface) \ (surface->hint_mask & GLITZ_INT_HINT_CLEAR_EXTERIOR_MASK) |