Misc: clang-cl warning clean-up
This commit is contained in:
@ -144,6 +144,12 @@ public:
|
||||
BitField<u8, bool, 6, 1> data;
|
||||
BitField<u8, bool, 7, 1> four_channel_audio;
|
||||
|
||||
Control() = default;
|
||||
|
||||
Control(u8 bits_) : bits(bits_) {}
|
||||
|
||||
Control(const Control& rhs) : bits(rhs.bits) {}
|
||||
|
||||
Control& operator=(const Control& rhs)
|
||||
{
|
||||
bits = rhs.bits;
|
||||
@ -170,11 +176,15 @@ public:
|
||||
|
||||
static u16 ComputeCRC(const Data& data);
|
||||
|
||||
Control GetControl() const { return Control{control_bits}; }
|
||||
Control GetControl() const { return Control(control_bits); }
|
||||
bool IsData() const { return GetControl().data; }
|
||||
|
||||
bool IsCRCValid() const;
|
||||
|
||||
SubChannelQ() = default;
|
||||
|
||||
SubChannelQ(const SubChannelQ& q) : data(q.data) {}
|
||||
|
||||
SubChannelQ& operator=(const SubChannelQ& q)
|
||||
{
|
||||
data = q.data;
|
||||
@ -233,42 +243,15 @@ public:
|
||||
ProgressCallback* progress = ProgressCallback::NullProgressCallback);
|
||||
|
||||
// Accessors.
|
||||
const std::string& GetFileName() const
|
||||
{
|
||||
return m_filename;
|
||||
}
|
||||
LBA GetPositionOnDisc() const
|
||||
{
|
||||
return m_position_on_disc;
|
||||
}
|
||||
Position GetMSFPositionOnDisc() const
|
||||
{
|
||||
return Position::FromLBA(m_position_on_disc);
|
||||
}
|
||||
LBA GetPositionInTrack() const
|
||||
{
|
||||
return m_position_in_track;
|
||||
}
|
||||
Position GetMSFPositionInTrack() const
|
||||
{
|
||||
return Position::FromLBA(m_position_in_track);
|
||||
}
|
||||
LBA GetLBACount() const
|
||||
{
|
||||
return m_lba_count;
|
||||
}
|
||||
u32 GetIndexNumber() const
|
||||
{
|
||||
return m_current_index->index_number;
|
||||
}
|
||||
u32 GetTrackNumber() const
|
||||
{
|
||||
return m_current_index->track_number;
|
||||
}
|
||||
u32 GetTrackCount() const
|
||||
{
|
||||
return static_cast<u32>(m_tracks.size());
|
||||
}
|
||||
const std::string& GetFileName() const { return m_filename; }
|
||||
LBA GetPositionOnDisc() const { return m_position_on_disc; }
|
||||
Position GetMSFPositionOnDisc() const { return Position::FromLBA(m_position_on_disc); }
|
||||
LBA GetPositionInTrack() const { return m_position_in_track; }
|
||||
Position GetMSFPositionInTrack() const { return Position::FromLBA(m_position_in_track); }
|
||||
LBA GetLBACount() const { return m_lba_count; }
|
||||
u32 GetIndexNumber() const { return m_current_index->index_number; }
|
||||
u32 GetTrackNumber() const { return m_current_index->track_number; }
|
||||
u32 GetTrackCount() const { return static_cast<u32>(m_tracks.size()); }
|
||||
LBA GetTrackStartPosition(u8 track) const;
|
||||
Position GetTrackStartMSFPosition(u8 track) const;
|
||||
LBA GetTrackLength(u8 track) const;
|
||||
@ -276,26 +259,11 @@ public:
|
||||
TrackMode GetTrackMode(u8 track) const;
|
||||
LBA GetTrackIndexPosition(u8 track, u8 index) const;
|
||||
LBA GetTrackIndexLength(u8 track, u8 index) const;
|
||||
u32 GetFirstTrackNumber() const
|
||||
{
|
||||
return m_tracks.front().track_number;
|
||||
}
|
||||
u32 GetLastTrackNumber() const
|
||||
{
|
||||
return m_tracks.back().track_number;
|
||||
}
|
||||
u32 GetIndexCount() const
|
||||
{
|
||||
return static_cast<u32>(m_indices.size());
|
||||
}
|
||||
const std::vector<Track>& GetTracks() const
|
||||
{
|
||||
return m_tracks;
|
||||
}
|
||||
const std::vector<Index>& GetIndices() const
|
||||
{
|
||||
return m_indices;
|
||||
}
|
||||
u32 GetFirstTrackNumber() const { return m_tracks.front().track_number; }
|
||||
u32 GetLastTrackNumber() const { return m_tracks.back().track_number; }
|
||||
u32 GetIndexCount() const { return static_cast<u32>(m_indices.size()); }
|
||||
const std::vector<Track>& GetTracks() const { return m_tracks; }
|
||||
const std::vector<Index>& GetIndices() const { return m_indices; }
|
||||
const Track& GetTrack(u32 track) const;
|
||||
const Index& GetIndex(u32 i) const;
|
||||
|
||||
|
||||
@ -135,8 +135,8 @@ bool CDImageDeviceWin32::Open(const char* filename, Error* error)
|
||||
}
|
||||
|
||||
// Set it to 4x speed. A good balance between readahead and spinning up way too high.
|
||||
static constexpr u32 READ_SPEED_MULTIPLIER = 4;
|
||||
static constexpr u32 READ_SPEED_KBS = (DATA_SECTOR_SIZE * FRAMES_PER_SECOND * 8) / 1024;
|
||||
static constexpr u32 READ_SPEED_MULTIPLIER = 8;
|
||||
static constexpr u32 READ_SPEED_KBS = (DATA_SECTOR_SIZE * FRAMES_PER_SECOND * READ_SPEED_MULTIPLIER) / 1024;
|
||||
CDROM_SET_SPEED set_speed = {CdromSetSpeed, READ_SPEED_KBS, 0, CdromDefaultRotation};
|
||||
if (!DeviceIoControl(m_hDevice, IOCTL_CDROM_SET_SPEED, &set_speed, sizeof(set_speed), nullptr, 0, nullptr, nullptr))
|
||||
Log_WarningPrintf("DeviceIoControl(IOCTL_CDROM_SET_SPEED) failed: %08X", GetLastError());
|
||||
|
||||
@ -33,7 +33,7 @@ void SetD3DDebugObjectName(ID3D11DeviceChild* obj, const std::string_view& name)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
// WKPDID_D3DDebugObjectName
|
||||
static constexpr GUID guid = {0x429b8c22, 0x9188, 0x4b0c, 0x87, 0x42, 0xac, 0xb0, 0xbf, 0x85, 0xc2, 0x00};
|
||||
static constexpr GUID guid = {0x429b8c22, 0x9188, 0x4b0c, {0x87, 0x42, 0xac, 0xb0, 0xbf, 0x85, 0xc2, 0x00}};
|
||||
|
||||
UINT existing_data_size;
|
||||
HRESULT hr = obj->GetPrivateData(guid, &existing_data_size, nullptr);
|
||||
@ -581,7 +581,7 @@ bool D3D11Device::BeginPresent(bool skip_present)
|
||||
{
|
||||
if (skip_present)
|
||||
return false;
|
||||
|
||||
|
||||
if (!m_swap_chain)
|
||||
{
|
||||
// Note: Really slow on Intel...
|
||||
|
||||
@ -82,10 +82,11 @@ std::unique_ptr<GPUShader> D3D11Device::CreateShaderFromBinary(GPUShaderStage st
|
||||
|
||||
default:
|
||||
UnreachableCode();
|
||||
hr = S_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!shader)
|
||||
if (FAILED(hr) || !shader)
|
||||
return {};
|
||||
|
||||
return std::unique_ptr<GPUShader>(new D3D11Shader(stage, std::move(shader), std::move(bytecode)));
|
||||
|
||||
@ -16,7 +16,7 @@ bool D3D12DescriptorHeapManager::Create(ID3D12Device* device, D3D12_DESCRIPTOR_H
|
||||
{
|
||||
D3D12_DESCRIPTOR_HEAP_DESC desc = {type, static_cast<UINT>(num_descriptors),
|
||||
shader_visible ? D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE :
|
||||
D3D12_DESCRIPTOR_HEAP_FLAG_NONE};
|
||||
D3D12_DESCRIPTOR_HEAP_FLAG_NONE, 0u};
|
||||
|
||||
HRESULT hr = device->CreateDescriptorHeap(&desc, IID_PPV_ARGS(m_descriptor_heap.ReleaseAndGetAddressOf()));
|
||||
if (FAILED(hr))
|
||||
@ -44,10 +44,12 @@ bool D3D12DescriptorHeapManager::Create(ID3D12Device* device, D3D12_DESCRIPTOR_H
|
||||
|
||||
void D3D12DescriptorHeapManager::Destroy()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
for (BitSetType& bs : m_free_slots)
|
||||
{
|
||||
DebugAssert(bs.all());
|
||||
}
|
||||
#endif
|
||||
|
||||
m_shader_visible = false;
|
||||
m_num_descriptors = 0;
|
||||
@ -111,7 +113,7 @@ D3D12DescriptorAllocator::~D3D12DescriptorAllocator() = default;
|
||||
bool D3D12DescriptorAllocator::Create(ID3D12Device* device, D3D12_DESCRIPTOR_HEAP_TYPE type, u32 num_descriptors)
|
||||
{
|
||||
const D3D12_DESCRIPTOR_HEAP_DESC desc = {type, static_cast<UINT>(num_descriptors),
|
||||
D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE};
|
||||
D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, 0u};
|
||||
const HRESULT hr = device->CreateDescriptorHeap(&desc, IID_PPV_ARGS(m_descriptor_heap.ReleaseAndGetAddressOf()));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
||||
@ -58,7 +58,7 @@ enum : u32
|
||||
// We need to synchronize instance creation because of adapter enumeration from the UI thread.
|
||||
static std::mutex s_instance_mutex;
|
||||
|
||||
static constexpr D3D12_CLEAR_VALUE s_present_clear_color = {DXGI_FORMAT_R8G8B8A8_UNORM, {0.0f, 0.0f, 0.0f, 1.0f}};
|
||||
static constexpr D3D12_CLEAR_VALUE s_present_clear_color = {DXGI_FORMAT_R8G8B8A8_UNORM, {{0.0f, 0.0f, 0.0f, 1.0f}}};
|
||||
static constexpr GPUTexture::Format s_swap_chain_format = GPUTexture::Format::RGBA8;
|
||||
|
||||
// We just need to keep this alive, never reference it.
|
||||
@ -82,19 +82,6 @@ D3D12Device::~D3D12Device()
|
||||
Assert(s_pipeline_cache_data.empty());
|
||||
}
|
||||
|
||||
static constexpr u32 GetActiveTexturesForLayout(GPUPipeline::Layout layout)
|
||||
{
|
||||
constexpr std::array<u8, static_cast<u8>(GPUPipeline::Layout::MaxCount)> counts = {
|
||||
1, // SingleTextureAndUBO
|
||||
1, // SingleTextureAndPushConstants
|
||||
0, // SingleTextureBufferAndPushConstants
|
||||
GPUDevice::MAX_TEXTURE_SAMPLERS, // MultiTextureAndUBO
|
||||
GPUDevice::MAX_TEXTURE_SAMPLERS, // MultiTextureAndPushConstants
|
||||
};
|
||||
|
||||
return counts[static_cast<u8>(layout)];
|
||||
}
|
||||
|
||||
D3D12Device::ComPtr<ID3DBlob> D3D12Device::SerializeRootSignature(const D3D12_ROOT_SIGNATURE_DESC* desc)
|
||||
{
|
||||
ComPtr<ID3DBlob> blob;
|
||||
@ -202,7 +189,7 @@ bool D3D12Device::CreateDevice(const std::string_view& adapter, bool threaded_pr
|
||||
}
|
||||
|
||||
const D3D12_COMMAND_QUEUE_DESC queue_desc = {D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_NORMAL,
|
||||
D3D12_COMMAND_QUEUE_FLAG_NONE};
|
||||
D3D12_COMMAND_QUEUE_FLAG_NONE, 0u};
|
||||
hr = m_device->CreateCommandQueue(&queue_desc, IID_PPV_ARGS(&m_command_queue));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
@ -468,8 +455,8 @@ bool D3D12Device::CreateDescriptorHeaps()
|
||||
}
|
||||
|
||||
// Allocate null SRV descriptor for unbound textures.
|
||||
constexpr D3D12_SHADER_RESOURCE_VIEW_DESC null_srv_desc = {DXGI_FORMAT_R8G8B8A8_UNORM, D3D12_SRV_DIMENSION_TEXTURE2D,
|
||||
D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING};
|
||||
static constexpr D3D12_SHADER_RESOURCE_VIEW_DESC null_srv_desc = {
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM, D3D12_SRV_DIMENSION_TEXTURE2D, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, {}};
|
||||
|
||||
if (!m_descriptor_heap_manager.Allocate(&m_null_srv_descriptor))
|
||||
{
|
||||
@ -629,7 +616,7 @@ bool D3D12Device::CreateTimestampQuery()
|
||||
constexpr u32 QUERY_COUNT = NUM_TIMESTAMP_QUERIES_PER_CMDLIST * NUM_COMMAND_LISTS;
|
||||
constexpr u32 BUFFER_SIZE = sizeof(u64) * QUERY_COUNT;
|
||||
|
||||
const D3D12_QUERY_HEAP_DESC desc = {D3D12_QUERY_HEAP_TYPE_TIMESTAMP, QUERY_COUNT};
|
||||
const D3D12_QUERY_HEAP_DESC desc = {D3D12_QUERY_HEAP_TYPE_TIMESTAMP, QUERY_COUNT, 0u};
|
||||
HRESULT hr = m_device->CreateQueryHeap(&desc, IID_PPV_ARGS(m_timestamp_query_heap.GetAddressOf()));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
@ -638,7 +625,8 @@ bool D3D12Device::CreateTimestampQuery()
|
||||
return false;
|
||||
}
|
||||
|
||||
const D3D12MA::ALLOCATION_DESC allocation_desc = {D3D12MA::ALLOCATION_FLAG_NONE, D3D12_HEAP_TYPE_READBACK};
|
||||
const D3D12MA::ALLOCATION_DESC allocation_desc = {D3D12MA::ALLOCATION_FLAG_NONE, D3D12_HEAP_TYPE_READBACK,
|
||||
D3D12_HEAP_FLAG_NONE, nullptr, nullptr};
|
||||
const D3D12_RESOURCE_DESC resource_desc = {D3D12_RESOURCE_DIMENSION_BUFFER,
|
||||
0,
|
||||
BUFFER_SIZE,
|
||||
@ -878,7 +866,7 @@ bool D3D12Device::CreateSwapChainRTV()
|
||||
if (FAILED(hr))
|
||||
return false;
|
||||
|
||||
const D3D12_RENDER_TARGET_VIEW_DESC rtv_desc = {swap_chain_desc.BufferDesc.Format, D3D12_RTV_DIMENSION_TEXTURE2D};
|
||||
const D3D12_RENDER_TARGET_VIEW_DESC rtv_desc = {swap_chain_desc.BufferDesc.Format, D3D12_RTV_DIMENSION_TEXTURE2D, {}};
|
||||
|
||||
for (u32 i = 0; i < swap_chain_desc.BufferCount; i++)
|
||||
{
|
||||
@ -1038,7 +1026,7 @@ bool D3D12Device::SupportsTextureFormat(GPUTexture::Format format) const
|
||||
if (dfmt == DXGI_FORMAT_UNKNOWN)
|
||||
return false;
|
||||
|
||||
D3D12_FEATURE_DATA_FORMAT_SUPPORT support = {dfmt};
|
||||
D3D12_FEATURE_DATA_FORMAT_SUPPORT support = {dfmt, {}, {}};
|
||||
return SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &support, sizeof(support))) &&
|
||||
(support.Support1 & required) == required;
|
||||
}
|
||||
@ -1189,7 +1177,8 @@ void D3D12Device::SetFeatures()
|
||||
m_max_multisamples = 1;
|
||||
for (u32 multisamples = 2; multisamples < D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT; multisamples++)
|
||||
{
|
||||
D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS fd = {DXGI_FORMAT_R8G8B8A8_UNORM, static_cast<UINT>(multisamples)};
|
||||
D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS fd = {DXGI_FORMAT_R8G8B8A8_UNORM, static_cast<UINT>(multisamples),
|
||||
D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE, 0u};
|
||||
|
||||
if (SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &fd, sizeof(fd))) &&
|
||||
fd.NumQualityLevels > 0)
|
||||
@ -1660,8 +1649,8 @@ void D3D12Device::BeginRenderPass()
|
||||
// Re-rendering to swap chain.
|
||||
const auto& swap_chain_buf = m_swap_chain_buffers[m_current_swap_chain_buffer];
|
||||
rt_desc = {swap_chain_buf.second,
|
||||
{D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE},
|
||||
{D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE}};
|
||||
{D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE, {}},
|
||||
{D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE, {}}};
|
||||
rt_desc_p = &rt_desc;
|
||||
}
|
||||
|
||||
@ -1705,7 +1694,7 @@ void D3D12Device::BeginSwapChainRenderPass()
|
||||
const D3D12_RENDER_PASS_RENDER_TARGET_DESC rt_desc = {
|
||||
swap_chain_buf.second,
|
||||
{D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR, {s_present_clear_color}},
|
||||
{D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE}};
|
||||
{D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE, {}}};
|
||||
cmdlist->BeginRenderPass(1, &rt_desc, nullptr, D3D12_RENDER_PASS_FLAG_NONE);
|
||||
|
||||
m_current_framebuffer = nullptr;
|
||||
@ -1875,8 +1864,6 @@ void D3D12Device::SetScissor(ID3D12GraphicsCommandList4* cmdlist)
|
||||
|
||||
void D3D12Device::SetTextureSampler(u32 slot, GPUTexture* texture, GPUSampler* sampler)
|
||||
{
|
||||
D3D12DescriptorHandle null_handle;
|
||||
|
||||
D3D12Texture* T = static_cast<D3D12Texture*>(texture);
|
||||
if (m_current_textures[slot] != T)
|
||||
{
|
||||
@ -1984,7 +1971,7 @@ void D3D12Device::PreDrawCheck()
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (dirty & DIRTY_FLAG_CONSTANT_BUFFER | DIRTY_FLAG_TEXTURES | DIRTY_FLAG_SAMPLERS)
|
||||
else if (dirty & (DIRTY_FLAG_CONSTANT_BUFFER | DIRTY_FLAG_TEXTURES | DIRTY_FLAG_SAMPLERS))
|
||||
{
|
||||
if (!UpdateRootParameters(dirty))
|
||||
{
|
||||
|
||||
@ -15,8 +15,6 @@
|
||||
|
||||
Log_SetChannel(D3D12Device);
|
||||
|
||||
static u32 s_next_bad_shader_id = 1;
|
||||
|
||||
D3D12Shader::D3D12Shader(GPUShaderStage stage, Bytecode bytecode) : GPUShader(stage), m_bytecode(std::move(bytecode))
|
||||
{
|
||||
}
|
||||
|
||||
@ -160,16 +160,17 @@ std::unique_ptr<GPUTexture> D3D12Device::CreateTexture(u32 width, u32 height, u3
|
||||
break;
|
||||
}
|
||||
|
||||
if (uav_format != DXGI_FORMAT_UNKNOWN && !CreateUAVDescriptor(resource.Get(), samples, fm.dsv_format, &uav_descriptor))
|
||||
if (uav_format != DXGI_FORMAT_UNKNOWN &&
|
||||
!CreateUAVDescriptor(resource.Get(), samples, fm.dsv_format, &uav_descriptor))
|
||||
{
|
||||
m_descriptor_heap_manager.Free(&write_descriptor);
|
||||
m_descriptor_heap_manager.Free(&srv_descriptor);
|
||||
return {};
|
||||
}
|
||||
|
||||
std::unique_ptr<D3D12Texture> tex(new D3D12Texture(width, height, layers, levels, samples, type, format, fm.resource_format,
|
||||
std::move(resource), std::move(allocation), srv_descriptor,
|
||||
write_descriptor, uav_descriptor, write_descriptor_type, state));
|
||||
std::unique_ptr<D3D12Texture> tex(new D3D12Texture(
|
||||
width, height, layers, levels, samples, type, format, fm.resource_format, std::move(resource),
|
||||
std::move(allocation), srv_descriptor, write_descriptor, uav_descriptor, write_descriptor_type, state));
|
||||
|
||||
if (data)
|
||||
{
|
||||
@ -203,7 +204,7 @@ bool D3D12Device::CreateSRVDescriptor(ID3D12Resource* resource, u32 layers, u32
|
||||
else
|
||||
{
|
||||
desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2DARRAY;
|
||||
desc.Texture2DArray = {0u, levels, 0u, layers};
|
||||
desc.Texture2DArray = {0u, levels, 0u, layers, 0u, 0.0f};
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -215,7 +216,7 @@ bool D3D12Device::CreateSRVDescriptor(ID3D12Resource* resource, u32 layers, u32
|
||||
else
|
||||
{
|
||||
desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
|
||||
desc.Texture2D = {0u, levels};
|
||||
desc.Texture2D = {0u, levels, 0u, 0.0f};
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,7 +234,7 @@ bool D3D12Device::CreateRTVDescriptor(ID3D12Resource* resource, u32 samples, DXG
|
||||
}
|
||||
|
||||
const D3D12_RENDER_TARGET_VIEW_DESC desc = {format, (samples > 1) ? D3D12_RTV_DIMENSION_TEXTURE2DMS :
|
||||
D3D12_RTV_DIMENSION_TEXTURE2D};
|
||||
D3D12_RTV_DIMENSION_TEXTURE2D, {} };
|
||||
m_device->CreateRenderTargetView(resource, &desc, dh->cpu_handle);
|
||||
return true;
|
||||
}
|
||||
@ -248,7 +249,7 @@ bool D3D12Device::CreateDSVDescriptor(ID3D12Resource* resource, u32 samples, DXG
|
||||
}
|
||||
|
||||
const D3D12_DEPTH_STENCIL_VIEW_DESC desc = {
|
||||
format, (samples > 1) ? D3D12_DSV_DIMENSION_TEXTURE2DMS : D3D12_DSV_DIMENSION_TEXTURE2D, D3D12_DSV_FLAG_NONE};
|
||||
format, (samples > 1) ? D3D12_DSV_DIMENSION_TEXTURE2DMS : D3D12_DSV_DIMENSION_TEXTURE2D, D3D12_DSV_FLAG_NONE, {} };
|
||||
m_device->CreateDepthStencilView(resource, &desc, dh->cpu_handle);
|
||||
return true;
|
||||
}
|
||||
@ -263,7 +264,7 @@ bool D3D12Device::CreateUAVDescriptor(ID3D12Resource* resource, u32 samples, DXG
|
||||
}
|
||||
|
||||
DebugAssert(samples == 1);
|
||||
const D3D12_UNORDERED_ACCESS_VIEW_DESC desc = {format, D3D12_UAV_DIMENSION_TEXTURE2D};
|
||||
const D3D12_UNORDERED_ACCESS_VIEW_DESC desc = { format, D3D12_UAV_DIMENSION_TEXTURE2D, {} };
|
||||
m_device->CreateUnorderedAccessView(resource, nullptr, &desc, dh->cpu_handle);
|
||||
return true;
|
||||
}
|
||||
@ -348,7 +349,8 @@ ID3D12Resource* D3D12Texture::AllocateUploadStagingBuffer(const void* data, u32
|
||||
ComPtr<ID3D12Resource> resource;
|
||||
ComPtr<D3D12MA::Allocation> allocation;
|
||||
|
||||
const D3D12MA::ALLOCATION_DESC allocation_desc = {D3D12MA::ALLOCATION_FLAG_NONE, D3D12_HEAP_TYPE_UPLOAD};
|
||||
const D3D12MA::ALLOCATION_DESC allocation_desc = {D3D12MA::ALLOCATION_FLAG_NONE, D3D12_HEAP_TYPE_UPLOAD,
|
||||
D3D12_HEAP_FLAG_NONE, nullptr, nullptr};
|
||||
const D3D12_RESOURCE_DESC resource_desc = {
|
||||
D3D12_RESOURCE_DIMENSION_BUFFER, 0, size, 1, 1, 1, DXGI_FORMAT_UNKNOWN, {1, 0}, D3D12_TEXTURE_LAYOUT_ROW_MAJOR,
|
||||
D3D12_RESOURCE_FLAG_NONE};
|
||||
@ -901,8 +903,10 @@ bool D3D12TextureBuffer::Create(D3D12Device& dev)
|
||||
if (!dev.GetDescriptorHeapManager().Allocate(&m_descriptor))
|
||||
return {};
|
||||
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC desc = {format_mapping[static_cast<u8>(m_format)], D3D12_SRV_DIMENSION_BUFFER,
|
||||
D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING};
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC desc = {format_mapping[static_cast<u8>(m_format)],
|
||||
D3D12_SRV_DIMENSION_BUFFER,
|
||||
D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING,
|
||||
{}};
|
||||
desc.Buffer.NumElements = m_size_in_elements;
|
||||
dev.GetDevice()->CreateShaderResourceView(m_buffer.GetBuffer(), &desc, m_descriptor);
|
||||
return true;
|
||||
|
||||
@ -415,7 +415,7 @@ std::optional<DynamicHeapArray<u8>> D3DCommon::CompileShader(D3D_FEATURE_LEVEL f
|
||||
if (fp)
|
||||
{
|
||||
std::fwrite(source.data(), source.size(), 1, fp.get());
|
||||
std::fprintf(fp.get(), "\n\nCompile as %s failed: %08X\n", target, hr);
|
||||
std::fprintf(fp.get(), "\n\nCompile as %s failed: %08X\n", target, static_cast<unsigned>(hr));
|
||||
std::fwrite(error_string.c_str(), error_string.size(), 1, fp.get());
|
||||
}
|
||||
|
||||
|
||||
@ -287,7 +287,8 @@ std::vector<std::pair<std::string, std::string>> DInputSource::EnumerateDevices(
|
||||
std::vector<std::pair<std::string, std::string>> ret;
|
||||
for (size_t i = 0; i < m_controllers.size(); i++)
|
||||
{
|
||||
DIDEVICEINSTANCEW dii = {sizeof(DIDEVICEINSTANCEW)};
|
||||
DIDEVICEINSTANCEW dii;
|
||||
dii.dwSize = sizeof(DIDEVICEINSTANCEW);
|
||||
std::string name;
|
||||
if (SUCCEEDED(m_controllers[i].device->GetDeviceInfo(&dii)))
|
||||
name = StringUtil::WideStringToUTF8String(dii.tszProductName);
|
||||
|
||||
@ -10,6 +10,10 @@
|
||||
|
||||
Log_SetChannel(GL::ContextWGL);
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic ignored "-Wmicrosoft-cast"
|
||||
#endif
|
||||
|
||||
static void* GetProcAddressCallback(const char* name)
|
||||
{
|
||||
void* addr = wglGetProcAddress(name);
|
||||
|
||||
@ -109,7 +109,7 @@ bool GPUPipeline::InputLayout::operator==(const InputLayout& rhs) const
|
||||
bool GPUPipeline::InputLayout::operator!=(const InputLayout& rhs) const
|
||||
{
|
||||
return (vertex_stride != rhs.vertex_stride ||
|
||||
vertex_attributes.size() != rhs.vertex_attributes.size() &&
|
||||
vertex_attributes.size() != rhs.vertex_attributes.size() ||
|
||||
std::memcmp(vertex_attributes.data(), rhs.vertex_attributes.data(),
|
||||
sizeof(VertexAttribute) * rhs.vertex_attributes.size()) != 0);
|
||||
}
|
||||
|
||||
@ -207,6 +207,8 @@ public:
|
||||
u32 key;
|
||||
|
||||
// clang-format off
|
||||
ALWAYS_INLINE VertexAttribute() = default;
|
||||
ALWAYS_INLINE constexpr VertexAttribute(const VertexAttribute& rhs) : key(rhs.key) {}
|
||||
ALWAYS_INLINE VertexAttribute& operator=(const VertexAttribute& rhs) { key = rhs.key; return *this; }
|
||||
ALWAYS_INLINE bool operator==(const VertexAttribute& rhs) const { return key == rhs.key; }
|
||||
ALWAYS_INLINE bool operator!=(const VertexAttribute& rhs) const { return key != rhs.key; }
|
||||
@ -217,11 +219,14 @@ public:
|
||||
u16 offset)
|
||||
{
|
||||
// Nasty :/ can't access an inactive element of a union here..
|
||||
return VertexAttribute{{(static_cast<u32>(index) & 0xf) | ((static_cast<u32>(semantic) & 0x3) << 4) |
|
||||
((static_cast<u32>(semantic_index) & 0x3) << 6) | ((static_cast<u32>(type) & 0xf) << 8) |
|
||||
((static_cast<u32>(components) & 0x7) << 12) |
|
||||
((static_cast<u32>(offset) & 0xffff) << 16)}};
|
||||
return VertexAttribute((static_cast<u32>(index) & 0xf) | ((static_cast<u32>(semantic) & 0x3) << 4) |
|
||||
((static_cast<u32>(semantic_index) & 0x3) << 6) | ((static_cast<u32>(type) & 0xf) << 8) |
|
||||
((static_cast<u32>(components) & 0x7) << 12) |
|
||||
((static_cast<u32>(offset) & 0xffff) << 16));
|
||||
}
|
||||
|
||||
private:
|
||||
ALWAYS_INLINE constexpr VertexAttribute(u32 key_) : key(key_) {}
|
||||
};
|
||||
|
||||
struct InputLayout
|
||||
@ -298,6 +303,8 @@ public:
|
||||
u8 key;
|
||||
|
||||
// clang-format off
|
||||
ALWAYS_INLINE RasterizationState() = default;
|
||||
ALWAYS_INLINE RasterizationState(const RasterizationState& rhs) : key(rhs.key) {}
|
||||
ALWAYS_INLINE RasterizationState& operator=(const RasterizationState& rhs) { key = rhs.key; return *this; }
|
||||
ALWAYS_INLINE bool operator==(const RasterizationState& rhs) const { return key == rhs.key; }
|
||||
ALWAYS_INLINE bool operator!=(const RasterizationState& rhs) const { return key != rhs.key; }
|
||||
@ -314,6 +321,8 @@ public:
|
||||
u8 key;
|
||||
|
||||
// clang-format off
|
||||
ALWAYS_INLINE DepthState() = default;
|
||||
ALWAYS_INLINE DepthState(const DepthState& rhs) : key(rhs.key) {}
|
||||
ALWAYS_INLINE DepthState& operator=(const DepthState& rhs) { key = rhs.key; return *this; }
|
||||
ALWAYS_INLINE bool operator==(const DepthState& rhs) const { return key == rhs.key; }
|
||||
ALWAYS_INLINE bool operator!=(const DepthState& rhs) const { return key != rhs.key; }
|
||||
@ -342,6 +351,8 @@ public:
|
||||
u64 key;
|
||||
|
||||
// clang-format off
|
||||
ALWAYS_INLINE BlendState() = default;
|
||||
ALWAYS_INLINE BlendState(const BlendState& rhs) : key(rhs.key) {}
|
||||
ALWAYS_INLINE BlendState& operator=(const BlendState& rhs) { key = rhs.key; return *this; }
|
||||
ALWAYS_INLINE bool operator==(const BlendState& rhs) const { return key == rhs.key; }
|
||||
ALWAYS_INLINE bool operator!=(const BlendState& rhs) const { return key != rhs.key; }
|
||||
@ -486,7 +497,7 @@ public:
|
||||
|
||||
return counts[static_cast<u8>(layout)];
|
||||
}
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
// We have to define these in the base class, because they're in Objective C++.
|
||||
static std::unique_ptr<GPUDevice> WrapNewMetalDevice();
|
||||
|
||||
@ -315,110 +315,110 @@ void ImGuiManager::SetKeyMap()
|
||||
const char* alt_name;
|
||||
};
|
||||
|
||||
static constexpr KeyMapping mapping[] = {{ImGuiKey_LeftArrow, "Left"},
|
||||
{ImGuiKey_RightArrow, "Right"},
|
||||
{ImGuiKey_UpArrow, "Up"},
|
||||
{ImGuiKey_DownArrow, "Down"},
|
||||
{ImGuiKey_PageUp, "PageUp"},
|
||||
{ImGuiKey_PageDown, "PageDown"},
|
||||
{ImGuiKey_Home, "Home"},
|
||||
{ImGuiKey_End, "End"},
|
||||
{ImGuiKey_Insert, "Insert"},
|
||||
{ImGuiKey_Delete, "Delete"},
|
||||
{ImGuiKey_Backspace, "Backspace"},
|
||||
{ImGuiKey_Space, "Space"},
|
||||
{ImGuiKey_Enter, "Return"},
|
||||
{ImGuiKey_Escape, "Escape"},
|
||||
static constexpr KeyMapping mapping[] = {{ImGuiKey_LeftArrow, "Left", nullptr},
|
||||
{ImGuiKey_RightArrow, "Right", nullptr},
|
||||
{ImGuiKey_UpArrow, "Up", nullptr},
|
||||
{ImGuiKey_DownArrow, "Down", nullptr},
|
||||
{ImGuiKey_PageUp, "PageUp", nullptr},
|
||||
{ImGuiKey_PageDown, "PageDown", nullptr},
|
||||
{ImGuiKey_Home, "Home", nullptr},
|
||||
{ImGuiKey_End, "End", nullptr},
|
||||
{ImGuiKey_Insert, "Insert", nullptr},
|
||||
{ImGuiKey_Delete, "Delete", nullptr},
|
||||
{ImGuiKey_Backspace, "Backspace", nullptr},
|
||||
{ImGuiKey_Space, "Space", nullptr},
|
||||
{ImGuiKey_Enter, "Return", nullptr},
|
||||
{ImGuiKey_Escape, "Escape", nullptr},
|
||||
{ImGuiKey_LeftCtrl, "LeftCtrl", "Ctrl"},
|
||||
{ImGuiKey_LeftShift, "LeftShift", "Shift"},
|
||||
{ImGuiKey_LeftAlt, "LeftAlt", "Alt"},
|
||||
{ImGuiKey_LeftSuper, "LeftSuper", "Super"},
|
||||
{ImGuiKey_RightCtrl, "RightCtrl"},
|
||||
{ImGuiKey_RightShift, "RightShift"},
|
||||
{ImGuiKey_RightAlt, "RightAlt"},
|
||||
{ImGuiKey_RightSuper, "RightSuper"},
|
||||
{ImGuiKey_Menu, "Menu"},
|
||||
{ImGuiKey_0, "0"},
|
||||
{ImGuiKey_1, "1"},
|
||||
{ImGuiKey_2, "2"},
|
||||
{ImGuiKey_3, "3"},
|
||||
{ImGuiKey_4, "4"},
|
||||
{ImGuiKey_5, "5"},
|
||||
{ImGuiKey_6, "6"},
|
||||
{ImGuiKey_7, "7"},
|
||||
{ImGuiKey_8, "8"},
|
||||
{ImGuiKey_9, "9"},
|
||||
{ImGuiKey_A, "A"},
|
||||
{ImGuiKey_B, "B"},
|
||||
{ImGuiKey_C, "C"},
|
||||
{ImGuiKey_D, "D"},
|
||||
{ImGuiKey_E, "E"},
|
||||
{ImGuiKey_F, "F"},
|
||||
{ImGuiKey_G, "G"},
|
||||
{ImGuiKey_H, "H"},
|
||||
{ImGuiKey_I, "I"},
|
||||
{ImGuiKey_J, "J"},
|
||||
{ImGuiKey_K, "K"},
|
||||
{ImGuiKey_L, "L"},
|
||||
{ImGuiKey_M, "M"},
|
||||
{ImGuiKey_N, "N"},
|
||||
{ImGuiKey_O, "O"},
|
||||
{ImGuiKey_P, "P"},
|
||||
{ImGuiKey_Q, "Q"},
|
||||
{ImGuiKey_R, "R"},
|
||||
{ImGuiKey_S, "S"},
|
||||
{ImGuiKey_T, "T"},
|
||||
{ImGuiKey_U, "U"},
|
||||
{ImGuiKey_V, "V"},
|
||||
{ImGuiKey_W, "W"},
|
||||
{ImGuiKey_X, "X"},
|
||||
{ImGuiKey_Y, "Y"},
|
||||
{ImGuiKey_Z, "Z"},
|
||||
{ImGuiKey_F1, "F1"},
|
||||
{ImGuiKey_F2, "F2"},
|
||||
{ImGuiKey_F3, "F3"},
|
||||
{ImGuiKey_F4, "F4"},
|
||||
{ImGuiKey_F5, "F5"},
|
||||
{ImGuiKey_F6, "F6"},
|
||||
{ImGuiKey_F7, "F7"},
|
||||
{ImGuiKey_F8, "F8"},
|
||||
{ImGuiKey_F9, "F9"},
|
||||
{ImGuiKey_F10, "F10"},
|
||||
{ImGuiKey_F11, "F11"},
|
||||
{ImGuiKey_F12, "F12"},
|
||||
{ImGuiKey_Apostrophe, "Apostrophe"},
|
||||
{ImGuiKey_Comma, "Comma"},
|
||||
{ImGuiKey_Minus, "Minus"},
|
||||
{ImGuiKey_Period, "Period"},
|
||||
{ImGuiKey_Slash, "Slash"},
|
||||
{ImGuiKey_Semicolon, "Semicolon"},
|
||||
{ImGuiKey_Equal, "Equal"},
|
||||
{ImGuiKey_LeftBracket, "BracketLeft"},
|
||||
{ImGuiKey_Backslash, "Backslash"},
|
||||
{ImGuiKey_RightBracket, "BracketRight"},
|
||||
{ImGuiKey_GraveAccent, "QuoteLeft"},
|
||||
{ImGuiKey_CapsLock, "CapsLock"},
|
||||
{ImGuiKey_ScrollLock, "ScrollLock"},
|
||||
{ImGuiKey_NumLock, "NumLock"},
|
||||
{ImGuiKey_PrintScreen, "PrintScreen"},
|
||||
{ImGuiKey_Pause, "Pause"},
|
||||
{ImGuiKey_Keypad0, "Keypad0"},
|
||||
{ImGuiKey_Keypad1, "Keypad1"},
|
||||
{ImGuiKey_Keypad2, "Keypad2"},
|
||||
{ImGuiKey_Keypad3, "Keypad3"},
|
||||
{ImGuiKey_Keypad4, "Keypad4"},
|
||||
{ImGuiKey_Keypad5, "Keypad5"},
|
||||
{ImGuiKey_Keypad6, "Keypad6"},
|
||||
{ImGuiKey_Keypad7, "Keypad7"},
|
||||
{ImGuiKey_Keypad8, "Keypad8"},
|
||||
{ImGuiKey_Keypad9, "Keypad9"},
|
||||
{ImGuiKey_KeypadDecimal, "KeypadPeriod"},
|
||||
{ImGuiKey_KeypadDivide, "KeypadDivide"},
|
||||
{ImGuiKey_KeypadMultiply, "KeypadMultiply"},
|
||||
{ImGuiKey_KeypadSubtract, "KeypadMinus"},
|
||||
{ImGuiKey_KeypadAdd, "KeypadPlus"},
|
||||
{ImGuiKey_KeypadEnter, "KeypadReturn"},
|
||||
{ImGuiKey_KeypadEqual, "KeypadEqual"}};
|
||||
{ImGuiKey_RightCtrl, "RightCtrl", nullptr},
|
||||
{ImGuiKey_RightShift, "RightShift", nullptr},
|
||||
{ImGuiKey_RightAlt, "RightAlt", nullptr},
|
||||
{ImGuiKey_RightSuper, "RightSuper", nullptr},
|
||||
{ImGuiKey_Menu, "Menu", nullptr},
|
||||
{ImGuiKey_0, "0", nullptr},
|
||||
{ImGuiKey_1, "1", nullptr},
|
||||
{ImGuiKey_2, "2", nullptr},
|
||||
{ImGuiKey_3, "3", nullptr},
|
||||
{ImGuiKey_4, "4", nullptr},
|
||||
{ImGuiKey_5, "5", nullptr},
|
||||
{ImGuiKey_6, "6", nullptr},
|
||||
{ImGuiKey_7, "7", nullptr},
|
||||
{ImGuiKey_8, "8", nullptr},
|
||||
{ImGuiKey_9, "9", nullptr},
|
||||
{ImGuiKey_A, "A", nullptr},
|
||||
{ImGuiKey_B, "B", nullptr},
|
||||
{ImGuiKey_C, "C", nullptr},
|
||||
{ImGuiKey_D, "D", nullptr},
|
||||
{ImGuiKey_E, "E", nullptr},
|
||||
{ImGuiKey_F, "F", nullptr},
|
||||
{ImGuiKey_G, "G", nullptr},
|
||||
{ImGuiKey_H, "H", nullptr},
|
||||
{ImGuiKey_I, "I", nullptr},
|
||||
{ImGuiKey_J, "J", nullptr},
|
||||
{ImGuiKey_K, "K", nullptr},
|
||||
{ImGuiKey_L, "L", nullptr},
|
||||
{ImGuiKey_M, "M", nullptr},
|
||||
{ImGuiKey_N, "N", nullptr},
|
||||
{ImGuiKey_O, "O", nullptr},
|
||||
{ImGuiKey_P, "P", nullptr},
|
||||
{ImGuiKey_Q, "Q", nullptr},
|
||||
{ImGuiKey_R, "R", nullptr},
|
||||
{ImGuiKey_S, "S", nullptr},
|
||||
{ImGuiKey_T, "T", nullptr},
|
||||
{ImGuiKey_U, "U", nullptr},
|
||||
{ImGuiKey_V, "V", nullptr},
|
||||
{ImGuiKey_W, "W", nullptr},
|
||||
{ImGuiKey_X, "X", nullptr},
|
||||
{ImGuiKey_Y, "Y", nullptr},
|
||||
{ImGuiKey_Z, "Z", nullptr},
|
||||
{ImGuiKey_F1, "F1", nullptr},
|
||||
{ImGuiKey_F2, "F2", nullptr},
|
||||
{ImGuiKey_F3, "F3", nullptr},
|
||||
{ImGuiKey_F4, "F4", nullptr},
|
||||
{ImGuiKey_F5, "F5", nullptr},
|
||||
{ImGuiKey_F6, "F6", nullptr},
|
||||
{ImGuiKey_F7, "F7", nullptr},
|
||||
{ImGuiKey_F8, "F8", nullptr},
|
||||
{ImGuiKey_F9, "F9", nullptr},
|
||||
{ImGuiKey_F10, "F10", nullptr},
|
||||
{ImGuiKey_F11, "F11", nullptr},
|
||||
{ImGuiKey_F12, "F12", nullptr},
|
||||
{ImGuiKey_Apostrophe, "Apostrophe", nullptr},
|
||||
{ImGuiKey_Comma, "Comma", nullptr},
|
||||
{ImGuiKey_Minus, "Minus", nullptr},
|
||||
{ImGuiKey_Period, "Period", nullptr},
|
||||
{ImGuiKey_Slash, "Slash", nullptr},
|
||||
{ImGuiKey_Semicolon, "Semicolon", nullptr},
|
||||
{ImGuiKey_Equal, "Equal", nullptr},
|
||||
{ImGuiKey_LeftBracket, "BracketLeft", nullptr},
|
||||
{ImGuiKey_Backslash, "Backslash", nullptr},
|
||||
{ImGuiKey_RightBracket, "BracketRight", nullptr},
|
||||
{ImGuiKey_GraveAccent, "QuoteLeft", nullptr},
|
||||
{ImGuiKey_CapsLock, "CapsLock", nullptr},
|
||||
{ImGuiKey_ScrollLock, "ScrollLock", nullptr},
|
||||
{ImGuiKey_NumLock, "NumLock", nullptr},
|
||||
{ImGuiKey_PrintScreen, "PrintScreen", nullptr},
|
||||
{ImGuiKey_Pause, "Pause", nullptr},
|
||||
{ImGuiKey_Keypad0, "Keypad0", nullptr},
|
||||
{ImGuiKey_Keypad1, "Keypad1", nullptr},
|
||||
{ImGuiKey_Keypad2, "Keypad2", nullptr},
|
||||
{ImGuiKey_Keypad3, "Keypad3", nullptr},
|
||||
{ImGuiKey_Keypad4, "Keypad4", nullptr},
|
||||
{ImGuiKey_Keypad5, "Keypad5", nullptr},
|
||||
{ImGuiKey_Keypad6, "Keypad6", nullptr},
|
||||
{ImGuiKey_Keypad7, "Keypad7", nullptr},
|
||||
{ImGuiKey_Keypad8, "Keypad8", nullptr},
|
||||
{ImGuiKey_Keypad9, "Keypad9", nullptr},
|
||||
{ImGuiKey_KeypadDecimal, "KeypadPeriod", nullptr},
|
||||
{ImGuiKey_KeypadDivide, "KeypadDivide", nullptr},
|
||||
{ImGuiKey_KeypadMultiply, "KeypadMultiply", nullptr},
|
||||
{ImGuiKey_KeypadSubtract, "KeypadMinus", nullptr},
|
||||
{ImGuiKey_KeypadAdd, "KeypadPlus", nullptr },
|
||||
{ImGuiKey_KeypadEnter, "KeypadReturn", nullptr },
|
||||
{ImGuiKey_KeypadEqual, "KeypadEqual", nullptr}};
|
||||
|
||||
s_imgui_key_map.clear();
|
||||
for (const KeyMapping& km : mapping)
|
||||
|
||||
@ -729,8 +729,11 @@ bool OpenGLDevice::ReadPipelineCache(const std::string& filename)
|
||||
|
||||
// Read footer.
|
||||
const s64 size = FileSystem::FSize64(m_pipeline_disk_cache_file);
|
||||
if (size < sizeof(PipelineDiskCacheFooter) || size >= static_cast<s64>(std::numeric_limits<u32>::max()))
|
||||
if (size < static_cast<s64>(sizeof(PipelineDiskCacheFooter)) ||
|
||||
size >= static_cast<s64>(std::numeric_limits<u32>::max()))
|
||||
{
|
||||
return DiscardPipelineCache();
|
||||
}
|
||||
|
||||
PipelineDiskCacheFooter file_footer;
|
||||
if (FileSystem::FSeek64(m_pipeline_disk_cache_file, size - sizeof(PipelineDiskCacheFooter), SEEK_SET) != 0 ||
|
||||
|
||||
@ -805,8 +805,6 @@ bool PostProcessing::ReShadeFXShader::CreatePasses(GPUTexture::Format backbuffer
|
||||
m_textures.push_back(std::move(tex));
|
||||
}
|
||||
|
||||
TextureID last_output = INPUT_COLOR_TEXTURE;
|
||||
|
||||
for (reshadefx::technique_info& tech : mod.techniques)
|
||||
{
|
||||
for (reshadefx::pass_info& pi : tech.passes)
|
||||
@ -915,7 +913,6 @@ bool PostProcessing::ReShadeFXShader::CreatePasses(GPUTexture::Format backbuffer
|
||||
#ifdef _DEBUG
|
||||
pass.name = std::move(pi.name);
|
||||
#endif
|
||||
last_output = pass.render_target;
|
||||
m_passes.push_back(std::move(pass));
|
||||
}
|
||||
}
|
||||
@ -1019,8 +1016,8 @@ bool PostProcessing::ReShadeFXShader::CompilePipeline(GPUTexture::Format format,
|
||||
|
||||
const std::string_view code(mod.code.data(), mod.code.size());
|
||||
|
||||
auto get_shader = [this, needs_main_defn, &code](const std::string& name, const std::vector<Sampler>& samplers,
|
||||
GPUShaderStage stage) {
|
||||
auto get_shader = [needs_main_defn, &code](const std::string& name, const std::vector<Sampler>& samplers,
|
||||
GPUShaderStage stage) {
|
||||
std::string real_code;
|
||||
if (needs_main_defn)
|
||||
{
|
||||
|
||||
@ -485,20 +485,15 @@ bool VulkanDevice::CreateDevice(VkSurfaceKHR surface, bool enable_validation_lay
|
||||
}
|
||||
|
||||
VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT rasterization_order_access_feature = {
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT};
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT, nullptr, VK_TRUE, VK_FALSE,
|
||||
VK_FALSE};
|
||||
VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT attachment_feedback_loop_feature = {
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT};
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT, nullptr, VK_TRUE};
|
||||
|
||||
if (m_optional_extensions.vk_ext_rasterization_order_attachment_access)
|
||||
{
|
||||
rasterization_order_access_feature.rasterizationOrderColorAttachmentAccess = VK_TRUE;
|
||||
Vulkan::AddPointerToChain(&device_info, &rasterization_order_access_feature);
|
||||
}
|
||||
if (m_optional_extensions.vk_ext_attachment_feedback_loop_layout)
|
||||
{
|
||||
attachment_feedback_loop_feature.attachmentFeedbackLoopLayout = VK_TRUE;
|
||||
Vulkan::AddPointerToChain(&device_info, &attachment_feedback_loop_feature);
|
||||
}
|
||||
|
||||
VkResult res = vkCreateDevice(m_physical_device, &device_info, nullptr, &m_device);
|
||||
if (res != VK_SUCCESS)
|
||||
@ -532,11 +527,12 @@ bool VulkanDevice::CreateDevice(VkSurfaceKHR surface, bool enable_validation_lay
|
||||
void VulkanDevice::ProcessDeviceExtensions()
|
||||
{
|
||||
// advanced feature checks
|
||||
VkPhysicalDeviceFeatures2 features2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2};
|
||||
VkPhysicalDeviceFeatures2 features2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, nullptr, {}};
|
||||
VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT rasterization_order_access_feature = {
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT};
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT, nullptr, VK_FALSE, VK_FALSE,
|
||||
VK_FALSE};
|
||||
VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT attachment_feedback_loop_feature = {
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT};
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT, nullptr, VK_FALSE};
|
||||
|
||||
// add in optional feature structs
|
||||
if (m_optional_extensions.vk_ext_rasterization_order_attachment_access)
|
||||
@ -553,9 +549,9 @@ void VulkanDevice::ProcessDeviceExtensions()
|
||||
m_optional_extensions.vk_ext_attachment_feedback_loop_layout &=
|
||||
(attachment_feedback_loop_feature.attachmentFeedbackLoopLayout == VK_TRUE);
|
||||
|
||||
VkPhysicalDeviceProperties2 properties2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2};
|
||||
VkPhysicalDeviceProperties2 properties2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, nullptr, {}};
|
||||
VkPhysicalDevicePushDescriptorPropertiesKHR push_descriptor_properties = {
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR};
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR, nullptr, 0u};
|
||||
|
||||
if (m_optional_extensions.vk_khr_driver_properties)
|
||||
{
|
||||
@ -1046,10 +1042,16 @@ void VulkanDevice::DoSubmitCommandBuffer(u32 index, VulkanSwapChain* present_swa
|
||||
CommandBuffer& resources = m_frame_resources[index];
|
||||
|
||||
uint32_t wait_bits = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
||||
VkSubmitInfo submit_info = {VK_STRUCTURE_TYPE_SUBMIT_INFO};
|
||||
submit_info.commandBufferCount = resources.init_buffer_used ? 2u : 1u;
|
||||
submit_info.pCommandBuffers =
|
||||
resources.init_buffer_used ? resources.command_buffers.data() : &resources.command_buffers[1];
|
||||
VkSubmitInfo submit_info = {VK_STRUCTURE_TYPE_SUBMIT_INFO,
|
||||
nullptr,
|
||||
0u,
|
||||
nullptr,
|
||||
nullptr,
|
||||
resources.init_buffer_used ? 2u : 1u,
|
||||
resources.init_buffer_used ? resources.command_buffers.data() :
|
||||
&resources.command_buffers[1],
|
||||
0u,
|
||||
nullptr};
|
||||
|
||||
if (present_swap_chain)
|
||||
{
|
||||
@ -2679,7 +2681,8 @@ void VulkanDevice::BeginRenderPass()
|
||||
{
|
||||
DebugAssert(!InRenderPass());
|
||||
|
||||
VkRenderPassBeginInfo bi = {VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, nullptr};
|
||||
VkRenderPassBeginInfo bi = {
|
||||
VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, nullptr, VK_NULL_HANDLE, VK_NULL_HANDLE, {}, 0u, nullptr};
|
||||
std::array<VkClearValue, 2> clear_values;
|
||||
|
||||
if (LIKELY(m_current_framebuffer))
|
||||
@ -2746,7 +2749,7 @@ void VulkanDevice::BeginRenderPass()
|
||||
case GPUTexture::State::Cleared:
|
||||
{
|
||||
const u32 idx = rt ? 1 : 0;
|
||||
clear_values[idx].depthStencil = {ds->GetClearDepth()};
|
||||
clear_values[idx].depthStencil = {ds->GetClearDepth(), 0u};
|
||||
ds_load_op = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||
ds->SetState(GPUTexture::State::Dirty);
|
||||
bi.pClearValues = clear_values.data();
|
||||
|
||||
@ -75,6 +75,7 @@
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wnullability-completeness"
|
||||
#pragma clang diagnostic ignored "-Wunused-variable"
|
||||
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma warning(push, 0)
|
||||
#endif
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
|
||||
Log_SetChannel(VulkanDevice);
|
||||
|
||||
static u32 s_next_bad_shader_id = 1;
|
||||
|
||||
VulkanShader::VulkanShader(GPUShaderStage stage, VkShaderModule mod) : GPUShader(stage), m_module(mod)
|
||||
{
|
||||
}
|
||||
|
||||
@ -413,9 +413,10 @@ bool VulkanSwapChain::CreateSwapChain()
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
VkSurfaceFullScreenExclusiveInfoEXT exclusive_info = {VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT};
|
||||
VkSurfaceFullScreenExclusiveInfoEXT exclusive_info = {VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT,
|
||||
nullptr, VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT};
|
||||
VkSurfaceFullScreenExclusiveWin32InfoEXT exclusive_win32_info = {
|
||||
VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT};
|
||||
VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT, nullptr, NULL};
|
||||
if (m_exclusive_fullscreen_control.has_value())
|
||||
{
|
||||
if (dev.GetOptionalExtensions().vk_ext_full_screen_exclusive)
|
||||
|
||||
@ -75,7 +75,12 @@ std::unique_ptr<VulkanTexture> VulkanTexture::Create(u32 width, u32 height, u32
|
||||
levels,
|
||||
layers,
|
||||
static_cast<VkSampleCountFlagBits>(samples),
|
||||
VK_IMAGE_TILING_OPTIMAL};
|
||||
VK_IMAGE_TILING_OPTIMAL,
|
||||
0u,
|
||||
VK_SHARING_MODE_EXCLUSIVE,
|
||||
0,
|
||||
nullptr,
|
||||
VK_IMAGE_LAYOUT_UNDEFINED};
|
||||
|
||||
VmaAllocationCreateInfo aci = {};
|
||||
aci.usage = VMA_MEMORY_USAGE_GPU_ONLY;
|
||||
@ -433,7 +438,7 @@ void VulkanTexture::CommitClear(VkCommandBuffer cmdbuf)
|
||||
|
||||
if (IsDepthStencil())
|
||||
{
|
||||
const VkClearDepthStencilValue cv = {m_clear_value.depth};
|
||||
const VkClearDepthStencilValue cv = {m_clear_value.depth, 0u};
|
||||
const VkImageSubresourceRange srr = {VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 1u, 0u, 1u};
|
||||
vkCmdClearDepthStencilImage(cmdbuf, m_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &cv, 1, &srr);
|
||||
}
|
||||
|
||||
@ -49,7 +49,9 @@ bool Win32RawInputSource::Initialize(SettingsInterface& si, std::unique_lock<std
|
||||
return true;
|
||||
}
|
||||
|
||||
void Win32RawInputSource::UpdateSettings(SettingsInterface& si, std::unique_lock<std::mutex>& settings_lock) {}
|
||||
void Win32RawInputSource::UpdateSettings(SettingsInterface& si, std::unique_lock<std::mutex>& settings_lock)
|
||||
{
|
||||
}
|
||||
|
||||
bool Win32RawInputSource::ReloadDevices()
|
||||
{
|
||||
@ -72,7 +74,9 @@ std::vector<std::pair<std::string, std::string>> Win32RawInputSource::EnumerateD
|
||||
return {};
|
||||
}
|
||||
|
||||
void Win32RawInputSource::UpdateMotorState(InputBindingKey key, float intensity) {}
|
||||
void Win32RawInputSource::UpdateMotorState(InputBindingKey key, float intensity)
|
||||
{
|
||||
}
|
||||
|
||||
void Win32RawInputSource::UpdateMotorState(InputBindingKey large_key, InputBindingKey small_key, float large_intensity,
|
||||
float small_intensity)
|
||||
@ -171,7 +175,7 @@ bool Win32RawInputSource::OpenDevices()
|
||||
m_num_keyboards++;
|
||||
#endif
|
||||
if (rid.dwType == RIM_TYPEMOUSE)
|
||||
m_mice.push_back({rid.hDevice});
|
||||
m_mice.push_back({rid.hDevice, 0u, 0, 0});
|
||||
}
|
||||
|
||||
Log_DevPrintf("(Win32RawInputSource) Found %u keyboards and %zu mice", m_num_keyboards, m_mice.size());
|
||||
|
||||
@ -55,7 +55,6 @@ private:
|
||||
|
||||
HWND m_dummy_window = {};
|
||||
u32 m_num_keyboards = 0;
|
||||
u32 m_num_mice = 0;
|
||||
|
||||
std::vector<MouseState> m_mice;
|
||||
};
|
||||
|
||||
@ -4,9 +4,6 @@
|
||||
#include "window_info.h"
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/log.h"
|
||||
|
||||
Log_SetChannel(WindowInfo);
|
||||
|
||||
void WindowInfo::SetSurfaceless()
|
||||
{
|
||||
@ -88,11 +85,14 @@ bool WindowInfo::QueryRefreshRateForWindow(const WindowInfo& wi, float* refresh_
|
||||
#ifdef USE_X11
|
||||
|
||||
#include "common/scoped_guard.h"
|
||||
#include "common/log.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
|
||||
Log_SetChannel(WindowInfo);
|
||||
|
||||
// Helper class for managing X errors
|
||||
namespace {
|
||||
class X11InhibitErrors;
|
||||
|
||||
@ -167,7 +167,13 @@ void XAudio2AudioStream::EnqueueBuffer()
|
||||
const XAUDIO2_BUFFER buf = {
|
||||
static_cast<UINT32>(0), // flags
|
||||
static_cast<UINT32>(sizeof(s16) * m_channels * m_enqueue_buffer_size), // bytes
|
||||
reinterpret_cast<const BYTE*>(samples) // data
|
||||
reinterpret_cast<const BYTE*>(samples), // data
|
||||
0u,
|
||||
0u,
|
||||
0u,
|
||||
0u,
|
||||
0u,
|
||||
nullptr,
|
||||
};
|
||||
|
||||
HRESULT hr = m_source_voice->SubmitSourceBuffer(&buf, nullptr);
|
||||
@ -189,19 +195,31 @@ void XAudio2AudioStream::SetOutputVolume(u32 volume)
|
||||
m_volume = volume;
|
||||
}
|
||||
|
||||
void __stdcall XAudio2AudioStream::OnVoiceProcessingPassStart(UINT32 BytesRequired) {}
|
||||
void __stdcall XAudio2AudioStream::OnVoiceProcessingPassStart(UINT32 BytesRequired)
|
||||
{
|
||||
}
|
||||
|
||||
void __stdcall XAudio2AudioStream::OnVoiceProcessingPassEnd(void) {}
|
||||
void __stdcall XAudio2AudioStream::OnVoiceProcessingPassEnd(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __stdcall XAudio2AudioStream::OnStreamEnd(void) {}
|
||||
void __stdcall XAudio2AudioStream::OnStreamEnd(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __stdcall XAudio2AudioStream::OnBufferStart(void* pBufferContext) {}
|
||||
void __stdcall XAudio2AudioStream::OnBufferStart(void* pBufferContext)
|
||||
{
|
||||
}
|
||||
|
||||
void __stdcall XAudio2AudioStream::OnBufferEnd(void* pBufferContext)
|
||||
{
|
||||
EnqueueBuffer();
|
||||
}
|
||||
|
||||
void __stdcall XAudio2AudioStream::OnLoopEnd(void* pBufferContext) {}
|
||||
void __stdcall XAudio2AudioStream::OnLoopEnd(void* pBufferContext)
|
||||
{
|
||||
}
|
||||
|
||||
void __stdcall XAudio2AudioStream::OnVoiceError(void* pBufferContext, HRESULT Error) {}
|
||||
void __stdcall XAudio2AudioStream::OnVoiceError(void* pBufferContext, HRESULT Error)
|
||||
{
|
||||
}
|
||||
|
||||
@ -106,7 +106,10 @@ bool XInputSource::Initialize(SettingsInterface& si, std::unique_lock<std::mutex
|
||||
m_xinput_get_state =
|
||||
reinterpret_cast<decltype(m_xinput_get_state)>(GetProcAddress(m_xinput_module, reinterpret_cast<LPCSTR>(100)));
|
||||
if (!m_xinput_get_state)
|
||||
reinterpret_cast<decltype(m_xinput_get_state)>(GetProcAddress(m_xinput_module, "XInputGetState"));
|
||||
{
|
||||
m_xinput_get_state =
|
||||
reinterpret_cast<decltype(m_xinput_get_state)>(GetProcAddress(m_xinput_module, "XInputGetState"));
|
||||
}
|
||||
m_xinput_set_state =
|
||||
reinterpret_cast<decltype(m_xinput_set_state)>(GetProcAddress(m_xinput_module, "XInputSetState"));
|
||||
m_xinput_get_capabilities =
|
||||
@ -122,7 +125,9 @@ bool XInputSource::Initialize(SettingsInterface& si, std::unique_lock<std::mutex
|
||||
return true;
|
||||
}
|
||||
|
||||
void XInputSource::UpdateSettings(SettingsInterface& si, std::unique_lock<std::mutex>& settings_lock) {}
|
||||
void XInputSource::UpdateSettings(SettingsInterface& si, std::unique_lock<std::mutex>& settings_lock)
|
||||
{
|
||||
}
|
||||
|
||||
bool XInputSource::ReloadDevices()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user