Skip to content

Accelerate textures of the GPU module #610

Description

@johguenther

The texture2d implementation of the GPU module currently re-uses the code from the CPU module, i.e., texture sampling is emulated in software. Instead, the hardware texture units should be utilized via the SYCL bindless images extension (overview blog post).

More detailed steps are:

  • Extension of the device abstraction ospray/common/DeviceRT.h to handle texture uploading, and its implementations for CPU (ISPC device as now with mem copy) and GPU (SYCL device with bindless images).
    • allocating image_mem_handle, and ext_oneapi_copy the MIP level data into it; the handle is stored in the MIP cache
    • free above (at MipMapCache::remove)
    • creating sampled_image_handle with the specific filter and wrapMode of the current Texture2D; the handle is stored in the Texture2DShared struct in data[0]
    • free above (at ~Texture2D())
  • Specialized sampling code paths via #ifdef OSPRAY_TARGET_SYCL for Texture2D_get in modules/cpu/texture/Texture2D.ispc and likely others like modules/cpu/texture/Texture2DFormats.ispc, etc.
  • later: Change of Data Arrays (at least the 2D ones) in modules/cpu/common/Data.cpp to use above abstraction; simply using textures for all basic array types including the 1D ones is appealing, it would easily lend to directly supporting primitive.color of ANARI Geometry for anari-ospray via SYCL fetch_image of unsampled images, doing format conversion in hardware;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions