DRSN is a JSON-based format used to describe render states. A DRSN file is composed of three primary sections:
- Shaders: Defines shader stages, source files, entry points, and macros.
- ResourceSignatures: Contains descriptions of pipeline resource signatures (e.g., constant buffers, samplers).
- Pipelines: Describes pipeline states (PSOs), including graphics/compute settings and links to shaders and signatures.
Important: All shader, signature, and pipeline resource names within an archive must be unique.
{
"ResourceSignatures": [
{
"Name": "Signature0",
"Resources": [
{
"Name": "Constants",
"ShaderStages": ["VERTEX", "PIXEL"],
"VarType": "DYNAMIC",
"ResourceType": "CONSTANT_BUFFER",
"Flags": ["NO_DYNAMIC_BUFFERS"]
}
],
"ImmutableSamplers": [
{
"ShaderStages": ["PIXEL"],
"SamplerOrTextureName": "LinearSampler",
"Desc": {
"BorderColor" : [1.0, 1.0, 1.0, 1.0]
}
}
]
}
],
"Shaders": [
{
"Desc": {
"Name": "My vertex shader",
"ShaderType": "VERTEX"
},
"SourceLanguage": "HLSL",
"FilePath": "VertexShader.vsh",
"EntryPoint": "VSmain",
"UseCombinedTextureSamplers": true,
"Macros": [
{"Name": "MY_MACRO_0", "Definition": "0"}
]
}
],
"Pipelines": [
{
"PSODesc": {
"Name": "My PSO 0",
"PipelineType": "GRAPHICS"
},
"GraphicsPipeline": {
"DepthStencilDesc": {
"DepthEnable": false
},
"InputLayout": {
"LayoutElements": [
{ "NumComponents": 3 },
{ "InputIndex": 1, "NumComponents": 4 }
]
},
"NumRenderTargets": 1,
"RTVFormats": { "0": "RGBA8_UNORM_SRGB" },
"RasterizerDesc": { "CullMode": "FRONT" },
"BlendDesc": {
"RenderTargets": { "0": { "BlendEnable": true } }
}
},
"ppResourceSignatures": [ "Signature0" ],
"pVS": "My vertex shader",
"pPS": "My pixel shader"
}
]
}