aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/textureview.c
diff options
context:
space:
mode:
authorHenri Verbeet <[email protected]>2018-03-26 19:06:08 +0430
committerHenri Verbeet <[email protected]>2018-03-29 14:38:25 +0430
commit0b73c86b8030a7f7cb35fc85c83eff7f2b8c24a4 (patch)
tree2a89d8402c0741d9874be587e6f1970c12865c97 /src/mesa/main/textureview.c
parente45fe0ed66af32a36b03d5a5141e68fad0d15e6a (diff)
mesa: Inherit texture view multi-sample information from the original texture images.
Found running "The Witness" in Wine. Without this patch, texture views created on multi-sample textures would have a GL_TEXTURE_SAMPLES of 0. All things considered such views actually work surprisingly well, but when combined with (plain) multi-sample textures in a framebuffer object, the resulting FBO is incomplete because the sample counts don't match. CC: <[email protected]> Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/textureview.c')
-rw-r--r--src/mesa/main/textureview.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c
index 89af068fae8..9a064ffd718 100644
--- a/src/mesa/main/textureview.c
+++ b/src/mesa/main/textureview.c
@@ -304,7 +304,8 @@ initialize_texture_fields(struct gl_context *ctx,
struct gl_texture_object *texObj,
GLint levels,
GLsizei width, GLsizei height, GLsizei depth,
- GLenum internalFormat, mesa_format texFormat)
+ GLenum internalFormat, mesa_format texFormat,
+ GLuint numSamples, GLboolean fixedSampleLocations)
{
const GLuint numFaces = _mesa_num_tex_faces(target);
GLint level, levelWidth = width, levelHeight = height, levelDepth = depth;
@@ -326,9 +327,10 @@ initialize_texture_fields(struct gl_context *ctx,
return GL_FALSE;
}
- _mesa_init_teximage_fields(ctx, texImage,
+ _mesa_init_teximage_fields_ms(ctx, texImage,
levelWidth, levelHeight, levelDepth,
- 0, internalFormat, texFormat);
+ 0, internalFormat, texFormat,
+ numSamples, fixedSampleLocations);
}
_mesa_next_mipmap_level_size(target, 0,
@@ -676,7 +678,9 @@ texture_view(struct gl_context *ctx, struct gl_texture_object *origTexObj,
if (!initialize_texture_fields(ctx, target, texObj, newViewNumLevels,
width, height, depth,
- internalformat, texFormat)) {
+ internalformat, texFormat,
+ origTexImage->NumSamples,
+ origTexImage->FixedSampleLocations)) {
return; /* Already recorded error */
}