diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 196ac83cd38..7a2829d6a2a 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -602,8 +602,8 @@ set_tex_parameteri(struct gl_context *ctx, goto invalid_pname; case GL_TEXTURE_TILING_EXT: - if (ctx->Extensions.EXT_memory_object) { - texObj->TextureTiling = params[0]; + if (ctx->Extensions.EXT_memory_object && !texObj->Immutable) { + texObj->TextureTiling = params[0]; return GL_TRUE; } diff --git a/src/mesa/state_tracker/st_cb_memoryobjects.h b/src/mesa/state_tracker/st_cb_memoryobjects.h index f05475afbca..565768ebad9 100644 --- a/src/mesa/state_tracker/st_cb_memoryobjects.h +++ b/src/mesa/state_tracker/st_cb_memoryobjects.h @@ -34,6 +34,9 @@ struct st_memory_object { struct gl_memory_object Base; struct pipe_memory_object *memory; + + /* TEXTURE_TILING_EXT param from gl_texture_object */ + GLuint TextureTiling; }; static inline struct st_memory_object * diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index a2d7aa6a6d3..d92a48a5fcf 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -2907,6 +2907,9 @@ st_texture_create_from_memory(struct st_context *st, pt.bind = bind; /* only set this for OpenGL textures, not renderbuffers */ pt.flags = PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY; + if (memObj->TextureTiling == GL_LINEAR_TILING_EXT) + pt.bind |= PIPE_BIND_LINEAR; + pt.nr_samples = nr_samples; pt.nr_storage_samples = nr_samples; @@ -2951,6 +2954,11 @@ st_texture_storage(struct gl_context *ctx, bindings = default_bindings(st, fmt); + if (smObj) { + smObj->TextureTiling = texObj->TextureTiling; + bindings |= PIPE_BIND_SHARED; + } + if (num_samples > 0) { /* Find msaa sample count which is actually supported. For example, * if the user requests 1x but only 4x or 8x msaa is supported, we'll