Opened 4 years ago
Last modified 3 years ago
#16847 new bug
Glteapot misrenders on 16bit color
Reported by: | nephele | Owned by: | kallisti5 |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Applications/GLTeapot | Version: | R1/beta2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
Attachments (2)
Change History (17)
by , 4 years ago
Attachment: | screenshot.png added |
---|
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
follow-up: 5 comment:2 by , 4 years ago
can you provide a list of what color spaces work / don't work?
Example:
- 15-bit ??
- 16-bit Doesn't work
- 32-bit ??
comment:3 by , 4 years ago
I reimplemented HGL BDirectWindow rendering and it currently supports only RGBX32/RGBA32 format. For other formats it is not supposed to render anything at all. I missed some color format check and it always render to framebuffer like it is RGBA32 format.
comment:5 by , 4 years ago
Replying to kallisti5:
can you provide a list of what color spaces work / don't work?
Example:
- 15-bit ??
- 16-bit Doesn't work
- 32-bit ??
32bit works, the rest doesn't (but the 8bit, 24bit mode are also broken in other ways for me)
comment:6 by , 4 years ago
Replying to X512:
How does it work with old Mesa package (version 17)?
For me it works with all color modes, the proportions look correct in every mode (as in contained inside the window)
comment:7 by , 4 years ago
I used BBitmap API calls in the original code to copy image data around. The new softpipe rendering code uses this...
Maybe one of the calculations in RasBuf32 breaks on different colorspaces?
comment:8 by , 4 years ago
Maybe one of the calculations in RasBuf32 breaks on different colorspaces?
Well, it is called RasBuf32, so it is true. But it can be easily adjusted for same source and destination color space that is 8 bit or higher (1, 2, 4 bit color will need adding bit offset because pointer can't point to bits). Maybe color bit count conversion will be needed for non-32 bit framebuffer. After my changes Mesa renders directly to BBitmap instead of using additional 32 bit buffer and copying it to BBitmap.
comment:9 by , 3 years ago
Using the VESA driver, I tested GLTeapot with Haiku hrev55145 x86_64 w/Mesa 17.1.10. The GLTeapot is consistently running during this testing.
Note: Using VESA driver, GLTeapot viewport is correct at 32bpp color selection. If I switch to another color setting while GLTeapot remains active:
- 1024x768 @ 8 bits/pixel - GLTeapot display extends vertically outside of app window borders. GLTeapot menu doesn't display properly when selecting selections. GLTeapot is miscolored.
- 1024x768 @ 16 bits/pixel - GLTeapot display extends vertically outside of app window borders. GLTeapot menu doesn't display properly when selecting selections. GLTeapot is miscolored.
- 1024x768 @ 32 bits/pixel - GLTeapot display is within app window borders and GLTeapot menu is displaying downwards normally. No display issues.
comment:11 by , 3 years ago
As discussed in IRC, I reproduced the bug using the VESA video driver w/Mesa17 - if the GLTeapot is consistently running (not restarted) during display color setting modifcations (i.e. when user is switching display color settings while the app is running).
If you start GLTeapot after you switch to 16bpp, here are the results:
Note:
- The Intel video driver passed (i.e. Haiku R1B3 x86_64 w/Mesa 17). GLTeapot viewport displayed no issues.
- The Nvidia video driver passed (i.e. Haiku R1B3 x86_64 w/Mesa 17). GLTeapot viewport displayed no issues.
- The VESA video driver passed (i.e. Haiku R1B3 x86_64 w/Mesa 17). GLTeapot viewport displayed no issues.
NOTE: I was told the bug was seen with the radeon_hd video driver at the 16bpp color setting. I reproduced the bug switching the display color settings (i.e. 32bpp to 16bpp) using the VESA driver while keeping the GLTeapot consistently active (i.e. not restarting it during color setting changes).
comment:12 by , 3 years ago
Progress... bug seems fixed. See: https://discuss.haiku-os.org/t/the-graphics-acceleration-can-of-worms/10515/21
Using the VESA driver, I tested GLTeapot with Haiku hrev55306 x86_64 w/Mesa 21.2.0. The GLTeapot is consistently running during this testing.
Note: Using VESA driver, GLTeapot viewport is correct at 32bpp color selection. If I switch to another color setting while GLTeapot remains active:
1024x768 @ 8 bits/pixel - GLTeapot display is within app window borders and GLTeapot menu is displaying downwards normally. No display issues.
1024x768 @ 16 bits/pixel - GLTeapot display is within app window borders and GLTeapot menu is displaying downwards normally. No display issues.
1024x768 @ 32 bits/pixel - GLTeapot display is within app window borders and GLTeapot menu is displaying downwards normally. No display issues.
comment:13 by , 3 years ago
How did you determine this? I can't build mesa-21.2.1 or mesa-21.2.0 on haiku.
In file included from ../src/util/u_cpu_detect.h:40, from ../src/util/half_float.h:32, from ../src/util/half_float.c:30: ../src/util/u_thread.h:365:16: error: conflicting types for 'thread_id' typedef thrd_t thread_id; ^~~~~~~~~
by , 3 years ago
Attachment: | mesa-21.2.1.patchset added |
---|
comment:14 by , 3 years ago
It's my patchset fixes build problems and adds support for 8 and 16 bit modes.
comment:15 by , 3 years ago
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12597 was opened for this one to merge upstream.
I cleaned the patches up a little and broke them apart.
Screenshot