kmonsoor / pyglet

Automatically exported from code.google.com/p/pyglet
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Enhancement: Utilize ARB_texture_non_power_of_two when present #454

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
ARB_npot gives full texture status to NPOT textures, including mipmapping,
1D/3D/cubemaps, and (the part I care about at the moment) wrapping,
clamping, and filtering. This is way more awesome than rectangles, which
largely exist for video acceleration.

The attached patch attempts to look for NPOT support before falling back to
either rectangle extension.

Tested on my i915 and r200; probably works on just about anything. (I
wouldn't be surprised if fglrx throws a fit on r100, but seriously.)

What steps will reproduce the problem?
1. Attempt to use GL_REPEAT on an NPOT sprite.
2. Get annoyed, frustrated, dismayed.
3. Realize ARB_npot isn't used, roll eyes, write patch.

Paste in the traceback or error message:

Um.

pyglet 1.1 with Python 2.5: Paste in the output of `python -m pyglet.info`
Other: Paste in the output of tools/gl_info.py (included in source distro):

From my i915:
Platform instance is <pyglet.window.xlib.XlibPlatform object at 0x826f72c>
Display instance is <pyglet.window.xlib.XlibDisplayDevice object at 0x826f7cc>
Screens:
  XlibScreen(screen=0, x=0, y=0, width=1024, height=600, xinerama=1)
Creating default context...
GL attributes:
double_buffer=1 stereo=0 buffer_size=24 aux_buffers=0 sample_buffers=0
samples=0 red_size=8 green_size=8 blue_size=8 alpha_size=0
depth_size=24 stencil_size=0 accum_red_size=0 accum_green_size=0
accum_blue_size=0 accum_alpha_size=0
GL version: 1.4 Mesa 7.6-devel
GL vendor: Tungsten Graphics, Inc
GL renderer: Mesa DRI Intel(R) 945GME GEM 20090114 x86/MMX/SSE2
GL extensions:
  GL_ARB_texture_compression GL_NV_point_sprite GL_EXT_polygon_offset
  GL_EXT_blend_color GL_EXT_blend_subtract GL_EXT_stencil_wrap
  GL_EXT_vertex_array GL_IBM_texture_mirrored_repeat
  GL_ATI_blend_equation_separate GL_ARB_depth_texture
  GL_NV_texture_rectangle GL_EXT_texture_object
  GL_EXT_blend_func_separate GL_EXT_texture GL_ARB_transpose_matrix
  GL_ARB_texture_border_clamp GL_EXT_fog_coord GL_ARB_texture_cube_map
  GL_EXT_blend_equation_separate GL_ARB_point_parameters
  GL_EXT_texture_env_dot3 GL_ATI_texture_env_combine3
  GL_EXT_multi_draw_arrays GL_EXT_texture_env_combine
  GL_ARB_vertex_program GL_ARB_texture_env_dot3 GL_EXT_bgra
  GL_NV_texture_env_combine4 GL_ARB_texture_env_combine
  GL_ARB_vertex_buffer_object GL_EXT_shadow_funcs
  GL_EXT_separate_specular_color GL_EXT_texture_env_add
  GL_EXT_packed_depth_stencil GL_SGIS_texture_border_clamp
  GL_MESA_ycbcr_texture GL_EXT_framebuffer_object GL_ARB_draw_buffers
  GL_EXT_cull_vertex GL_IBM_rasterpos_clip GL_MESA_window_pos
  GL_NV_texgen_reflection GL_IBM_multimode_draw_arrays
  GL_EXT_compiled_vertex_array GL_EXT_point_parameters
  GL_APPLE_vertex_array_object GL_3DFX_texture_compression_FXT1
  GL_OES_read_format GL_APPLE_client_storage GL_INGR_blend_func_separate
  GL_NV_blend_square GL_EXT_secondary_color
  GL_ARB_texture_non_power_of_two GL_EXT_texture_lod_bias
  GL_EXT_pixel_buffer_object GL_EXT_abgr GL_NV_vertex_program
  GL_ARB_texture_rectangle GL_ARB_multisample GL_SGIS_generate_mipmap
  GL_EXT_texture_filter_anisotropic GL_NV_light_max_exponent
  GL_EXT_blend_minmax GL_EXT_framebuffer_blit GL_ARB_fragment_program
  GL_ARB_texture_env_crossbar GL_SGIS_texture_lod GL_MESA_pack_invert
  GL_EXT_texture_rectangle GL_EXT_blend_logic_op GL_EXT_subtexture
  GL_EXT_texture_edge_clamp GL_ARB_window_pos GL_APPLE_packed_pixels
  GL_ARB_shadow GL_ARB_texture_mirrored_repeat GL_SUN_multi_draw_arrays
  GL_EXT_copy_texture GL_NV_vertex_program1_1 GL_EXT_texture3D
  GL_ARB_multitexture GL_SGIS_texture_edge_clamp
  GL_EXT_draw_range_elements GL_ARB_texture_env_add GL_EXT_packed_pixels
  GL_EXT_rescale_normal GL_ARB_pixel_buffer_object
GLU version: 1.3
GLU extensions:
  GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess

Context is XlibGLContext()
GLX is direct
GLX server vendor: SGI
GLX server version: 1.2
GLX server extensions:
  GLX_ARB_multisample GLX_EXT_import_context GLX_EXT_texture_from_pixmap
  GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_copy_sub_buffer
  GLX_OML_swap_method GLX_SGI_swap_control GLX_SGIS_multisample
  GLX_SGIX_fbconfig GLX_SGIX_visual_select_group
GLX client vendor: SGI
GLX client version: 1.4
GLX client extensions:
  GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context
  GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_allocate_memory
  GLX_MESA_copy_sub_buffer GLX_MESA_swap_control
  GLX_MESA_swap_frame_usage GLX_OML_swap_method GLX_OML_sync_control
  GLX_SGI_make_current_read GLX_SGI_swap_control GLX_SGI_video_sync
  GLX_SGIS_multisample GLX_SGIX_fbconfig GLX_SGIX_pbuffer
  GLX_SGIX_visual_select_group GLX_EXT_texture_from_pixmap
GLX extensions:
  GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context
  GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_copy_sub_buffer
  GLX_MESA_swap_frame_usage GLX_OML_swap_method GLX_SGI_video_sync
  GLX_SGIS_multisample GLX_SGIX_fbconfig GLX_SGIX_visual_select_group
  GLX_EXT_texture_from_pixmap

Any additional info (platform/language/hardware) that may be relevant?

Not using fglrx or nvidia. nvidia should be well-behaved for this; fglrx
has a few ancient related bugs that should be fixed. (This is required for
compiz, and there's no compiz bugs on fglrx related to texturing, so. Yeah.)

~ Corbin Simpson

Original issue reported on code.google.com by MostAwes...@gmail.com on 22 Sep 2009 at 12:22

Attachments:

GoogleCodeExporter commented 9 years ago
Bump. After further discussion with other Mesa devs, and a bit more research, 
I've
found that this patch should have no effect on fglrx for pre-HD chipsets, 
should work
fine on HD chipsets (HD 2400 and newer), and should work properly on 
nvidia/nouveau.

Would greatly appreciate some feedback.

Original comment by MostAwes...@gmail.com on 7 Jan 2010 at 5:37

GoogleCodeExporter commented 9 years ago
I'd really like this patch applied -- I need NPOT textures with 
wrapping/clamping for my application, too.

Original comment by norna...@gmail.com on 2 Mar 2010 at 1:04

GoogleCodeExporter commented 9 years ago

Original comment by useboxnet on 17 Jul 2013 at 5:07