Am Mittwoch, 27. November 2002 08:56 schrieb Ian Romanick:
> Problem:
>
> If lighting and color sum are disabled, the secondary color is not used. 
> If secondary color is set (via one of the glSecondaryColor3*EXT functions),
> the radeon and r200 will segfault.
>
> Detailed description:
>
> This only happens if the vtxfmt paths are enabled.  That is, if either
> RADEON_TCL_FORCE_DISABLE or RADEON_NO_VTXFMT are set, the problem will not
> occur.  The problem is that when the vtxfmt path is used and the secondary
> color is not part of the vertex format, vb.specptr (vb.ubytespecptr in the
> R200 driver) is set to NULL.  When this happens and the application tries
> to set the secondary color, the NULL pointer will be dereferenced by one of
> the {radeon,r200}_SecondaryColor3*EXT functions in
> {radeon,r200}_vtxfmt_c.c.
>
> Additionally, the context state will not be set.  the glSecondaryColor3*EXT
> functions essentially become no-ops in this case.  This is /not/ the way
> that the glColor4* functions behave if alpha is not used.  The alpha value
> in the GLcontext structure will be set.
>
> Fix:
>
> A floatspecptr needs to be added to the {r200,radeon}_vb structure.  If the
> vertex format does not use the secondary color, floatspecptr will point to
> ctx->Current.Attrib[VERT_ATTRIB_COLOR1].  Functions need to be added to
> {r200,radeon}_vtxfmt_c.c to handle the floating point destination.  A new
> chooser macro (called CHOOSE_SECONDARY_COLOR to match CHOOSE_COLOR) needs
> to be added to select the correct destination function based on the vertex
> format.
>
> Notes:
>
> The changes to the r200 driver are virtually identical to the radeon
> driver. However, since I don't have access to R200/RV250 hardware, I have
> not tested these changes.  I have verified that the changes to the R100
> driver work and that the R200 driver changes compile.
>
> If this patch looks good to all, and it works on R200, I'll commit it ASAP.
>
> Also attached is a test program that could be bundled w/Mesa. :)

Works for me on R200, dual Athlon MP.
Only a little "white" window for some tenths of a second?

nuetzel/Dokumente> /opt/Mesa/demos/glinfo
libGL: XF86DRIGetClientDriverName: 4.0.1 r200 (screen 0)
libGL: OpenDriver: trying /usr/X11R6/lib/modules/dri/r200_dri.so
libGL: XF86DRIGetClientDriverName: 4.0.1 r200 (screen 0)
libGL: XF86DRIGetClientDriverName: 4.0.1 r200 (screen 0)
drmOpenByBusid: busid is PCI:1:5:0
drmOpenDevice: minor is 0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 4, (OK)
drmOpenByBusid: drmOpenMinor returns 4
drmOpenByBusid: drmGetBusid reports PCI:1:5:0
MMX cpu detected.
3DNow! cpu detected.
Testing OS support for SSE... yes.
Testing OS support for SSE unmasked exceptions... SIGFPE, yes.
Tests of OS support for SSE passed.
SSE cpu detected.
GL_VERSION: 1.2 Mesa 5.0
GL_EXTENSIONS: GL_ARB_imaging GL_ARB_multitexture GL_ARB_texture_border_clamp 
GL_ARB_textur
e_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine 
GL_ARB_texture_env_dot3 GL_ARB
_texture_mirrored_repeat GL_ARB_transpose_matrix GL_ARB_window_pos 
GL_ATI_texture_mirror_on
ce GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_logic_op 
GL_EXT_blend_minmax GL_
EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_convolution 
GL_EXT_compiled_vertex_array
GL_EXT_histogram GL_EXT_packed_pixels GL_EXT_polygon_offset 
GL_EXT_rescale_normal GL_EXT_se
condary_color GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_edge_clamp 
GL_EXT_texture
_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 
GL_EXT_texture_filter_anisotrop
ic GL_EXT_texture_object GL_EXT_texture_lod_bias GL_EXT_vertex_array 
GL_IBM_rasterpos_clip
GL_MESA_pack_invert GL_MESA_ycbcr_texture GL_MESA_window_pos 
GL_NV_texture_rectangle GL_NV_
texgen_reflection GL_SGI_color_matrix GL_SGI_color_table
GL_RENDERER: Mesa DRI R200 20021125 AGP 4x x86/MMX/3DNow!/SSE TCL
GL_VENDOR: Tungsten Graphics, Inc.
GLU_VERSION: 1.3
GLU_EXTENSIONS: GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess
GLUT_API_VERSION: 5
GLUT_XLIB_IMPLEMENTATION: 15

nuetzel/Dokumente> ./secondary_color
libGL: XF86DRIGetClientDriverName: 4.0.1 r200 (screen 0)
libGL: OpenDriver: trying /usr/X11R6/lib/modules/dri/r200_dri.so
libGL: XF86DRIGetClientDriverName: 4.0.1 r200 (screen 0)
libGL: XF86DRIGetClientDriverName: 4.0.1 r200 (screen 0)
drmOpenByBusid: busid is PCI:1:5:0
drmOpenDevice: minor is 0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 4, (OK)
drmOpenByBusid: drmOpenMinor returns 4
drmOpenByBusid: drmGetBusid reports PCI:1:5:0
MMX cpu detected.
3DNow! cpu detected.
Testing OS support for SSE... yes.
Testing OS support for SSE unmasked exceptions... SIGFPE, yes.
Tests of OS support for SSE passed.
SSE cpu detected.
Calling non-vector versions...
Calling vector versions...
Done.

Regards,
        Dieter


-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to