Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0010] Clarify behavior of vk::aliased_pointer on vk::BufferPointer #95

Merged
merged 4 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion proposals/0010-vk-buffer-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Applying HLSL semantic annotations to objects of type vk::BufferPointer is disal

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.
An attribute vk::aliased_pointer can be attached to a variable, function parameter or a block member of BufferPointer type. It ie assumed that the pointee of a BufferPointer with this attribute can overlap with the pointee of any other BufferPointer with this attribute. This also means that the pointee of a BufferPointer with this attribute does not overlap with the pointee of a default (restrict) BufferPointer.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you introduced a typo "It ie assumed ...".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The meaning of the restrict attribute only applies to a scope.

For example the following is allowed in C:

int foo(restrict int* p) {
  return *p;
}

int func(int * p) {
  return foo(p); // implicit cast from "aliased" to "restrict".
}

The extra sentence you added is not true. An aliased pointer and restrict pointer can point to overlapping storage as long as the aliased pointer is not used during the lifetime of the restrict pointer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this PR does not necessarily address #87. I will attempt to redress that.

I am not sure I agree that my "extra" statement above is false, although perhaps underspecified. My statement above assumes that the two pointers in question have overlapping scopes. If they don't have overlapping scopes, than their overlapping memory is moot, it seems to me. But I will add that the pointers have overlapping scopes to clarify.


### Buffer Pointers and Address Space

Expand Down