summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorGuillaume Charifi <[email protected]>2018-01-05 17:49:39 +0100
committerMarek Olšák <[email protected]>2018-02-20 20:54:49 +0100
commit56bfcd50f7f49d9c5119cd1297064b4d62a0d964 (patch)
tree4f06ac8518a350b0591e88c632205d990ff1ef6b /src/mesa
parent4c4e6232ee2e6dd4c19f526c06df05b829174240 (diff)
st/mesa: Factorize duplicate code in st_update_framebuffer_state()
Signed-off-by: Guillaume Charifi <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index a29f5b35a85..3ef3ff34a97 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -172,6 +172,9 @@ st_update_framebuffer_state( struct st_context *st )
* Depth/Stencil renderbuffer/surface.
*/
strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
+ if (!strb)
+ strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
+
if (strb) {
if (strb->is_rtt) {
/* rendering to a GL texture, may have to update surface */
@@ -180,19 +183,8 @@ st_update_framebuffer_state( struct st_context *st )
framebuffer.zsbuf = strb->surface;
update_framebuffer_size(&framebuffer, strb->surface);
}
- else {
- strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
- if (strb) {
- if (strb->is_rtt) {
- /* rendering to a GL texture, may have to update surface */
- st_update_renderbuffer_surface(st, strb);
- }
- framebuffer.zsbuf = strb->surface;
- update_framebuffer_size(&framebuffer, strb->surface);
- }
- else
- framebuffer.zsbuf = NULL;
- }
+ else
+ framebuffer.zsbuf = NULL;
#ifdef DEBUG
/* Make sure the resource binding flags were set properly */