You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.
Currently most methods exposed by CommandList can be considered as unsafe, because no type or state checking has been perfomed.
We might save state-related issues for a better time to discuss, for now just focusing on root signature type safety.
The basic idea , inspired by similar constructs in vulkano, is that we can define a trait like RootSignature, which a safe command list can bound to. An implementation of this trait can be defined by user in compile time, exposing another limited interface for root parameter binding. At runtime, when a command list is bound to this signature, another type like RootSignatureCmdListRecording<T> would be returned, exposing type safe binding methods for it.
We should directly have macro driven, statically typed psos, since those are directly bounded to the command lists. Actually, coming to think of it, I think this might be the right way to go.
using example:
let static_sampler_desc = // describes a static sampler;
let pso_desc = pipeline_state_object!{
root_signature {
parameters {
cbv {camera, 0, 0}, // shader register c0, register space 0
constant {constants, 0, 0, 3}, // three constants},
samplers {static_sampler_desc},
},
// defaults};let pso = pso_desc.build(&mut device).unwrap();//...// at recording timeletmut cmd_list_recording = cmd_list.start(&mut cmd_alloc,Some(&pso)).unwrap();
cmd_list_recording.camera(&camera_buffer);
cmd_list_recording.constants(&[1,2,3],0);// ...
The main unresolved problems include
should we use the type system to check against unbound root parameters, which would introduce dramatically more type level boilerplate
should/how do we introduce resource level type checking
type safe shaders?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently most methods exposed by
CommandList
can be considered asunsafe
, because no type or state checking has been perfomed.We might save state-related issues for a better time to discuss, for now just focusing on root signature type safety.
The basic idea , inspired by similar constructs in
vulkano
, is that we can define a trait likeRootSignature
, which a safe command list can bound to. An implementation of this trait can be defined by user in compile time, exposing another limited interface for root parameter binding. At runtime, when a command list is bound to this signature, another type likeRootSignatureCmdListRecording<T>
would be returned, exposing type safe binding methods for it.We should directly have macro driven, statically typed psos, since those are directly bounded to the command lists. Actually, coming to think of it, I think this might be the right way to go.
using example:
The main unresolved problems include
The text was updated successfully, but these errors were encountered: