Skip to contentSkip to conversation

ARB_copy_image breaks recording with obs-studio

Bug 92907 [email protected] 1 participant 9 messages Nov 11, 2015 – Nov 12, 2015

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=92907

Bug ID: 92907
Summary: ARB_copy_image breaks recording with obs-studio
Product: Mesa
Version: git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/radeonsi
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

Created attachment 119567
--> https://bugs.freedesktop.org/attachment.cgi?id=119567&action=edit
dmesg

Recording a desktop window with obs-studio produces only a red image. This has worked before so i did a bisect and it led to f04f13622f3e71bee057d60a6be9c53b92b56cc9 as the first broken commit. obs-studio displays lots of:

error: glCopyImageSubData failed, glGetError returned 0x502
error: device_copy_texture (GL) failed

I'm running kernel 4.3, xserver 1.18 and mesa and llvm git. This is on a cape verde card (7750)

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=92907

--- Comment #1 from [email protected] ---
Created attachment 119568
--> https://bugs.freedesktop.org/attachment.cgi?id=119568&action=edit
output from obs-studio

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92907

--- Comment #2 from Ilia Mirkin <[email protected]> ---
I just pushed a patch to fix bug 92860, also related to copy image. Please try with
http://cgit.freedesktop.org/mesa/mesa/commit/?id=912babba7bf1abd3caa49f6372d581ae1afe7e84
and see if the issue still happens.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92907

--- Comment #3 from Ilia Mirkin <[email protected]> --- Actually you're getting GL_INVALID_OPERATION, whereas the other issue would cause GL_INVALID_VALUE.

Please record an (ideally small) apitrace of the issue and make it available for analysis.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92907

--- Comment #4 from [email protected] ---
Created attachment 119569
--> https://bugs.freedesktop.org/attachment.cgi?id=119569&action=edit
apitrace showing the issue

Here is an apitrace when trying to record xfce-panel.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92907

--- Comment #5 from Ilia Mirkin <[email protected]> --- OK, so the issue is coming from

70518 glCopyImageSubData(srcName = 9, srcTarget = GL_TEXTURE_2D, srcLevel = 0, srcX = 0, srcY = 0, srcZ = 0, dstName = 8, dstTarget = GL_TEXTURE_2D, dstLevel = 0, dstX = 0, dstY = 0, dstZ = 0, srcWidth = 1920, srcHeight = 31, srcDepth =
1)

We error out complaining that the internal formats don't match.

Texture 9:

70257 glBindTexture(target = GL_TEXTURE_2D, texture = 9)
70258 glXBindTexImageEXT(display = 0x210df00, drawable = 69206018, buffer = GLX_FRONT_LEFT_EXT, attrib_list = {})
70259 glTexImage2D(target = GL_TEXTURE_2D, level = 0, internalformat = GL_RGB, width = 1920, height = 31, border =
0, format = GL_RGBA, type = GL_UNSIGNED_BYTE, pixels = blob(238080))

Texture 8:

70244 glBindTexture(target = GL_TEXTURE_2D, texture = 8)
70246 glTexImage2D(target = GL_TEXTURE_2D, level = 0, internalformat = GL_RGBA, width = 1920, height = 31, border =
0, format = GL_RGBA, type = GL_UNSIGNED_BYTE, pixels = blob(238080))

AFAIK this is illegal [copying between GL_RGB and GL_RGBA internal formats], but I haven't double-checked the ARB_copy_image spec or a full GL spec release (where these things are often updated).

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92907

--- Comment #6 from Ilia Mirkin <[email protected]> --- (In reply to Ilia Mirkin from comment #5)

Quoted 3 lines

AFAIK this is illegal [copying between GL_RGB and GL_RGBA internal formats], but I haven't double-checked the ARB_copy_image spec or a full GL spec release (where these things are often updated).

Looks like the GL spec was slightly updated a bit on top of what GL_ARB_copy_image says. This is the text from GL 4.5, Section 18.3.3 (Copying Between Images):

For the purposes of CopyImageSubData, two internal formats are considered compatible if any of the following conditions are met:

• the formats are the same. If the formats are the same but are a base internal format, the the implementation’s effective internal format (see the end of section 8.5) for each image must be the same.
• the formats are considered compatible according to the compatibility rules used for texture views as defined in section 8.18. In particular, if both internal formats are listed in the same entry of table 8.30, they are considered compatible
• one format is compressed and the other is uncompressed and table 18.5 lists the two formats in the same row.

The compressed bullet doesn't apply, and texture views are only defined for sized formats. Looks like on top of what the ARB_copy_image spec says, we're free to deny copying based on arbitrary rules if a base internal format is used (like GL_RGBA/GL_RGB). But only if the two are the same... if they're not (as is the case in the trace you gave), that's always illegal.

So... I'm gonna go with obs-studio bug.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92907

--- Comment #7 from [email protected] ---
Ok, thanks. I opened a bug at the obs-studio bugtracker:
https://obsproject.com/mantis/view.php?id=370

btw, issue remains with the patch in comment 2.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92907

Ilia Mirkin <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |NOTOURBUG

--- Comment #8 from Ilia Mirkin <[email protected]> --- Closing this for now. Feel free to reopen should analysis on the obs-studio side disagree with my findings.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel