clover: Fix host access validation for sub-buffer creation
authorAaron Watry <awatry@gmail.com>
Sat, 7 Apr 2018 18:44:53 +0000 (13:44 -0500)
committerAaron Watry <awatry@gmail.com>
Fri, 20 Apr 2018 01:57:37 +0000 (20:57 -0500)
commit354b12681bc01d967849e05fae2677a3e1c5ca3a
treee154a315b1b8716dd6e986ed2dbf3446a3c9fd9c
parentc366f422f0a68e6e440f419c506af24052159b6d
clover: Fix host access validation for sub-buffer creation

  From CL 1.2 Section 5.2.1:
    CL_INVALID_VALUE if buffer was created with CL_MEM_HOST_WRITE_ONLY and
    flags specify CL_MEM_HOST_READ_ONLY , or if buffer was created with
    CL_MEM_HOST_READ_ONLY and flags specify CL_MEM_HOST_WRITE_ONLY , or if
    buffer was created with CL_MEM_HOST_NO_ACCESS and flags specify
    CL_MEM_HOST_READ_ONLY or CL_MEM_HOST_WRITE_ONLY .

Fixes CL 1.2 CTS test/api get_buffer_info

v2: Correct host_access_flags check (Francisco)

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/api/memory.cpp