diff --git a/commands/command_list.cpp b/commands/command_list.cpp index 2b63adc..2705c3d 100644 --- a/commands/command_list.cpp +++ b/commands/command_list.cpp @@ -92,12 +92,22 @@ void wrapper::directx12::graphics_command_list::set_graphics_shader_resource_vie mWrapperInstance->SetGraphicsRootShaderResourceView(index, resource->GetGPUVirtualAddress()); } +void wrapper::directx12::graphics_command_list::set_compute_shader_resource_view(uint32 index, const resource& resource) const +{ + mWrapperInstance->SetComputeRootShaderResourceView(index, resource->GetGPUVirtualAddress()); +} + void wrapper::directx12::graphics_command_list::set_graphics_constant_buffer_view(uint32 index, const buffer& resource) const { mWrapperInstance->SetGraphicsRootConstantBufferView(index, resource->GetGPUVirtualAddress()); } +void wrapper::directx12::graphics_command_list::set_compute_constant_buffer_view(uint32 index, const buffer& resource) const +{ + mWrapperInstance->SetComputeRootConstantBufferView(index, resource->GetGPUVirtualAddress()); +} + void wrapper::directx12::graphics_command_list::set_graphics_constants(uint32 index, const void* data, uint32 count, uint32 offset) const { mWrapperInstance->SetGraphicsRoot32BitConstants(index, count, data, offset); diff --git a/commands/command_list.hpp b/commands/command_list.hpp index 130e190..4206673 100644 --- a/commands/command_list.hpp +++ b/commands/command_list.hpp @@ -60,9 +60,13 @@ namespace wrapper::directx12 void set_compute_descriptor_table(uint32 index, const D3D12_GPU_DESCRIPTOR_HANDLE& base) const; void set_graphics_shader_resource_view(uint32 index, const resource& resource) const; - + + void set_compute_shader_resource_view(uint32 index, const resource& resource) const; + void set_graphics_constant_buffer_view(uint32 index, const buffer& resource) const; - + + void set_compute_constant_buffer_view(uint32 index, const buffer& resource) const; + void set_graphics_constants(uint32 index, const void* data, uint32 count, uint32 offset) const; void set_graphics_constants(uint32 index, const std::vector& values) const; diff --git a/directx12-wrapper.vcxproj b/directx12-wrapper.vcxproj index f7e8a64..39490e9 100644 --- a/directx12-wrapper.vcxproj +++ b/directx12-wrapper.vcxproj @@ -153,7 +153,7 @@ true WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - stdcpp17 + stdcpp20 true @@ -169,7 +169,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true - stdcpp17 + stdcpp20 true @@ -201,7 +201,7 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true - stdcpp17 + stdcpp20 true diff --git a/raytracings/accleration.cpp b/raytracings/accleration.cpp index 31e4c8c..c90b89c 100644 --- a/raytracings/accleration.cpp +++ b/raytracings/accleration.cpp @@ -108,7 +108,7 @@ wrapper::directx12::raytracing_acceleration wrapper::directx12::raytracing_accel acceleration.mCpuInstances = buffer::create(device, resource_info::upload(), instances_desc.size() * sizeof(D3D12_RAYTRACING_INSTANCE_DESC)); - acceleration.mGpuInstances = buffer::create(device, resource_info::common(D3D12_RESOURCE_STATE_COPY_DEST), + acceleration.mGpuInstances = buffer::create(device, resource_info::common(), instances_desc.size() * sizeof(D3D12_RAYTRACING_INSTANCE_DESC)); acceleration.mCpuInstances.copy_from_cpu(instances_desc.data(), instances_desc.size() * sizeof(D3D12_RAYTRACING_INSTANCE_DESC)); @@ -138,7 +138,7 @@ wrapper::directx12::raytracing_acceleration wrapper::directx12::raytracing_accel build_info.ResultDataMaxSizeInBytes); acceleration.mScratch = buffer::create(device, resource_info::common( - D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS), + D3D12_RESOURCE_STATE_COMMON, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS), build_info.ScratchDataSizeInBytes); D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC desc = {};