mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 12:50:12 +01:00
intel: Correctly check for read-only mappings in intel_bufferobj_map_range
The old code was an obvious cut-and-paste fail from intel_bufferobj_map. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
This commit is contained in:
parent
4ddae2fb66
commit
f973be59fa
1 changed files with 3 additions and 1 deletions
|
|
@ -374,7 +374,6 @@ intel_bufferobj_map_range(struct gl_context * ctx,
|
|||
{
|
||||
struct intel_context *intel = intel_context(ctx);
|
||||
struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
|
||||
GLboolean read_only = (access == GL_READ_ONLY_ARB);
|
||||
|
||||
assert(intel_obj);
|
||||
|
||||
|
|
@ -386,6 +385,9 @@ intel_bufferobj_map_range(struct gl_context * ctx,
|
|||
obj->AccessFlags = access;
|
||||
|
||||
if (intel_obj->sys_buffer) {
|
||||
const bool read_only =
|
||||
(access & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) == GL_MAP_READ_BIT;
|
||||
|
||||
if (!read_only && intel_obj->source)
|
||||
release_buffer(intel_obj);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue