Skip to content

Add 'require()' to interface in print.slang #301

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
5 changes: 5 additions & 0 deletions src/sgl/device/print.slang
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ interface IPrintOutput {
/// \param total_data_count The total number of data elements in all arguments.
/// \param[out] offset Offset into the output buffer. This needs to be passed to \c write_arg calls.
/// \return True if the message was written successfully, false if there was not enough space.
/// \TODO: Note that the implementation of this interface is using RWByteAddressBuffer::GetDimensions which
/// has the requirement that the Metal is not supported. Slang requires the capability requirement on the interface,
/// so we will add this requirement here to prevent Slang generating invalid code for Metal.
/// See: https://github.com/shader-slang/slangpy/issues/302
[require(cpp_cuda_glsl_hlsl_spirv_wgsl, structuredbuffer_rw)]
bool write_msg(String fmt, uint arg_count, uint total_data_count, out uint offset);

/// Write a single printable argument.
Expand Down