Adding SYCL bindless image support#612
Open
juanchuletas wants to merge 1 commit intoRenderKit:develfrom
Open
Conversation
SYCL implementation for image_mem_handle and sampled_image_handle. Kernel-side sample_mipmap pending compiler upgrade.
johguenther
requested changes
Mar 25, 2026
Contributor
johguenther
left a comment
There was a problem hiding this comment.
Looks promising!
Please use clang-format when finished to adjust to the coding style.
| sycl::float4 res = syclexp::sample_mipmap<sycl::float4>( | ||
| handle, | ||
| sycl::float2{st.x, st.y}, | ||
| 0.f); |
Contributor
There was a problem hiding this comment.
Use calcLambda(pixelFootprint, self->size, filter_nearest) for the (fractional) level.
Maybe there is also a way to use the anisotropic version of the sample_mipmap function (i.e., calculate Dx/Dy from pixelFootprint), which is cheaper, since calcLamba uses log.
| void *imgMemHandlePtr, const OSPTextureFilter filter, const vec2ui wrapMode) | ||
| { | ||
| sycl::addressing_mode addressingMode; | ||
| switch (wrapMode.x) { |
Contributor
There was a problem hiding this comment.
OSPRay supports wrapMode per dimension (x and y).
| syclexp::image_mem_handle memHandle; | ||
| syclexp::image_descriptor desc; | ||
| }; | ||
| std::unordered_map<void *, ImageMemEntry> imageMemCache; |
Contributor
There was a problem hiding this comment.
This extra cache just to remember the imgDesc seems a bit heavy. Just pass vec2i size again to createSampledImageHandle (then all information is present to locally re-create an imgDesc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the initial infrastructure for SYCL bindless image support in OSPRay's GPU module. It introduces four virtual functions in DeviceRT for managing hardware texture resources (image memory allocation and sampled image handles), implements them for the SYCL backend, and wires the calls into Texture2D::commit() after MIP generation.
The kernel-side change (replacing software sampling with sample_mipmap in Texture2D_get) is not included in this PR, as it is blocked on a DPC++ compiler upgrade.
Type of Change
Changes Made
Technical Details
Separate image_mem_handle (VRAM allocation, cached and shared across textures using the same data) from sampled_image_handle (per-texture, carries filter and wrap mode for the hardware sampler).
The image_mem_handle is stored in an imageMemCache map keyed on raw_handle for descriptor retrieval when creating the sampled handle. The sampled_image_handle is stored in Texture2DShared::data[0] for kernel access.
Testing
Screenshots / Results
Performance Impact
Related Issues
Closes #610
Checklist