Bug 28966 - [r300g] Dynamic branching 3 demo does not run
Summary: [r300g] Dynamic branching 3 demo does not run
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/r300 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL: http://www.humus.name/index.php?page=...
Depends on:
Reported: 2010-07-08 15:06 UTC by Sven Arvidsson
Modified: 2010-09-03 13:52 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description Sven Arvidsson 2010-07-08 15:06:54 UTC
I'm filing this just in case it's of interest for those hacking shaders on r300. Humus DynamicBranching3 demo does not run:

 Note: 'for (i ... )' body is too large/complex to unroll
 Fragment program using varying vars not written by vertex shader

For reference, this demo does work with the i965 driver.


System environment:
-- system architecture: 32-bit
-- Linux distribution: Debian unstable
-- GPU: RV570
-- Model: Asus EAX1950Pro 256MB
-- Display connector: DVI
-- xf86-video-ati: 801e83227a59a29eea425ea612083bbf2b536c30
-- xserver:
-- mesa: 61a26cdfdc9c75a83c0d362c973d5436fe077be4
-- drm: 6ea2bda5f5ec8f27359760ce580fdad3df0464df
-- kernel: 2.6.35-rc3
Comment 1 Marek Olšák 2010-08-17 19:34:13 UTC
Could you test the demo with current mesa git?
Comment 2 Sven Arvidsson 2010-08-18 11:56:54 UTC
It seems to have regressed after the glsl2 merge it fails with "0:4(2): preprocessor error: Invalid tokens after #" for both shaders.

/* Shader 2 source, checksum 0 */
#version 120
#define saturate(x) clamp(x,0.0,1.0)
#define lerp mix
#line 2
attribute vec2 textureCoord;
attribute vec3 tangent;
attribute vec3 binormal;
attribute vec3 normal;

uniform vec3 camPos;

varying vec2 texCoord;
varying vec3 vVec;

void main(){
        gl_Position = ftransform();

        texCoord = textureCoord;

        vec3 viewVec = camPos - gl_Vertex.xyz;
        vVec.x = dot(viewVec, tangent);
        vVec.y = dot(viewVec, binormal);
        vVec.z = dot(viewVec, normal);

/* Compile status: fail */
/* Log Info: */
0:4(2): preprocessor error: Invalid tokens after #
Comment 3 Marek Olšák 2010-08-18 12:37:15 UTC
Could you please file a new bug against the GLSL2 compiler (Mesa core, I guess) to keep driver-specific and core bugs separate?
Comment 4 Marek Olšák 2010-08-18 12:39:08 UTC
Other than that, dynamic branching and loops should work with r300g to my knowledge, I recall Tom adding the support for it just recently.
Comment 5 Sven Arvidsson 2010-08-18 13:14:40 UTC
Filed as bug 29654
Comment 6 Sven Arvidsson 2010-08-22 14:24:17 UTC
Small update: the demo runs now, but isn't rendering correctly. It is however looking the same as softpipe, so any bugs is probably on a more general level.
Comment 7 Sven Arvidsson 2010-08-26 06:43:14 UTC
Since error messages was added to r300g it now reports:

r300 FP: Compiler Error:
Fragment program does not support relative addressing  of source operands.
Using a dummy shader instead.
r300 VP: Compiler error:
Vertex program does not support relative addressing of destination operands (yet).
Using a dummy shader instead.
Comment 8 Sven Arvidsson 2010-09-03 13:50:30 UTC
Seems to be running fine now with loop unrolling.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.