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] Update for writability was incomplete #86

Closed
llvm-beanz opened this issue Sep 6, 2023 · 5 comments · Fixed by #106
Closed

[0010] Update for writability was incomplete #86

llvm-beanz opened this issue Sep 6, 2023 · 5 comments · Fixed by #106
Assignees
Labels
active proposal Issues relating to active proposals

Comments

@llvm-beanz
Copy link
Collaborator

llvm-beanz commented Sep 6, 2023

Which proposal does this relate to?
Proposal 0010 - vk::BufferPointer

Describe the issue or outstanding question.
The Get() method definitions are missing non-const versions.

Additional context
See comment here

@llvm-beanz llvm-beanz added the active proposal Issues relating to active proposals label Sep 6, 2023
@greg-lunarg
Copy link
Contributor

@llvm-beanz Please assign to me.

@greg-lunarg
Copy link
Contributor

greg-lunarg commented Sep 8, 2023

Here is the current spec:

template <struct S, int align>
class vk::BufferPointer {
    vk::BufferPointer(const vk::BufferPointer&);
    vk::BufferPointer& operator=(const vk::BufferPointer&);
    vk::BufferPointer(const uint64_t);
    S& Get() const;
}

Note that the const after Get() does not prevent writing of the pointee. The const here only assures that the BufferPointer itself is not changed by the Get() method.

So I contend that the current spec allows writing as well as reading of the pointee, and no change to the proposal is needed.

@llvm-beanz
Copy link
Collaborator Author

Apologies for incorrectly referencing the error. This is the incorrect line:

https://github.com/microsoft/hlsl-specs/blob/main/proposals/0010-vk-buffer-ref.md?plain=1#L71

The Get() method represents the struct const lvalue reference of the pointer to which it is applied.

The Get() method should not return a const lvalue reference (and doesn't in the code).

@greg-lunarg
Copy link
Contributor

OK. I will remove const.

@greg-lunarg
Copy link
Contributor

@llvm-beanz I believe this can now be closed. PTAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
active proposal Issues relating to active proposals
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants