Skip to contentSkip to conversation

Texture views attached as framebuffers return their viewed tecture's color encoding and render incorrectly

Bug 94595 [email protected] 1 participant 12 messages Mar 17, 2016 – Mar 22, 2016

lore
Share & tools
lore
#0 lore raw

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

Bug ID: 94595
Summary: [Mesa AMD&swrast] Texture views attached as
framebuffers return their viewed tecture's color encoding and render incorrectly
Product: Mesa
Version: git
Hardware: Other
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/radeonsi
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

As seen in the example given, when attaching an SRGB/RGB texture view is created from an alternate RGB/SRGB texture, then attached as a framebuffer, rendering will gamma correct wrongly and querying GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING will return GL_LINEAR for an SRGB backed frame buffer.

This is causing AA renders to be too dark as in our unreleased project, among many other subtle colour issues.

Tested on latest 11.3 (git-9d9965c from oibaf) and seen on older drivers as well.

$ g++ TextureViewFramebufferSRGBTest.cpp.cpp $( sdl2-config --cflags --libs )
-lGL
This reproduces on Mesa AMD and swrast.
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

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

#2 lore raw
In reply to [email protected]

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

--- Comment #2 from Edwin Smith <[email protected]> --- Created attachment 122407
--> https://bugs.freedesktop.org/attachment.cgi?id=122407&action=edit
TextureViewFramebufferSRGB Test Sample Code

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

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

#3 lore raw
In reply to [email protected]

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

--- Comment #3 from Edwin Smith <[email protected]> --- Created attachment 122408
--> https://bugs.freedesktop.org/attachment.cgi?id=122408&action=edit
AMD Mesa Test Output

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

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

#4 lore raw
In reply to [email protected]

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

--- Comment #4 from Edwin Smith <[email protected]> --- Created attachment 122409
--> https://bugs.freedesktop.org/attachment.cgi?id=122409&action=edit
Intel Output (Correct Behaviour)

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

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

#5 lore raw
In reply to [email protected]

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

--- Comment #5 from Edwin Smith <[email protected]> --- Created attachment 122410
--> https://bugs.freedesktop.org/attachment.cgi?id=122410&action=edit
Nvidia Output (Correct Behaviour)

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

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

#6 lore raw
In reply to [email protected]

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

--- Comment #6 from Edwin Smith <[email protected]> --- Created attachment 122411
--> https://bugs.freedesktop.org/attachment.cgi?id=122411&action=edit
Swrast Output (Incorrect Behaviour)

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

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

#7 lore raw
In reply to [email protected]

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

Edwin Smith <[email protected]> changed:

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

 Attachment #122408|AMD Mesa Test Output        |AMD Mesa Output (Incorrect
        description|                            |Behaviour)
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

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

#8 lore raw
In reply to [email protected]

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

--- Comment #7 from Nicolai H�hnle <[email protected]> ---
Hi Edwin, thanks for following up with the details. I'm going to look into this.

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

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

#9 lore raw
In reply to [email protected]

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

--- Comment #8 from Nicolai H�hnle <[email protected]> ---
There is a patch at https://patchwork.freedesktop.org/patch/77510/ which fixes your test case (and should fix format casting with render-to-texture more generally).

Let us know if this fixes your SRGB-related rendering problems.

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

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

#10 lore raw
In reply to [email protected]

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

Nicolai H�hnle <[email protected]> changed:

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

         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #9 from Nicolai H�hnle <[email protected]> --- Fixed in Mesa master, commit a8b315b8271e867db30650dedb52e53d8dd9667c

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

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

#11 lore raw
In reply to [email protected]

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

Edwin Smith <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |VERIFIED

--- Comment #10 from Edwin Smith <[email protected]> --- The test case submitted now works as expected using the latest mesa git drivers. Thank you for such a quick fix!

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

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