X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_cb_fbo.c;h=5b9e2037423ef2c7f0432fba74c592c1ba706da4;hb=a65e9706035c0e348307e76fdeeed0910ec8c68e;hp=7ffee901cdb8fef9cc16af258a616f066240cdfb;hpb=25f26997670302b07d48207b28f385f85f6af9bb;p=mesa.git diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 7ffee901cdb..5b9e2037423 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -74,11 +74,8 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, enum pipe_format format; struct pipe_surface surf_tmpl; - if (strb->format != PIPE_FORMAT_NONE) - format = strb->format; - else - format = st_choose_renderbuffer_format(screen, internalFormat, - rb->NumSamples); + format = st_choose_renderbuffer_format(screen, internalFormat, + rb->NumSamples); if (format == PIPE_FORMAT_NONE) { return FALSE; @@ -90,6 +87,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, strb->Base.Format = st_pipe_format_to_mesa_format(format); strb->Base._BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); strb->Base.DataType = st_format_datatype(format); + strb->format = format; strb->defined = GL_FALSE; /* undefined contents now */ @@ -272,7 +270,8 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) strb->Base.InternalFormat = GL_STENCIL_INDEX8_EXT; break; case PIPE_FORMAT_R16G16B16A16_SNORM: - strb->Base.InternalFormat = GL_RGBA16; + /* accum buffer */ + strb->Base.InternalFormat = GL_RGBA16_SNORM; break; case PIPE_FORMAT_R8_UNORM: strb->Base.InternalFormat = GL_R8; @@ -353,7 +352,7 @@ st_render_texture(struct gl_context *ctx, return; /* get pointer to texture image we're rendeing to */ - texImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; + texImage = _mesa_get_attachment_teximage(att); /* create new renderbuffer which wraps the texture image */ rb = st_new_renderbuffer(ctx, 0); @@ -471,8 +470,7 @@ st_validate_attachment(struct gl_context *ctx, return GL_FALSE; format = stObj->pt->format; - texFormat = - stObj->base.Image[att->CubeMapFace][att->TextureLevel]->TexFormat; + texFormat = _mesa_get_attachment_teximage_const(att)->TexFormat; /* If the encoding is sRGB and sRGB rendering cannot be enabled, * check for linear format support instead.