{
struct pipe_context *pipe = st->pipe;
struct pipe_resource *resource = strb->texture;
- struct st_texture_object *stTexObj = NULL;
+ const struct st_texture_object *stTexObj = NULL;
unsigned rtt_width = strb->Base.Width;
unsigned rtt_height = strb->Base.Height;
unsigned rtt_depth = strb->Base.Depth;
+
/*
* For winsys fbo, it is possible that the renderbuffer is sRGB-capable but
* the format of strb->texture is linear (because we have no control over
* the format). Check strb->Base.Format instead of strb->texture->format
* to determine if the rb is sRGB-capable.
*/
- boolean enable_srgb = (st->ctx->Color.sRGBEnabled &&
- _mesa_get_format_color_encoding(strb->Base.Format) == GL_SRGB);
+ boolean enable_srgb = st->ctx->Color.sRGBEnabled &&
+ _mesa_get_format_color_encoding(strb->Base.Format) == GL_SRGB;
enum pipe_format format = resource->format;
if (strb->is_rtt) {
format = stTexObj->surface_format;
}
- format = (enable_srgb) ?
- util_format_srgb(format) :
- util_format_linear(format);
-
- unsigned first_layer, last_layer, level;
+ format = enable_srgb ? util_format_srgb(format) : util_format_linear(format);
if (resource->target == PIPE_TEXTURE_1D_ARRAY) {
rtt_depth = rtt_height;
}
/* find matching mipmap level size */
+ unsigned level;
for (level = 0; level <= resource->last_level; level++) {
if (u_minify(resource->width0, level) == rtt_width &&
u_minify(resource->height0, level) == rtt_height &&
assert(level <= resource->last_level);
/* determine the layer bounds */
+ unsigned first_layer, last_layer;
if (strb->rtt_layered) {
first_layer = 0;
last_layer = util_max_layer(strb->texture, level);
/* Adjust for texture views */
if (strb->is_rtt && resource->array_size > 1 &&
stTexObj->base.Immutable) {
- struct gl_texture_object *tex = &stTexObj->base;
+ const struct gl_texture_object *tex = &stTexObj->base;
first_layer += tex->MinLayer;
if (!strb->rtt_layered)
last_layer += tex->MinLayer;