diff options
author | marha <marha@users.sourceforge.net> | 2012-01-25 08:24:51 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-01-25 08:24:51 +0100 |
commit | e6432710d8a586386b3c7025e845cf4f80830da3 (patch) | |
tree | a403fa86779a287c97f5605f9b4d455d662ece66 /mesalib/src/mesa/state_tracker | |
parent | d3f0fe49b8cb29295f3e529cc699a2abde1515a1 (diff) | |
download | vcxsrv-e6432710d8a586386b3c7025e845cf4f80830da3.tar.gz vcxsrv-e6432710d8a586386b3c7025e845cf4f80830da3.tar.bz2 vcxsrv-e6432710d8a586386b3c7025e845cf4f80830da3.zip |
mesa git update 25 jan 2012
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom_framebuffer.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_eglimage.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_fbo.c | 22 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_format.c | 100 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_format.h | 3 |
5 files changed, 0 insertions, 128 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c index 76386fe01..a8907c157 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c @@ -139,7 +139,6 @@ update_framebuffer_state( struct st_context *st ) */ strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer); if (strb) { - strb = st_renderbuffer(strb->Base.Wrapped); if (strb->rtt) { /* rendering to a GL texture, may have to update surface */ update_renderbuffer_surface(st, strb); @@ -149,7 +148,6 @@ update_framebuffer_state( struct st_context *st ) else { strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer); if (strb) { - strb = st_renderbuffer(strb->Base.Wrapped); assert(strb->surface); pipe_surface_reference(&framebuffer->zsbuf, strb->surface); } diff --git a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c index 5209fc795..e91e9142d 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c +++ b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c @@ -86,7 +86,6 @@ st_egl_image_target_renderbuffer_storage(struct gl_context *ctx, strb->Base.Width = ps->width; strb->Base.Height = ps->height; strb->Base.Format = st_pipe_format_to_mesa_format(ps->format); - strb->Base.DataType = st_format_datatype(ps->format); strb->Base._BaseFormat = st_pipe_format_to_base_format(ps->format); strb->Base.InternalFormat = strb->Base._BaseFormat; diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c index 911e321a5..fefd93a4b 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c +++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c @@ -97,7 +97,6 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, strb->Base.Height = height; 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 */ @@ -186,23 +185,6 @@ st_renderbuffer_delete(struct gl_renderbuffer *rb) /** - * gl_renderbuffer::GetPointer() - */ -static void * -null_get_pointer(struct gl_context * ctx, struct gl_renderbuffer *rb, - GLint x, GLint y) -{ - /* By returning NULL we force all software rendering to go through - * the span routines. - */ -#if 0 - assert(0); /* Should never get called with softpipe */ -#endif - return NULL; -} - - -/** * Called via ctx->Driver.NewFramebuffer() */ static struct gl_framebuffer * @@ -224,7 +206,6 @@ st_new_renderbuffer(struct gl_context *ctx, GLuint name) _mesa_init_renderbuffer(&strb->Base, name); strb->Base.Delete = st_renderbuffer_delete; strb->Base.AllocStorage = st_renderbuffer_alloc_storage; - strb->Base.GetPointer = null_get_pointer; strb->format = PIPE_FORMAT_NONE; return &strb->Base; } @@ -252,7 +233,6 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) strb->Base.NumSamples = samples; strb->Base.Format = st_pipe_format_to_mesa_format(format); strb->Base._BaseFormat = _mesa_get_format_base_format(strb->Base.Format); - strb->Base.DataType = st_format_datatype(format); strb->format = format; strb->software = sw; @@ -309,7 +289,6 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) /* st-specific methods */ strb->Base.Delete = st_renderbuffer_delete; strb->Base.AllocStorage = st_renderbuffer_alloc_storage; - strb->Base.GetPointer = null_get_pointer; /* surface is allocated in st_renderbuffer_alloc_storage() */ strb->surface = NULL; @@ -425,7 +404,6 @@ st_render_texture(struct gl_context *ctx, strb->format = pt->format; strb->Base.Format = st_pipe_format_to_mesa_format(pt->format); - strb->Base.DataType = st_format_datatype(pt->format); /* printf("RENDER TO TEXTURE obj=%p pt=%p surf=%p %d x %d\n", diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c index 620910ddb..2fdbcd773 100644 --- a/mesalib/src/mesa/state_tracker/st_format.c +++ b/mesalib/src/mesa/state_tracker/st_format.c @@ -47,106 +47,6 @@ #include "st_format.h" -static GLuint -format_max_bits(enum pipe_format format) -{ - GLuint size = util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0); - - size = MAX2(size, util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 1)); - size = MAX2(size, util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 2)); - size = MAX2(size, util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 3)); - size = MAX2(size, util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_ZS, 0)); - size = MAX2(size, util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_ZS, 1)); - return size; -} - - -/** - * Return basic GL datatype for the given gallium format. - */ -GLenum -st_format_datatype(enum pipe_format format) -{ - const struct util_format_description *desc; - int i; - - desc = util_format_description(format); - assert(desc); - - /* Find the first non-VOID channel. */ - for (i = 0; i < 4; i++) { - if (desc->channel[i].type != UTIL_FORMAT_TYPE_VOID) { - break; - } - } - - if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN) { - if (format == PIPE_FORMAT_B5G5R5A1_UNORM || - format == PIPE_FORMAT_B5G6R5_UNORM) { - return GL_UNSIGNED_SHORT; - } - else if (format == PIPE_FORMAT_R11G11B10_FLOAT || - format == PIPE_FORMAT_R9G9B9E5_FLOAT) { - return GL_FLOAT; - } - else if (format == PIPE_FORMAT_Z24_UNORM_S8_UINT || - format == PIPE_FORMAT_S8_UINT_Z24_UNORM || - format == PIPE_FORMAT_Z24X8_UNORM || - format == PIPE_FORMAT_X8Z24_UNORM) { - return GL_UNSIGNED_INT_24_8; - } - else if (format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) { - return GL_FLOAT_32_UNSIGNED_INT_24_8_REV; - } - else { - const GLuint size = format_max_bits(format); - - assert(i < 4); - if (i == 4) - return GL_NONE; - - if (size == 8) { - if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED) - return GL_UNSIGNED_BYTE; - else - return GL_BYTE; - } - else if (size == 16) { - if (desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT) - return GL_HALF_FLOAT; - if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED) - return GL_UNSIGNED_SHORT; - else - return GL_SHORT; - } - else if (size <= 32) { - if (desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT) - return GL_FLOAT; - if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED) - return GL_UNSIGNED_INT; - else - return GL_INT; - } - else { - assert(size == 64); - assert(desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT); - return GL_DOUBLE; - } - } - } - else if (format == PIPE_FORMAT_UYVY) { - return GL_UNSIGNED_SHORT; - } - else if (format == PIPE_FORMAT_YUYV) { - return GL_UNSIGNED_SHORT; - } - else { - /* probably a compressed format, unsupported anyway */ - return GL_NONE; - } -} - - /** * Translate Mesa format to Gallium format. */ diff --git a/mesalib/src/mesa/state_tracker/st_format.h b/mesalib/src/mesa/state_tracker/st_format.h index 10ffeaa73..1dea0d9a5 100644 --- a/mesalib/src/mesa/state_tracker/st_format.h +++ b/mesalib/src/mesa/state_tracker/st_format.h @@ -39,9 +39,6 @@ struct gl_context; struct pipe_screen; -extern GLenum -st_format_datatype(enum pipe_format format); - extern enum pipe_format st_mesa_format_to_pipe_format(gl_format mesaFormat); |