mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-18 11:10:25 +01:00
change initialization of renderbuffer DepthBits
This commit is contained in:
parent
199ef86b5e
commit
eb063cfa38
2 changed files with 13 additions and 3 deletions
|
|
@ -319,6 +319,11 @@ _mesa_update_draw_buffer_bounds(GLcontext *ctx)
|
|||
* change depending on the renderbuffer bindings. This function updates
|
||||
* the given framebuffer's Visual from the current renderbuffer bindings.
|
||||
* This is only intended for user-created framebuffers.
|
||||
*
|
||||
* Also note: ctx->DrawBuffer->Visual.depthBits might not equal
|
||||
* ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer.DepthBits.
|
||||
* The former one is used to convert floating point depth values into
|
||||
* integer Z values.
|
||||
*/
|
||||
void
|
||||
_mesa_update_framebuffer_visual(struct gl_framebuffer *fb)
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
|
|||
rb->PutMonoRow = put_mono_row_ushort;
|
||||
rb->PutValues = put_values_ushort;
|
||||
rb->PutMonoValues = put_mono_values_ushort;
|
||||
/*rb->DepthBits not set here */
|
||||
rb->DepthBits = 8 * sizeof(GLushort);
|
||||
pixelSize = sizeof(GLushort);
|
||||
break;
|
||||
case GL_DEPTH_COMPONENT24:
|
||||
|
|
@ -1060,7 +1060,10 @@ soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
|
|||
rb->PutMonoRow = put_mono_row_uint;
|
||||
rb->PutValues = put_values_uint;
|
||||
rb->PutMonoValues = put_mono_values_uint;
|
||||
/* rb->DepthBits not set here */
|
||||
if (internalFormat == GL_DEPTH_COMPONENT24)
|
||||
rb->DepthBits = 24;
|
||||
else
|
||||
rb->DepthBits = 32;
|
||||
pixelSize = sizeof(GLuint);
|
||||
break;
|
||||
case GL_COLOR_INDEX8_EXT:
|
||||
|
|
@ -1711,10 +1714,12 @@ _mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb,
|
|||
if (depthBits <= 16) {
|
||||
rb->InternalFormat = GL_DEPTH_COMPONENT16;
|
||||
}
|
||||
else if (depthBits <= 24) {
|
||||
rb->InternalFormat = GL_DEPTH_COMPONENT24;
|
||||
}
|
||||
else {
|
||||
rb->InternalFormat = GL_DEPTH_COMPONENT32;
|
||||
}
|
||||
rb->DepthBits = depthBits;
|
||||
|
||||
rb->AllocStorage = soft_renderbuffer_storage;
|
||||
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue