amd gfx card fails to implement scissors

Bug #2008818 reported by Tero Pulkkinen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GameApiBuilder
Fix Committed
Undecided
Unassigned
Mesa
New
Undecided
Unassigned

Bug Description

The code that tries to clip the rendering looks like this:
  void render()
  {
    OpenglLowApi *ogl = g_low->ogl;
    if (is_visible())
      {
    ogl->glEnable(Low_GL_SCISSOR_TEST);
    if (g_event_screen_y!=-1) {
      float scale_x = float(g_event_screen_x)/float(ev.mainloop_api.get_screen_width());
      float scale_y = float(g_event_screen_y)/float(ev.mainloop_api.get_screen_height());
      //std::cout << "SCISSOR SIZE: " << size.dx << " " << size.dy << " " << scale_x << " " << scale_y << std::endl;
      ogl->glScissor(pos.x*scale_x, g_event_screen_y-pos.y*scale_y-size.dy*scale_y, (size.dx)*scale_x, size.dy*scale_y);
    } else {
      ogl->glScissor(pos.x, screen_y-pos.y-size.dy, size.dx, size.dy);
    }
    vec[0]->render();
    ogl->glDisable(Low_GL_SCISSOR_TEST);
      }
  }

These glScissor calls went broken in most recent amd driver update and it simply doesn't clip the drawing to the scissor rectangle.

Revision history for this message
Tero Pulkkinen (terop222) wrote :

The gpu used in the bug was:
GPU Vendor: AMD()
GPU Renderer:AMD Radeon Vega 8 Graphics (raven, LLVM 15.0.2, DRM 3.47, 5.19.0-31-generic)
GPU Version:OpenGL ES 3.2 Mesa 22.2.5

Revision history for this message
Tero Pulkkinen (terop222) wrote :

here's image of what happens in gameapi builder: https://tpgames.org/driver_bug.png
i.e. the drawing is not correctly clipped.

Revision history for this message
Tero Pulkkinen (terop222) wrote :

Looks like this problem is my own issue with compiling the software. => glScissors went broken because of invalid build after some changes. Incremental build didn't handle all dependencies correctly and messed up the glScissor call target.

Changed in gameapibuilder:
status: New → Fix Committed
Revision history for this message
Tero Pulkkinen (terop222) wrote :

Sorry about sending bug report forward too early.

Revision history for this message
Tero Pulkkinen (terop222) wrote :

(the gameapi builder project doesn't use autoconf/automake, since it cannot handle c++ dependencies correctly. Build times are important parameters for the project, and incremental build is currently taking 15s to compile, while full build is significantly slower. GTKMM project used to have automake/autoconf and there I learned how the dependencies with c++ projects could be broken. GTKMM used to have huge compile times which everyone associated c++'s templates,but real problem was with autoconf/automake triggering builds every time you changed anything, and because header file dependencies were used, it compiled everything every time. Correct solution is to remove .hh files from the dependencies and then compile just .cc files for incremental build and then if that isn't sufficient, full build with make clean ; make -j 8 can be used to recompile the whole thing. But it needs to be programmers choice whether to do full build or incremental build and it should not be done automatically inside autoconf/automake.)

Revision history for this message
Tero Pulkkinen (terop222) wrote :

additional comment: when doing changes, c++ requires always change to .hh file and .cc file simultaniously. But .hh file change triggers with normal build systems the problem of full build since every file uses the same .hh files. Thus if .hh files is in dependencies, there's no good incremental builds available.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.