st/mesa: add texture buffer object support to state tracker (v1.1)

This adds the necessary changes to the st to allow texture buffer object
support if the driver advertises it.

v1.1: remove extra blank line and whitespace

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie
2012-12-06 16:12:11 +10:00
parent a0281c4a8c
commit 915efe7f07
5 changed files with 31 additions and 7 deletions

View File

@@ -215,13 +215,19 @@ update_single_texture(struct st_context *st,
/* Determine the format of the texture sampler view */
st_view_format = stObj->pt->format;
{
const struct st_texture_image *firstImage =
st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]);
const gl_format texFormat = firstImage->base.TexFormat;
enum pipe_format firstImageFormat =
st_mesa_format_to_pipe_format(texFormat);
{
gl_format texFormat;
enum pipe_format firstImageFormat;
if (texObj->Target == GL_TEXTURE_BUFFER) {
texFormat = stObj->base._BufferObjectFormat;
} else {
const struct st_texture_image *firstImage =
st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]);
texFormat = firstImage->base.TexFormat;
}
firstImageFormat = st_mesa_format_to_pipe_format(texFormat);
if ((samp->sRGBDecode == GL_SKIP_DECODE_EXT) &&
(_mesa_get_format_color_encoding(texFormat) == GL_SRGB)) {
/* Don't do sRGB->RGB conversion. Interpret the texture data as