diff --git a/rafx-api/src/backends/dx12/pipeline.rs b/rafx-api/src/backends/dx12/pipeline.rs index 8c3ce858..5848ccfa 100644 --- a/rafx-api/src/backends/dx12/pipeline.rs +++ b/rafx-api/src/backends/dx12/pipeline.rs @@ -280,6 +280,7 @@ impl RafxPipelineDx12 { let mut hs_bytecode = None; let mut gs_bytecode = None; let mut ms_bytecode = None; + let mut as_bytecode = None; for stage in pipeline_def.shader.dx12_shader().unwrap().stages() { let module = stage.shader_module.dx12_shader_module().unwrap(); @@ -343,6 +344,16 @@ impl RafxPipelineDx12 { module.get_or_compile_bytecode(&stage.reflection.entry_point_name, "ms_6_5")?, ); } + + if stage + .reflection + .shader_stage + .intersects(RafxShaderStageFlags::AMPLIFICATION) + { + as_bytecode = Some( + module.get_or_compile_bytecode(&stage.reflection.entry_point_name, "as_6_5")?, + ); + } } // can leave everything zero'd out @@ -486,6 +497,8 @@ impl RafxPipelineDx12 { pipeline_stream_object.root_signature.inner = root_sig_ptr as *const d3d12::ID3D12RootSignature; + pipeline_stream_object.r#as.inner = + as_bytecode.map(|x| *x.bytecode()).unwrap_or_default(); pipeline_stream_object.ms.inner = ms_bytecode.map(|x| *x.bytecode()).unwrap_or_default(); pipeline_stream_object.ps.inner = diff --git a/rafx-api/src/backends/dx12/root_signature.rs b/rafx-api/src/backends/dx12/root_signature.rs index 80c890a1..c8576311 100644 --- a/rafx-api/src/backends/dx12/root_signature.rs +++ b/rafx-api/src/backends/dx12/root_signature.rs @@ -562,10 +562,17 @@ impl RafxRootSignatureDx12 { if !all_used_shader_stage.intersects(RafxShaderStageFlags::FRAGMENT) { root_signature_flags |= d3d12::D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS; } + + //NOTE: PIX and renderdoc will fail to debug mesh shaders if this flag is enabled + // because they rely on instrumenting the shader and writing resources. This is likely + // fixed as of ~Aug 2024 in renderdoc. But realistically these deny flags only really help + // old hardware anyways. // if !all_used_shader_stage.intersects(RafxShaderStageFlags::MESH) { // root_signature_flags |= d3d12::D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS; // } - // There are other deny flags we could use? + // if !all_used_shader_stage.intersects(RafxShaderStageFlags::AMPLIFICATION) { + // root_signature_flags |= d3d12::D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS; + // } // // Make the root signature