Commit Graph

68 Commits

Author SHA1 Message Date
Dunajski, Bartosz 08c2379f6e Validate region and origin for all image API calls
Change-Id: I28782d8838cf8f5d800f76c922fcb59235f637a1
2018-03-09 08:24:25 +01:00
Dunajski, Bartosz 23c1c4fea6 clEnqueueMapImage origin and region usage fixes
- Return error on origin > 0 or region > 1 when its not allowed
- For 1Darray, array region and origin are stored on 2nd position.
  For 2Darray, its on 3rd postion
- Fix map offset for 1Darray image
- Fix CPU data transfer for 1Darray image

Change-Id: Id35ba5f54f117e7af318ca7e6e03c1fc942ce729
2018-03-08 08:54:48 +01:00
Woloszyn, Wojciech 5c8cd51fc8 Use allocateGraphicsMemoryForImage for mipmaps
Change-Id: I0cd740ca4c8286fb73f766b74abc50ed53cfc9d0
2018-03-01 20:39:15 +01:00
Dunajski, Bartosz dd44a87d5f Map/unmap enqueue fixes [6/n]: Support multiple map operations
- Dont make cpu/gpu writes on read-only unmap
- Read/Write on limited map range only
- Overlaps checks for non read-only maps
- Fixed cmd type on returned event

Change-Id: I98ca542e8d369d2426a87279f86cadb0bf3db299
2018-02-23 10:45:06 +01:00
Dunajski, Bartosz b4f79e036f Map/unmap enqueue fixes [5/n]: Unify offset calculation
Change-Id: I53eafe89532d43c5cf5139ed3fac0a87619dc7a3
2018-02-21 20:12:52 +01:00
Dunajski, Bartosz e0ca78ccea Map/unmap enqueue fixes [3/n]: Map params inconsistency
- Introducing MapInfo struct which will be used as container for multiple
  map operations
- Unified mapped offset and size for Buffers and Images
- Fixed incorrect map params for CPU and GPU path
- Missing API level checks


Change-Id: Ib4077c9e2c0c333b131ffd5ccbc4a1404920eb5b
2018-02-16 08:28:29 +01:00
Dale Stimson 4e6fe62eb6 Convert FALLTHROUGH comments to C++17 [[fallthrough]] attribute
Use conditionals and a macro to avoid provoking compilers that do
not support this attribute.

Adds a macro named CPP_ATTRIBUTE_FALLTHROUGH which is invoked right
before a following case statement to declare that the intent is to
fall through.  Example:

    ...
    case xxx:
       ...
       CPP_ATTRIBUTE_FALLTHROUGH;
    case yyy:
    ...

The gcc/clang alternative of adding comments that contain "FALLTHROUGH"
suffers from the problem that *by default* ccache strips the comments
so that they are not present for the real compilation.

Change-Id: I77ddeb7dae46db8398b014a93f6a71bedc64ada9
Signed-off-by: Dale Stimson <dale.b.stimson@intel.com>
2018-02-14 07:08:00 -08:00
mplewka 94c996a452 Provide hint when create zero copy image
Change-Id: I526a81e0d14daba98574575e8c945214b0bda810
2018-02-14 12:56:04 +01:00
Dunajski, Bartosz 4f2a05ac88 Map/unmap enqueue fixes [2/n]: CPU operations on limited range
- Curently each non-zerocopy CPU operation on map/unmap make a full copy
  using hostPtr
- This commit adds functionality to select specific range of copy
- Multiple mapping with different size is not supported yet,
  so copy will be made on full range for now. This is for future usage.

Change-Id: I7652e85482ba6fffb2474169447baf9b080dcd1e
2018-02-13 16:29:01 +01:00
mplewka 21c1dce943 Enable zero copy for enqueueImage r/w with hints
Change-Id: I6d4379b4bebaca162f859ea790f6a77475f7e94e
2018-02-06 19:00:15 +01:00
Dunajski, Bartosz 844f956244 Remove redundant/recursive checks in unmap operations
- Some of the paths were made only for ULTs
- Params like mappedPtr were ignored
- Improve confusing method names
- Fix for memory leak in map shared buffer path (not tested code)

Change-Id: I8a69035f1d1c340f2d131a6f8d7e13116e3ddabc
2018-02-02 10:36:09 +01:00
Jacek Danecki 73e2e72d07 waSamplerCacheFlushBetweenRedescribedSurfaceReads fix
Change-Id: Id322f58ce6997c8710ed2d8faf4f3c3f3d2ef0c3
2018-02-01 15:37:18 +01:00
Dunajski, Bartosz 8974af4de8 SNORM formats support
Change-Id: I4138a3e96788aab2a8f3af108dcbfa6f81006bf9
2018-02-01 11:18:01 +01:00
Dale Stimson a3a21d8168 runtime/mem_obj/image.cpp - Avoid warning from switch case fallthrough
For the new Linux/Fedora configuration with introduction of gcc 7.2,
option -Wimplicit-fallthrough is implemented.  This option requests a
warning if a switch case falls through into the next case.  This was
causing build errors.

For C++17 (and g++ 7 regardless), standard attribute [[fallthrough]]
notifies the compiler that the fallthrough is intentional.
For clang++ 5 (with -std=c++11 or later) and g++ 7, built-in
preprocessor function __has_cpp_attribute(fallthrough) returns true.
Currently, msvc does not have __has_cpp_attribute.

Note: The use of __has_cpp_attribute has been proposed for c++2x and
is advocated by (81-char link broken in two to avoid 80 char hard limit):
    https://isocpp.org/std/standing-documents/
    sd-6-sg10-feature-test-recommendations

For gcc 7, a comment consisting of "FALLTHROUGH" will accomplish the
same thing with -Wimplicit-fallthrough=<n>, for n <= 4.

The diagnostic:

/opt/src/src/vpg-compute-neo/runtime/mem_obj/image.cpp:146:24: error:
this statement may fall through [-Werror=implicit-fallthrough=]
             imageDepth = imageDesc->image_depth;
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/src/src/vpg-compute-neo/runtime/mem_obj/image.cpp:148:9: note: here
         case CL_MEM_OBJECT_IMAGE2D:
         ^~~~

Change-Id: I604700a23b09c8bf22baf5614700a8b76dbe4cdd
Signed-off-by: Dale Stimson <dale.b.stimson@intel.com>
2018-01-31 12:06:30 -08:00
Mateusz Jablonski 285ecbd9cb Add method to append gen specific surface state params
Add method to check if image format has alpha channel

Change-Id: I138f766c17654917b0357b1ec2250a8489738bef
2018-01-31 17:18:41 +01:00
Dunajski, Bartosz a9a24e82e5 Prefer render compression for tiled images
Change-Id: I1ae1cf9a5cfdc54ab4d889456e252cd1f9860883
2018-01-17 15:18:47 +01:00
Dunajski, Bartosz c939419ccc preferRenderCompression flag for GMM resources creation
Change-Id: I718fa21d0feb825e0a3215408c78fa49d094a15f
2018-01-12 11:01:57 +01:00
Brandon Fliflet 7e9ad41290 Initial commit
Change-Id: I4bf1707bd3dfeadf2c17b0a7daff372b1925ebbd
2017-12-21 00:45:38 +01:00