From 1ab327d6d5202682351559fc40330cdf3683d80e Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 9 Sep 2026 21:53:47 +1000 Subject: [PATCH] GPUDevice: Drop SingleTextureAndUBOAndPushConstants Had a copypaste error, and this is a bad idea anyway. --- src/core/fullscreenui_widgets.cpp | 2 +- src/util/d3d12_device.cpp | 42 +++++++------------------------ src/util/gpu_device.h | 4 --- src/util/vulkan_device.cpp | 28 +++------------------ 4 files changed, 14 insertions(+), 62 deletions(-) diff --git a/src/core/fullscreenui_widgets.cpp b/src/core/fullscreenui_widgets.cpp index b0a17d48d..52ef9c744 100644 --- a/src/core/fullscreenui_widgets.cpp +++ b/src/core/fullscreenui_widgets.cpp @@ -1341,7 +1341,7 @@ bool FullscreenUI::CompilePipelines(Error* error) GPUPipeline::VertexAttribute::Type::UNorm8, 4, OFFSETOF(ImDrawVert, col)), }; - plconfig.layout = GPUPipeline::Layout::SingleTextureAndUBOAndPushConstants; + plconfig.layout = GPUPipeline::Layout::MultiTextureAndUBOAndPushConstants; plconfig.input_layout.vertex_attributes = imgui_attributes; plconfig.input_layout.vertex_stride = sizeof(ImDrawVert); plconfig.primitive = GPUPipeline::Primitive::Triangles; diff --git a/src/util/d3d12_device.cpp b/src/util/d3d12_device.cpp index e3827db64..ce59a0257 100644 --- a/src/util/d3d12_device.cpp +++ b/src/util/d3d12_device.cpp @@ -1609,7 +1609,6 @@ void D3D12Device::PushUniformBuffer(ID3D12GraphicsCommandList4* const cmdlist, b static constexpr std::array(GPUPipeline::Layout::MaxCount)> push_parameters = { 0, // SingleTextureAndUBO 2, // SingleTextureAndPushConstants - 3, // SingleTextureAndUBOAndPushConstants 1, // SingleTextureBufferAndPushConstants 0, // MultiTextureAndUBO 2, // MultiTextureAndPushConstants @@ -1694,24 +1693,6 @@ bool D3D12Device::CreateRootSignatures(Error* error) D3D12::SetObjectName(rs.Get(), "Single Texture Pipeline Layout"); } - { - auto& rs = m_root_signatures[rov][static_cast(GPUPipeline::Layout::SingleTextureAndUBOAndPushConstants)]; - - rsb.SetInputAssemblerFlag(); - rsb.AddDescriptorTable(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 0, 1, D3D12_SHADER_VISIBILITY_PIXEL); - rsb.AddDescriptorTable(D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER, 0, 1, D3D12_SHADER_VISIBILITY_PIXEL); - rsb.AddCBVParameter(0, D3D12_SHADER_VISIBILITY_ALL); - if (rov) - { - rsb.AddDescriptorTable(D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 0, MAX_IMAGE_RENDER_TARGETS, - D3D12_SHADER_VISIBILITY_PIXEL); - } - rsb.Add32BitConstants(1, UNIFORM_PUSH_CONSTANTS_SIZE / sizeof(u32), D3D12_SHADER_VISIBILITY_ALL); - if (!(rs = rsb.Create(error, true))) - return false; - D3D12::SetObjectName(rs.Get(), "Single Texture + UBO + Push Constant Pipeline Layout"); - } - { auto& rs = m_root_signatures[rov][static_cast(GPUPipeline::Layout::SingleTextureBufferAndPushConstants)]; @@ -2573,7 +2554,6 @@ bool D3D12Device::UpdateParametersForLayout(u32 dirty) ID3D12GraphicsCommandList4* cmdlist = GetCommandList(); if constexpr (layout == GPUPipeline::Layout::SingleTextureAndUBO || - layout == GPUPipeline::Layout::SingleTextureAndUBOAndPushConstants || layout == GPUPipeline::Layout::MultiTextureAndUBO || layout == GPUPipeline::Layout::MultiTextureAndUBOAndPushConstants || layout == GPUPipeline::Layout::ComputeMultiTextureAndUBO) @@ -2675,16 +2655,15 @@ bool D3D12Device::UpdateParametersForLayout(u32 dirty) m_device->CopyDescriptors(1, &gpu_handle.cpu_handle, &dst_size, MAX_IMAGE_RENDER_TARGETS, src_handles, src_sizes, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); - constexpr u32 rov_param = IsComputeLayout(layout) ? - 2 : - ((layout == GPUPipeline::Layout::SingleTextureBufferAndPushConstants) ? - 1 : - ((layout == GPUPipeline::Layout::SingleTextureAndUBO || - layout == GPUPipeline::Layout::SingleTextureAndUBOAndPushConstants || - layout == GPUPipeline::Layout::MultiTextureAndUBO || - layout == GPUPipeline::Layout::MultiTextureAndUBOAndPushConstants) ? - 3 : - 2)); + constexpr u32 rov_param = + IsComputeLayout(layout) ? + 2 : + ((layout == GPUPipeline::Layout::SingleTextureBufferAndPushConstants) ? + 1 : + ((layout == GPUPipeline::Layout::SingleTextureAndUBO || layout == GPUPipeline::Layout::MultiTextureAndUBO || + layout == GPUPipeline::Layout::MultiTextureAndUBOAndPushConstants) ? + 3 : + 2)); if constexpr (!IsComputeLayout(layout)) cmdlist->SetGraphicsRootDescriptorTable(rov_param, gpu_handle); else @@ -2704,9 +2683,6 @@ bool D3D12Device::UpdateRootParameters(u32 dirty) case GPUPipeline::Layout::SingleTextureAndPushConstants: return UpdateParametersForLayout(dirty); - case GPUPipeline::Layout::SingleTextureAndUBOAndPushConstants: - return UpdateParametersForLayout(dirty); - case GPUPipeline::Layout::SingleTextureBufferAndPushConstants: return UpdateParametersForLayout(dirty); diff --git a/src/util/gpu_device.h b/src/util/gpu_device.h index 4e5e9dbce..b434998ef 100644 --- a/src/util/gpu_device.h +++ b/src/util/gpu_device.h @@ -133,9 +133,6 @@ public: // 128 byte UBO via push constants, 1 texture. SingleTextureAndPushConstants, - // 128 byte UBO via push constants, 1 streamed UBO, 1 texture. - SingleTextureAndUBOAndPushConstants, - // 128 byte UBO via push constants, 1 texture buffer/SSBO. SingleTextureBufferAndPushConstants, @@ -659,7 +656,6 @@ public: constexpr std::array(GPUPipeline::Layout::MaxCount)> counts = { 1, // SingleTextureAndUBO 1, // SingleTextureAndPushConstants - 1, // SingleTextureAndUBOAndPushConstants 0, // SingleTextureBufferAndPushConstants MAX_TEXTURE_SAMPLERS, // MultiTextureAndUBO MAX_TEXTURE_SAMPLERS, // MultiTextureAndPushConstants diff --git a/src/util/vulkan_device.cpp b/src/util/vulkan_device.cpp index 592dfda4d..de5449db4 100644 --- a/src/util/vulkan_device.cpp +++ b/src/util/vulkan_device.cpp @@ -2481,21 +2481,6 @@ bool VulkanDevice::CreatePipelineLayouts() Vulkan::SetObjectName(m_device, pl, "Single Texture Pipeline Layout"); } - { - VkPipelineLayout& pl = - m_pipeline_layouts[type][static_cast(GPUPipeline::Layout::SingleTextureAndUBOAndPushConstants)]; - plb.AddDescriptorSet(m_ubo_ds_layout); - plb.AddDescriptorSet(m_single_texture_ds_layout); - plb.AddPushConstants(UNIFORM_PUSH_CONSTANTS_STAGES, 0, UNIFORM_PUSH_CONSTANTS_SIZE); - if (feedback_loop) - plb.AddDescriptorSet(m_feedback_loop_ds_layout); - else if (rov) - plb.AddDescriptorSet(m_image_ds_layout); - if ((pl = plb.Create(m_device)) == VK_NULL_HANDLE) - return false; - Vulkan::SetObjectName(m_device, pl, "Single Texture + UBO + Push Constant Pipeline Layout"); - } - { VkPipelineLayout& pl = m_pipeline_layouts[type][static_cast(GPUPipeline::Layout::SingleTextureBufferAndPushConstants)]; @@ -3423,11 +3408,10 @@ bool VulkanDevice::UpdateDescriptorSetsForLayout(u32 dirty) [[maybe_unused]] bool new_dynamic_offsets = false; constexpr bool is_compute = IsComputeLayout(layout); - constexpr bool has_ubo = (layout == GPUPipeline::Layout::SingleTextureAndUBO || - layout == GPUPipeline::Layout::SingleTextureAndUBOAndPushConstants || - layout == GPUPipeline::Layout::MultiTextureAndUBO || - layout == GPUPipeline::Layout::MultiTextureAndUBOAndPushConstants || - layout == GPUPipeline::Layout::ComputeMultiTextureAndUBO); + constexpr bool has_ubo = + (layout == GPUPipeline::Layout::SingleTextureAndUBO || layout == GPUPipeline::Layout::MultiTextureAndUBO || + layout == GPUPipeline::Layout::MultiTextureAndUBOAndPushConstants || + layout == GPUPipeline::Layout::ComputeMultiTextureAndUBO); constexpr VkPipelineBindPoint vk_bind_point = (is_compute ? VK_PIPELINE_BIND_POINT_COMPUTE : VK_PIPELINE_BIND_POINT_GRAPHICS); const VkPipelineLayout vk_pipeline_layout = GetCurrentVkPipelineLayout(is_compute); @@ -3451,7 +3435,6 @@ bool VulkanDevice::UpdateDescriptorSetsForLayout(u32 dirty) } if constexpr (layout == GPUPipeline::Layout::SingleTextureAndUBO || - layout == GPUPipeline::Layout::SingleTextureAndUBOAndPushConstants || layout == GPUPipeline::Layout::SingleTextureAndPushConstants) { VulkanTexture* const tex = @@ -3573,9 +3556,6 @@ bool VulkanDevice::UpdateDescriptorSets(u32 dirty) case GPUPipeline::Layout::SingleTextureAndPushConstants: return UpdateDescriptorSetsForLayout(dirty); - case GPUPipeline::Layout::SingleTextureAndUBOAndPushConstants: - return UpdateDescriptorSetsForLayout(dirty); - case GPUPipeline::Layout::SingleTextureBufferAndPushConstants: return UpdateDescriptorSetsForLayout(dirty);