Bug 26411

Summary: Mesa classic-only: Missing textures in Funguloids
Product: Mesa Reporter: Sam Morris <sam>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: menu screenshot
Failing Cg shader

Description Sam Morris 2010-02-03 05:11:30 UTC
Created attachment 33026 [details]
menu screenshot

When running funguloids 1.06, the menu textures are not drawn.

This is with linux 2.6.32, mesa 7.7, drm 2.4.15, intel 2.9.1 and xorg 1.7.4.
Comment 1 Sven Arvidsson 2010-02-20 12:22:20 UTC
Also happens if software mode is forced, so it's not specific to i965. 

This game requires the NVIDIA Cg Toolkit to be installed, could this have something to do with the bug?
Comment 2 Sam Morris 2010-02-20 13:59:54 UTC
Perhaps; I have Cg installed, but can't say whether it causes the problem or not.
Comment 3 Sven Arvidsson 2010-04-16 12:18:52 UTC
Okay, it's definately Cg. The game can be run without it (by editing /etc/OGRE/plugins.cfg). I guess there's still a bug somewhere though, as I have run other games using Cg shaders with no problem with the same setup.

(You'll probably want to work around this bug too: http://bugs.debian.org/564547 )

I'll see if I can figure out which one of the shaders is the cause of this.
Comment 4 Sven Arvidsson 2010-04-16 15:08:18 UTC
Created attachment 35117 [details]
Failing Cg shader

The Cg shader that's causing this is "Example_Basic.cg" (attached) which is loaded by OGRE like this:

// A really basic ambient pass program, support for one texture coodinate set
vertex_program Ogre/BasicVertexPrograms/AmbientOneTexture cg
{
	source Example_Basic.cg
	entry_point ambientOneTexture_vp
	profiles vs_1_1 arbvp1

	default_params
	{
		param_named_auto worldViewProj worldviewproj_matrix
		param_named_auto ambient ambient_light_colour
	}
}
(For an explanation see http://www.ogre3d.org/docs/manual/manual_19.html#SEC115 )


Compiling it with cgc results in this:

cgc Example_Basic.cg -entry ambientOneTexture_vp -profile arbvp1
Example_Basic.cg
18 lines, 0 errors.
!!ARBvp1.0
# cgc version 2.2.0017, build date Jan 29 2010
# command line args: -profile arbvp1
# source file: Example_Basic.cg
#vendor NVIDIA Corporation
#version 2.2.0.17
#profile arbvp1
#program ambientOneTexture_vp
#semantic ambientOneTexture_vp.worldViewProj
#semantic ambientOneTexture_vp.ambient
#var float4 position : $vin.POSITION : POSITION : 0 : 1
#var float2 uv : $vin.TEXCOORD0 : TEXCOORD0 : 1 : 1
#var float4 oPosition : $vout.POSITION : HPOS : 2 : 1
#var float2 oUv : $vout.TEXCOORD0 : TEX0 : 3 : 1
#var float4 colour : $vout.COLOR : COL0 : 4 : 1
#var float4x4 worldViewProj :  : c[1], 4 : 5 : 1
#var float4 ambient :  : c[5] : 6 : 1
PARAM c[6] = { program.local[0..5] };
MOV result.color, c[5];
MOV result.texcoord[0].xy, vertex.texcoord[0];
DP4 result.position.w, vertex.position, c[4];
DP4 result.position.z, vertex.position, c[3];
DP4 result.position.y, vertex.position, c[2];
DP4 result.position.x, vertex.position, c[1];
END
# 6 instructions, 0 R-regs

...and I guess this is where the bug might be. But if it's in Nvidias Cg compiler or somewhere in Mesa I have no idea.
Comment 5 Eric Anholt 2011-01-08 22:38:22 UTC
The missing menu textures also occur with software Mesa.  I don't see any GL errors being thrown (other than during FBO format probing and context teardown), nor do I see the fragment programs or GLSL shaders being rejected.
Comment 6 Marek Olšák 2011-03-02 04:38:07 UTC
Gallium works, classic is broken (including swrast).
Comment 7 Tapani Pälli 2015-05-19 11:05:53 UTC
This game works with Mesa from git (and likely with any recent versions). I tested this with Mesa 10.4.7 using LIBGL_ALWAYS_SOFTWARE=1 and latest Mesa from git + i965 driver.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.