[D3D12] Experimental incomplete custom sample positions, disabled by default
This commit is contained in:
@@ -31,6 +31,9 @@ CommandList::CommandList(ID3D12Device* device, ID3D12CommandQueue* queue,
|
||||
: device_(device), queue_(queue), type_(type) {}
|
||||
|
||||
CommandList::~CommandList() {
|
||||
if (command_list_1_ != nullptr) {
|
||||
command_list_1_->Release();
|
||||
}
|
||||
if (command_list_ != nullptr) {
|
||||
command_list_->Release();
|
||||
}
|
||||
@@ -52,6 +55,8 @@ bool CommandList::Initialize() {
|
||||
command_allocator_ = nullptr;
|
||||
return false;
|
||||
}
|
||||
// Optional - added in Creators Update (SDK 10.0.15063.0).
|
||||
command_list_->QueryInterface(IID_PPV_ARGS(&command_list_1_));
|
||||
// A command list is initially open, need to close it before resetting.
|
||||
command_list_->Close();
|
||||
return true;
|
||||
|
||||
@@ -27,6 +27,9 @@ class CommandList {
|
||||
D3D12_COMMAND_LIST_TYPE type);
|
||||
|
||||
ID3D12GraphicsCommandList* GetCommandList() const { return command_list_; }
|
||||
ID3D12GraphicsCommandList1* GetCommandList1() const {
|
||||
return command_list_1_;
|
||||
}
|
||||
|
||||
ID3D12GraphicsCommandList* BeginRecording();
|
||||
void AbortRecording();
|
||||
@@ -43,6 +46,7 @@ class CommandList {
|
||||
|
||||
ID3D12CommandAllocator* command_allocator_ = nullptr;
|
||||
ID3D12GraphicsCommandList* command_list_ = nullptr;
|
||||
ID3D12GraphicsCommandList1* command_list_1_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace d3d12
|
||||
|
||||
@@ -146,6 +146,18 @@ bool D3D12Provider::Initialize() {
|
||||
descriptor_size_dsv_ =
|
||||
device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_DSV);
|
||||
|
||||
// Check if programmable sample positions are supported (added in Creators
|
||||
// Update).
|
||||
programmable_sample_positions_tier_ = 0;
|
||||
D3D12_FEATURE_DATA_D3D12_OPTIONS2 options2;
|
||||
if (SUCCEEDED(device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS2,
|
||||
&options2, sizeof(options2)))) {
|
||||
programmable_sample_positions_tier_ =
|
||||
uint32_t(options2.ProgrammableSamplePositionsTier);
|
||||
}
|
||||
XELOGD3D("Direct3D 12 device supports programmable sample positions tier %u",
|
||||
programmable_sample_positions_tier_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,10 @@ class D3D12Provider : public GraphicsProvider {
|
||||
uint32_t GetDescriptorSizeRTV() const { return descriptor_size_rtv_; }
|
||||
uint32_t GetDescriptorSizeDSV() const { return descriptor_size_dsv_; }
|
||||
|
||||
uint32_t GetProgrammableSamplePositionsTier() const {
|
||||
return programmable_sample_positions_tier_;
|
||||
}
|
||||
|
||||
private:
|
||||
explicit D3D12Provider(Window* main_window);
|
||||
|
||||
@@ -52,6 +56,8 @@ class D3D12Provider : public GraphicsProvider {
|
||||
uint32_t descriptor_size_sampler_;
|
||||
uint32_t descriptor_size_rtv_;
|
||||
uint32_t descriptor_size_dsv_;
|
||||
|
||||
uint32_t programmable_sample_positions_tier_;
|
||||
};
|
||||
|
||||
} // namespace d3d12
|
||||
|
||||
Reference in New Issue
Block a user