Skip to content

Commit

Permalink
Specify aliasing and address space for vk::BufferPointer (#53)
Browse files Browse the repository at this point in the history
* Specify aliasing and address space for vk::BufferPointer

Fixes #42.

* Refer to C99 for definition of restrict pointer.

* Explicitly specify buffer pointers point into host memory address space.
  • Loading branch information
greg-lunarg authored Sep 1, 2023
1 parent 6a92f4d commit cbd3fdb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions proposals/0010-vk-buffer-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ A vk::BufferPointer can otherwise be used whereever the HLSL spec does not other

Applying HLSL semantic annotations to objects of type vk::BufferPointer is disallowed.

### Buffer Pointers and Aliasing

By default, buffer pointers are assumed to be restrict pointers as defined by the C99 standard.

An attribute vk::aliased_pointer can be attached to a variable, function parameter or a block member of buffer pointer type. It is assumed that the pointee of an object with this attribute can overlap with the pointee of any other object with this attribute.

### Buffer Pointers and Address Space

All buffer pointers are presumed to point into the host memory address space. No new address space attributes are proposed.

This comment has been minimized.

Copy link
@devshgraphicsprogramming

devshgraphicsprogramming Sep 1, 2023

isn't "host" the address space of the CPU, and "device" of the GPU?

Or does DX + HLSL use some different reverse terminology?

BDA uint64_t address AFAIK cannot be just casted into a void*

This comment has been minimized.

Copy link
@llvm-beanz

llvm-beanz Sep 5, 2023

Collaborator

Yes, host addresses are CPU virtual addresses, and the pointers cannot be casted to local address space pointers. There are no actual pointer typed elements in this data structure, just a uint64_t that gets treated as a host address.


### Buffer Pointer Availability

The following can be used at pre-processor time to determine if the current compiler supports vk::BufferPointer: __has_feature(hlsl_vk_buffer_pointer).
Expand Down

0 comments on commit cbd3fdb

Please sign in to comment.