From 7eb31a920506f7c25ed3ce79ac44dcf06d3fca82 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 30 Mar 2023 20:48:20 +0200 Subject: Graph GLSL: Enable 'discard' in fragment shader w/o GLRendererQuirks.GLSLBuggyDiscard to avoid overdraw of such regions. Historically we disabled `discard` due to an old NV tegra2 compiler bug, which caused the compiler to freeze. Today we no more seem to have this GLSL compiler issue, i.e. GLRendererQuirks.GLSLBuggyDiscard never gets set. --- .../opengl/shader/curverenderer01-pass1-curve_simple.orig.glsl | 7 +++++-- .../graph/curve/opengl/shader/curverenderer01-pass2-msaa.glsl | 8 ++++---- .../curve/opengl/shader/curverenderer01-pass2-vbaa_allprop01.glsl | 8 ++++---- .../opengl/shader/curverenderer01-pass2-vbaa_bforce_even.glsl | 8 ++++---- .../opengl/shader/curverenderer01-pass2-vbaa_bforce_odd.glsl | 8 ++++---- .../curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad.glsl | 8 ++++---- .../curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad2.glsl | 8 ++++---- .../curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad3.glsl | 8 ++++---- .../opengl/shader/curverenderer01-pass2-vbaa_poles_bilin1.glsl | 8 ++++---- .../opengl/shader/curverenderer01-pass2-vbaa_polesequal.glsl | 8 ++++---- .../opengl/shader/curverenderer01-pass2-vbaa_polesprop01.glsl | 8 ++++---- .../curve/opengl/shader/curverenderer01-pass2-vbaa_quincunx.glsl | 8 ++++---- .../curve/opengl/shader/curverenderer01-pass2-vbaa_rgss.glsl | 8 ++++---- 13 files changed, 53 insertions(+), 50 deletions(-) (limited to 'src/jogl/classes/jogamp/graph/curve') diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.orig.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.orig.glsl index fa2608365..312271783 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.orig.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.orig.glsl @@ -17,8 +17,11 @@ rtex.y -= 0.1; if(rtex.y < 0.0 && gcv_CurveParam.y < 0.0) { - // discard; // freezes NV tegra2 compiler - mgl_FragColor = vec4(0); + #if USE_DISCARD + discard; // freezes NV tegra2 compiler + #else + mgl_FragColor = vec4(0); + #endif } else { rtex.y = max(rtex.y, 0.0); // always >= 0 diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-msaa.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-msaa.glsl index 1872af67f..d9d85e0e9 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-msaa.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-msaa.glsl @@ -1,9 +1,9 @@ // Pass-2: Dump Texture vec4 t = texture2D(gcu_FboTexUnit, gcv_FboTexCoord.st); - #if 0 - if( 0.0 == t.a ) { - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if( 0.0 == t.a ) { + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_allprop01.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_allprop01.glsl index 436dd4ed4..4a843c6e3 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_allprop01.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_allprop01.glsl @@ -104,10 +104,10 @@ } } - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_even.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_even.glsl index ba7611a06..d69bc0e32 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_even.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_even.glsl @@ -87,10 +87,10 @@ #endif #endif #endif - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_odd.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_odd.glsl index 7adf111d5..acc1da7e2 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_odd.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_odd.glsl @@ -78,10 +78,10 @@ #endif #endif #endif - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad.glsl index 3e74fb9a6..d1499549f 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad.glsl @@ -31,10 +31,10 @@ } - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad2.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad2.glsl index 9e31e6bb7..55710f18a 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad2.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad2.glsl @@ -31,10 +31,10 @@ t += GetSample(gcu_FboTexUnit, texCoord, psize, edge1Q, 0.0, 0.5, 0.5)*0.25; // upper-right [p1] } - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad3.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad3.glsl index 8cc108bd1..5d5c8c924 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad3.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad3.glsl @@ -99,10 +99,10 @@ #endif - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_poles_bilin1.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_poles_bilin1.glsl index d634c1f9b..48f4f93ea 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_poles_bilin1.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_poles_bilin1.glsl @@ -82,10 +82,10 @@ } } - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesequal.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesequal.glsl index 0e8b6f161..d83a1e6a2 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesequal.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesequal.glsl @@ -39,10 +39,10 @@ } } } - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesprop01.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesprop01.glsl index 6c263b9bd..5d8bdff66 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesprop01.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesprop01.glsl @@ -56,10 +56,10 @@ } } - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_quincunx.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_quincunx.glsl index 07a9adf46..19b738305 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_quincunx.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_quincunx.glsl @@ -18,10 +18,10 @@ t += GetSample(gcu_FboTexUnit, texCoord, psize, edgeH, -edgeH, 0.0, 0.0)*0.125; // w4 - w/ all pixels t += GetSample(gcu_FboTexUnit, texCoord, psize, edgeH, edgeH, 0.0, 0.0)*0.125; // w5 - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_rgss.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_rgss.glsl index 27a5684a6..f80ce45fa 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_rgss.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_rgss.glsl @@ -15,10 +15,10 @@ t += GetSample(gcu_FboTexUnit, texCoord, psize, 0.0, edge1Q, 0.5, 0.5)*0.25; // upper-right [p2] t += GetSample(gcu_FboTexUnit, texCoord, psize, edge1Q, 0.0, 0.5, -0.5)*0.25; // lower-right [p4] - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } + #if USE_DISCARD + if(t.w == 0.0){ + discard; // discard freezes NV tegra2 compiler + } #endif mgl_FragColor = t; -- cgit v1.2.3