Skip to contentSkip to conversation

New: Framebuffer Depth textures (Shadow mapping) - FBO-EXT

Bug 33762 [email protected] 1 participant 17 messages Jan 31, 2011 – Apr 7, 2011

lore
Share & tools
lore
#0 lore raw

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

Summary: Framebuffer Depth textures (Shadow mapping) - FBO-EXT
Product: Mesa
Version: git
Platform: x86-64 (AMD64)
OS/Version: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/DRI/R600
AssignedTo: [email protected]
ReportedBy: [email protected]

I'm running a depth map demo that uses fbo depth maps as a render target. The fbo (EXT) is filled with static stuff (like a mask that is moved over the screen). So the contents i drawed into the buffer (the depth component is bound to the buffer) are ignored

I don't know if this feature is in progress or if you know what is missing in the driver.
If you have no clue, I can offer the following things after a request:
- Pics of the artifacts
- Videos that show that the depth texture is not updated
- Explanation how i set up the FBO/Renderbuffer

The thing works with fglrx.

Extensions I used:
Framebuffer_EXT
Renderbuffer_EXT (for depth store)

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#1 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

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

--- Comment #1 from [email protected] 2011-01-31 07:40:14 PST --- Here the code:

glGenFramebuffersEXT(1, @fb); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb); glGenRenderbuffersEXT(1, @render_buf); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, render_buf); glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, ShadowSize,
ShadowSize);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, render_buf);

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#2 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #2 from Alex Deucher <[email protected]> 2011-01-31 07:47:56 PST --- You'll probably have more luck with the r600 gallium driver (r600g).

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#4 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

[email protected] changed:

What |Removed |Added
----------------------------------------------------------------------------
Component|Drivers/DRI/R600 |Drivers/Gallium/r600

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#5 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #4 from [email protected] 2011-01-31 09:41:12 PST --- i found a demo that reproduces the bug for me:

http://cgit.freedesktop.org/mesa/demos/
in /demos/shadowtex

in all programs the texture looks the same. i attached a pic how the demo looks like. watch the shadow

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#6 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #5 from [email protected] 2011-01-31 09:42:17 PST --- Created an attachment (id=42761)
--> (https://bugs.freedesktop.org/attachment.cgi?id=42761)
shadow map

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#7 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #6 from [email protected] 2011-01-31 12:04:55 PST --- The following hint is given in the docs:

6.3 CB
6.3.1 DB->CB Copies: RV6xx
In RV610, RV630, RV620, and RV635 but not R600, RV670, or RS780, the DB->CB copies needs the following
programming sequence to ensure the DB will read the Z/Stencil data.
1. Z_ENABLE = true
2. STENCIL_ENABLE = true
3. Z_WRITE_ENABLE = false
4. STENCILWRITEMASK = 0xff
5. Z vertices = 0.0. (like a Z clear to 0.0)
6. ZFUNC= LEQUAL
7. STENCILFUNC = REF_ALWAYS
8. STENCILZPASS = STENCIL_KEEP
9. STENCILZFAIL = STENCIL_INCR_CLAMP
10. DB_RENDER_OVERRIDE.FORCE_HIZ_ENABLE = FORCE_DISABLE

It seems to be a RV6xx specific problem. I hope, you can fix it.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#8 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #7 from Henri Verbeet <[email protected]> 2011-01-31 16:25:18 PST --- Probably fixed by d171ae086bae37279251a1d6f32e16e333cfc154, shadowtex is at least.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#9 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #8 from [email protected] 2011-01-31 23:45:44 PST --- the latest changes (between 11bc8991e94e2fa6d461193a6aff47f8f94b7a47 and 5e19b5ad16b2761fe9d8877318f2fc97b229335c) broke the driver.
I can use 2D menus with OGL and glxgears works but when I start using the 3D part (uses FBO, shaders and vertex buffers), the image freezes and I cannot stop my prog.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#10 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #9 from Dave Airlie <[email protected]> 2011-02-01 00:05:36 PST --- does reverting

11bc8991e94e2fa6d461193a6aff47f8f94b7a47

fix it?

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#11 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #10 from [email protected] 2011-02-01 00:15:31 PST --- Git bisect blamed 14880a510a1a288df0778395097d5a52806abfb0,
there are strange things happening.
The framerate drops downto 3 FPS and the texture bug appears again.

I also created a patch inspired from glisse that fixes the bug (but is maybe not the correct solution because the tiling management is still unfinished)

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#12 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #11 from [email protected] 2011-02-01 00:16:03 PST --- (In reply to comment #9)

Quoted 5 lines

does reverting

11bc8991e94e2fa6d461193a6aff47f8f94b7a47

fix it?

no

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#13 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #12 from [email protected] 2011-02-01 00:19:08 PST --- Created an attachment (id=42797)
View: https://bugs.freedesktop.org/attachment.cgi?id=42797
Review: https://bugs.freedesktop.org/review?bug=33762&attachment=42797

Patch that fixes the depth map copying (but not the freeze)

This patch is inspired by Jerome Glisse
This patch does not solve the problem that the screen is freezing

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#14 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #13 from [email protected] 2011-02-01 00:23:53 PST --- When I revert 14880a510a1a288df0778395097d5a52806abfb0, i can play with working depth textures and 3 FPS.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#15 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

--- Comment #14 from [email protected] 2011-02-01 00:26:09 PST --- Ah,
as I see the original problem is fixed in git but the glsl compiler had a deadlock so that I cannot test it.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#16 lore raw

[Bug 33762] Framebuffer Depth textures (Shadow mapping) - FBO-EXT

In reply to [email protected]

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

[email protected] changed:

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

             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #15 from [email protected] 2011-04-07 01:20:28 PDT --- resolved long time ago

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.