<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Looks good to me.</p>
<p><br>
</p>
<p>Reviewed-by: Neha Bhende<bhenden@vmware.com></p>
<p><br>
</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Regards,</p>
<p>Neha<br>
</p>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Brian Paul <brianp@vmware.com><br>
<b>Sent:</b> Wednesday, April 26, 2017 8:28:02 AM<br>
<b>To:</b> mesa-dev@lists.freedesktop.org<br>
<b>Cc:</b> Charmaine Lee; Neha Bhende<br>
<b>Subject:</b> [PATCH] st/mesa: minor clean-ups in st_update_renderbuffer_surface()</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Remove unneeded parens. Add const qualifiers. Move var decls closer<br>
to where they're used.<br>
---<br>
src/mesa/state_tracker/st_cb_fbo.c | 17 ++++++++---------<br>
1 file changed, 8 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c<br>
index 7b9855f..f908225 100644<br>
--- a/src/mesa/state_tracker/st_cb_fbo.c<br>
+++ b/src/mesa/state_tracker/st_cb_fbo.c<br>
@@ -388,18 +388,19 @@ st_update_renderbuffer_surface(struct st_context *st,<br>
{<br>
struct pipe_context *pipe = st->pipe;<br>
struct pipe_resource *resource = strb->texture;<br>
- struct st_texture_object *stTexObj = NULL;<br>
+ const struct st_texture_object *stTexObj = NULL;<br>
unsigned rtt_width = strb->Base.Width;<br>
unsigned rtt_height = strb->Base.Height;<br>
unsigned rtt_depth = strb->Base.Depth;<br>
+<br>
/*<br>
* For winsys fbo, it is possible that the renderbuffer is sRGB-capable but<br>
* the format of strb->texture is linear (because we have no control over<br>
* the format). Check strb->Base.Format instead of strb->texture->format<br>
* to determine if the rb is sRGB-capable.<br>
*/<br>
- boolean enable_srgb = (st->ctx->Color.sRGBEnabled &&<br>
- _mesa_get_format_color_encoding(strb->Base.Format) == GL_SRGB);<br>
+ boolean enable_srgb = st->ctx->Color.sRGBEnabled &&<br>
+ _mesa_get_format_color_encoding(strb->Base.Format) == GL_SRGB;<br>
enum pipe_format format = resource->format;<br>
<br>
if (strb->is_rtt) {<br>
@@ -408,11 +409,7 @@ st_update_renderbuffer_surface(struct st_context *st,<br>
format = stTexObj->surface_format;<br>
}<br>
<br>
- format = (enable_srgb) ?<br>
- util_format_srgb(format) :<br>
- util_format_linear(format);<br>
-<br>
- unsigned first_layer, last_layer, level;<br>
+ format = enable_srgb ? util_format_srgb(format) : util_format_linear(format);<br>
<br>
if (resource->target == PIPE_TEXTURE_1D_ARRAY) {<br>
rtt_depth = rtt_height;<br>
@@ -420,6 +417,7 @@ st_update_renderbuffer_surface(struct st_context *st,<br>
}<br>
<br>
/* find matching mipmap level size */<br>
+ unsigned level;<br>
for (level = 0; level <= resource->last_level; level++) {<br>
if (u_minify(resource->width0, level) == rtt_width &&<br>
u_minify(resource->height0, level) == rtt_height &&<br>
@@ -431,6 +429,7 @@ st_update_renderbuffer_surface(struct st_context *st,<br>
assert(level <= resource->last_level);<br>
<br>
/* determine the layer bounds */<br>
+ unsigned first_layer, last_layer;<br>
if (strb->rtt_layered) {<br>
first_layer = 0;<br>
last_layer = util_max_layer(strb->texture, level);<br>
@@ -443,7 +442,7 @@ st_update_renderbuffer_surface(struct st_context *st,<br>
/* Adjust for texture views */<br>
if (strb->is_rtt && resource->array_size > 1 &&<br>
stTexObj->base.Immutable) {<br>
- struct gl_texture_object *tex = &stTexObj->base;<br>
+ const struct gl_texture_object *tex = &stTexObj->base;<br>
first_layer += tex->MinLayer;<br>
if (!strb->rtt_layered)<br>
last_layer += tex->MinLayer;<br>
-- <br>
1.9.1<br>
<br>
</div>
</span></font>
</body>
</html>