diff options
author | Illia Iorin <[email protected]> | 2019-07-22 17:07:39 +0300 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2019-10-28 08:31:19 -0700 |
commit | cab0e230ec672cd6c4c3dfe95a4d4e1bd57e078d (patch) | |
tree | 6d3dcc80eee4228d921706d5f61b2c90f82e0edb /src/mesa/main/texobj.c | |
parent | 87db4b93762003b5220c346ba76797b004c826f8 (diff) |
Revert "mesa/main: Fix multisample texture initialize"
This reverts commit a113a42e7369a4e43a1db1c9a7a35a3f7175615e.
Per https://github.com/KhronosGroup/OpenGL-API/issues/45 it
was a wrong way to fix the issue.
Signed-off-by: Illia Iorin <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
(cherry picked from commit 71d4ece366d5cefe58f503429126a102e688ab42)
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r-- | src/mesa/main/texobj.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 5c57266d361..0f124459f75 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -308,8 +308,6 @@ _mesa_initialize_texture_object( struct gl_context *ctx, target == GL_TEXTURE_2D_MULTISAMPLE || target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY); - GLenum filter = GL_LINEAR; - memset(obj, 0, sizeof(*obj)); /* init the non-zero fields */ simple_mtx_init(&obj->Mutex, mtx_plain); @@ -330,30 +328,20 @@ _mesa_initialize_texture_object( struct gl_context *ctx, obj->RequiredTextureImageUnits = 1; /* sampler state */ - switch (target) { - case GL_TEXTURE_2D_MULTISAMPLE: - case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: - filter = GL_NEAREST; - /* fallthrough */ - - case GL_TEXTURE_RECTANGLE_NV: - case GL_TEXTURE_EXTERNAL_OES: - obj->Sampler.WrapS = GL_CLAMP_TO_EDGE; - obj->Sampler.WrapT = GL_CLAMP_TO_EDGE; - obj->Sampler.WrapR = GL_CLAMP_TO_EDGE; - obj->Sampler.MinFilter = filter; - obj->Sampler.MagFilter = filter; - break; - - default: - obj->Sampler.WrapS = GL_REPEAT; - obj->Sampler.WrapT = GL_REPEAT; - obj->Sampler.WrapR = GL_REPEAT; - obj->Sampler.MinFilter = GL_NEAREST_MIPMAP_LINEAR; - obj->Sampler.MagFilter = GL_LINEAR; - break; + if (target == GL_TEXTURE_RECTANGLE_NV || + target == GL_TEXTURE_EXTERNAL_OES) { + obj->Sampler.WrapS = GL_CLAMP_TO_EDGE; + obj->Sampler.WrapT = GL_CLAMP_TO_EDGE; + obj->Sampler.WrapR = GL_CLAMP_TO_EDGE; + obj->Sampler.MinFilter = GL_LINEAR; } - + else { + obj->Sampler.WrapS = GL_REPEAT; + obj->Sampler.WrapT = GL_REPEAT; + obj->Sampler.WrapR = GL_REPEAT; + obj->Sampler.MinFilter = GL_NEAREST_MIPMAP_LINEAR; + } + obj->Sampler.MagFilter = GL_LINEAR; obj->Sampler.MinLod = -1000.0; obj->Sampler.MaxLod = 1000.0; obj->Sampler.LodBias = 0.0; |