From 62a165b51ef78612f32548b2e4958d854ebd5e17 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 9 Oct 2022 13:57:47 +0100 Subject: [PATCH] Reformat maxwell3d interconnect codebase --- .../interconnect/maxwell_3d/active_state.cpp | 2 +- .../maxwell_3d/constant_buffers.h | 8 +- .../maxwell_3d/packed_pipeline_state.cpp | 6 +- .../maxwell_3d/pipeline_manager.cpp | 88 ++++----- .../maxwell_3d/pipeline_manager.h | 10 +- .../gpu/interconnect/maxwell_3d/samplers.cpp | 1 - .../gpu/interconnect/maxwell_3d/samplers.h | 1 - .../interconnect/maxwell_3d/state_updater.h | 167 ++++++++++-------- .../skyline/gpu/interconnect/maxwell_3d/tic.h | 1 - .../skyline/gpu/interconnect/maxwell_3d/tsc.h | 2 +- 10 files changed, 153 insertions(+), 133 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/active_state.cpp b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/active_state.cpp index 5d5ce8b9..cac6dce4 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/active_state.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/active_state.cpp @@ -49,7 +49,7 @@ namespace skyline::gpu::interconnect::maxwell3d { bool VertexBufferState::Refresh(InterconnectContext &ctx, StateUpdateBuilder &builder) { if (megaBufferBinding) { if (auto newMegaBufferBinding{view->TryMegaBuffer(ctx.executor.cycle, ctx.executor.AcquireMegaBufferAllocator(), ctx.executor.executionNumber)}; - newMegaBufferBinding != megaBufferBinding) { + newMegaBufferBinding != megaBufferBinding) { megaBufferBinding = newMegaBufferBinding; if (megaBufferBinding) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/constant_buffers.h b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/constant_buffers.h index e0815759..46079295 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/constant_buffers.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/constant_buffers.h @@ -15,7 +15,7 @@ namespace skyline::gpu::interconnect::maxwell3d { }; private: - dirty::BoundSubresource engine; + dirty::BoundSubresource engine; public: ConstantBufferSelectorState(dirty::Handle dirtyHandle, DirtyManager &manager, const EngineRegisters &engine); @@ -32,7 +32,7 @@ namespace skyline::gpu::interconnect::maxwell3d { struct ConstantBuffer { BufferView view; - void Read(CommandExecutor &executor, span dstBuffer, size_t srcOffset); + void Read(CommandExecutor &executor, span dstBuffer, size_t srcOffset); template T Read(CommandExecutor &executor, size_t srcOffset) { @@ -49,7 +49,7 @@ namespace skyline::gpu::interconnect::maxwell3d { */ class ConstantBuffers { private: - dirty::ManualDirtyState selectorState; + dirty::ManualDirtyState selectorState; public: ConstantBufferSet boundConstantBuffers; @@ -68,7 +68,7 @@ namespace skyline::gpu::interconnect::maxwell3d { void MarkAllDirty(); - void Load(InterconnectContext &ctx, span data, u32 offset); + void Load(InterconnectContext &ctx, span data, u32 offset); void Bind(InterconnectContext &ctx, engine::ShaderStage stage, size_t index); diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/packed_pipeline_state.cpp b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/packed_pipeline_state.cpp index 7f404b30..c28f6c39 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/packed_pipeline_state.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/packed_pipeline_state.cpp @@ -152,9 +152,9 @@ namespace skyline::gpu::interconnect::maxwell3d { static VkColorComponentFlags ConvertColorWriteMask(engine::CtWrite write) { return (write.rEnable ? VK_COLOR_COMPONENT_R_BIT : 0) | - (write.gEnable ? VK_COLOR_COMPONENT_G_BIT : 0) | - (write.bEnable ? VK_COLOR_COMPONENT_B_BIT : 0) | - (write.aEnable ? VK_COLOR_COMPONENT_A_BIT : 0); + (write.gEnable ? VK_COLOR_COMPONENT_G_BIT : 0) | + (write.bEnable ? VK_COLOR_COMPONENT_B_BIT : 0) | + (write.aEnable ? VK_COLOR_COMPONENT_A_BIT : 0); }; static u8 ConvertBlendOp(engine::BlendOp op) { diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp index f9cae1e7..799038fb 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp @@ -174,8 +174,8 @@ namespace skyline::gpu::interconnect::maxwell3d { ctx.gpu.shader.ResetPools(); using PipelineStage = engine::Pipeline::Shader::Type; - auto pipelineStage{[](size_t i){ return static_cast(i); }}; - auto stageIdx{[](PipelineStage stage){ return static_cast(stage); }}; + auto pipelineStage{[](size_t i) { return static_cast(i); }}; + auto stageIdx{[](PipelineStage stage) { return static_cast(stage); }}; std::array programs; bool ignoreVertexCullBeforeFetch{}; @@ -233,7 +233,7 @@ namespace skyline::gpu::interconnect::maxwell3d { auto &stageDescInfo{descriptorInfo.stages[i]}; - auto pushBindings{[&](vk::DescriptorType type, const auto &descs, u32 &count, auto &&descCb, bool individualDescWrites = false) { + auto pushBindings{[&](vk::DescriptorType type, const auto &descs, u32 &count, auto &&descCb, bool individualDescWrites = false) { descriptorInfo.totalWriteDescCount += individualDescWrites ? descs.size() : ((descs.size() > 0) ? 1 : 0); for (u32 descIdx{}; descIdx < descs.size(); descIdx++) { @@ -328,7 +328,7 @@ namespace skyline::gpu::interconnect::maxwell3d { numericalType = engine::VertexAttribute::NumericalType::Uint; switch (componentBitWidths | numericalType) { - /* 8-bit components */ + /* 8-bit components */ FORMAT_NORM_INT_SCALED_CASE(R8, eR8); FORMAT_NORM_INT_SCALED_CASE(R8_G8, eR8G8); FORMAT_NORM_INT_SCALED_CASE(G8R8, eR8G8); @@ -429,21 +429,23 @@ namespace skyline::gpu::interconnect::maxwell3d { for (u32 i{}; i < engine::VertexStreamCount; i++) { const auto &binding{packedState.vertexBindings[i]}; bindingDescs.push_back({ - .binding = i, - .stride = binding.stride, - .inputRate = binding.GetInputRate(), - }); + .binding = i, + .stride = binding.stride, + .inputRate = binding.GetInputRate(), + }); if (binding.GetInputRate() == vk::VertexInputRate::eInstance) { - if (!ctx.gpu.traits.supportsVertexAttributeDivisor) [[unlikely]] + if (!ctx.gpu.traits.supportsVertexAttributeDivisor) + [[unlikely]] Logger::Warn("Vertex attribute divisor used on guest without host support"); - else if (!ctx.gpu.traits.supportsVertexAttributeZeroDivisor && binding.divisor == 0) [[unlikely]] + else if (!ctx.gpu.traits.supportsVertexAttributeZeroDivisor && binding.divisor == 0) + [[unlikely]] Logger::Warn("Vertex attribute zero divisor used on guest without host support"); else bindingDivisorDescs.push_back({ - .binding = i, - .divisor = binding.divisor, - }); + .binding = i, + .divisor = binding.divisor, + }); } } @@ -451,11 +453,11 @@ namespace skyline::gpu::interconnect::maxwell3d { const auto &attribute{packedState.vertexAttributes[i]}; if (attribute.source == engine::VertexAttribute::Source::Active && shaderStages[0].info.loads.Generic(i)) attributeDescs.push_back({ - .location = i, - .binding = attribute.stream, - .format = ConvertVertexInputAttributeFormat(attribute.componentBitWidths, attribute.numericalType), - .offset = attribute.offset, - }); + .location = i, + .binding = attribute.stream, + .format = ConvertVertexInputAttributeFormat(attribute.componentBitWidths, attribute.numericalType), + .offset = attribute.offset, + }); } vk::StructureChain vertexInputState{ @@ -668,7 +670,7 @@ namespace skyline::gpu::interconnect::maxwell3d { size_t primaryCbufOffset{desc.cbuf_offset + elemOffset}; u32 primaryVal{primaryCbuf.Read(ctx.executor, primaryCbufOffset)}; - if constexpr (requires { desc.has_secondary; } ) { + if constexpr (requires { desc.has_secondary; }) { if (desc.has_secondary) { ConstantBuffer &secondaryCbuf{constantBuffers[desc.secondary_cbuf_index]}; size_t secondaryCbufOffset{desc.secondary_cbuf_offset + elemOffset}; @@ -677,7 +679,7 @@ namespace skyline::gpu::interconnect::maxwell3d { } } - return { .raw = primaryVal }; + return {.raw = primaryVal}; } static vk::DescriptorImageInfo GetTextureBinding(InterconnectContext &ctx, const Shader::TextureDescriptor &desc, Samplers &samplers, Textures &textures, BindlessHandle handle) { @@ -768,29 +770,29 @@ namespace skyline::gpu::interconnect::maxwell3d { writeBufferDescs(vk::DescriptorType::eUniformBuffer, stage.info.constant_buffer_descriptors, stageDescInfo.uniformBufferDescCount, [&](const Shader::ConstantBufferDescriptor &desc, size_t arrayIdx) { - size_t cbufIdx{desc.index + arrayIdx}; - return GetConstantBufferBinding(ctx, stage.info, constantBuffers[i][cbufIdx].view, cbufIdx); - }); + size_t cbufIdx{desc.index + arrayIdx}; + return GetConstantBufferBinding(ctx, stage.info, constantBuffers[i][cbufIdx].view, cbufIdx); + }); writeBufferDescs(vk::DescriptorType::eStorageBuffer, stage.info.storage_buffers_descriptors, stageDescInfo.storageBufferDescCount, [&](const Shader::StorageBufferDescriptor &desc, size_t arrayIdx) { - auto binding{GetStorageBufferBinding(ctx, desc, constantBuffers[i][desc.cbuf_index], storageBufferViews[storageBufferIdx - arrayIdx ? 1 : 0])}; - // Storage buffer arrays all share the same view index, so to only increment the index once per array do it at element zero and subtract that for all subsequent array elems (see above) - storageBufferIdx += arrayIdx ? 0 : 1; - return binding; - }); + auto binding{GetStorageBufferBinding(ctx, desc, constantBuffers[i][desc.cbuf_index], storageBufferViews[storageBufferIdx - arrayIdx ? 1 : 0])}; + // Storage buffer arrays all share the same view index, so to only increment the index once per array do it at element zero and subtract that for all subsequent array elems (see above) + storageBufferIdx += arrayIdx ? 0 : 1; + return binding; + }); writeImageDescs(vk::DescriptorType::eCombinedImageSampler, stage.info.texture_descriptors, stageDescInfo.combinedImageSamplerDescCount, [&](const Shader::TextureDescriptor &desc, size_t arrayIdx) { - BindlessHandle handle{ReadBindlessHandle(ctx, constantBuffers[i], desc, arrayIdx)}; - return GetTextureBinding(ctx, desc, samplers, textures, handle); - }, ctx.gpu.traits.quirks.needsIndividualTextureBindingWrites); + BindlessHandle handle{ReadBindlessHandle(ctx, constantBuffers[i], desc, arrayIdx)}; + return GetTextureBinding(ctx, desc, samplers, textures, handle); + }, ctx.gpu.traits.quirks.needsIndividualTextureBindingWrites); } // Since we don't implement all descriptor types the number of writes might not match what's expected if (!writeIdx) return nullptr; - + return ctx.executor.allocator->EmplaceUntracked(DescriptorUpdateInfo{ .writes = writes.first(writeIdx), .bufferDescs = bufferDescs.first(bufferIdx), @@ -855,21 +857,21 @@ namespace skyline::gpu::interconnect::maxwell3d { }}; writeDescs.operator()(vk::DescriptorType::eUniformBuffer, cbufUsageInfo.uniformBuffers, shaderInfo.constant_buffer_descriptors, - [&](auto usage, const Shader::ConstantBufferDescriptor &desc, size_t arrayIdx) -> DynamicBufferBinding { - size_t cbufIdx{desc.index + arrayIdx}; - return GetConstantBufferBinding(ctx, shaderInfo, stageConstantBuffers[cbufIdx].view, cbufIdx); - }); + [&](auto usage, const Shader::ConstantBufferDescriptor &desc, size_t arrayIdx) -> DynamicBufferBinding { + size_t cbufIdx{desc.index + arrayIdx}; + return GetConstantBufferBinding(ctx, shaderInfo, stageConstantBuffers[cbufIdx].view, cbufIdx); + }); writeDescs.operator()(vk::DescriptorType::eStorageBuffer, cbufUsageInfo.storageBuffers, shaderInfo.storage_buffers_descriptors, - [&](auto usage, const Shader::StorageBufferDescriptor &desc, size_t arrayIdx) { - return GetStorageBufferBinding(ctx, desc, stageConstantBuffers[desc.cbuf_index], storageBufferViews[usage.storageBufferIdx]); - }); + [&](auto usage, const Shader::StorageBufferDescriptor &desc, size_t arrayIdx) { + return GetStorageBufferBinding(ctx, desc, stageConstantBuffers[desc.cbuf_index], storageBufferViews[usage.storageBufferIdx]); + }); writeDescs.operator()(vk::DescriptorType::eCombinedImageSampler, cbufUsageInfo.combinedImageSamplers, shaderInfo.texture_descriptors, - [&](auto usage, const Shader::TextureDescriptor &desc, size_t arrayIdx) { - BindlessHandle handle{ReadBindlessHandle(ctx, stageConstantBuffers, desc, arrayIdx)}; - return GetTextureBinding(ctx, desc, samplers, textures, handle); - }); + [&](auto usage, const Shader::TextureDescriptor &desc, size_t arrayIdx) { + BindlessHandle handle{ReadBindlessHandle(ctx, stageConstantBuffers, desc, arrayIdx)}; + return GetTextureBinding(ctx, desc, samplers, textures, handle); + }); // Since we don't implement all descriptor types the number of writes might not match what's expected if (!writeIdx) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.h b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.h index f56ce002..44467437 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.h @@ -34,11 +34,11 @@ namespace skyline::gpu::interconnect::maxwell3d { */ bool BindingsEqual(const ShaderStage &other) const { return info.constant_buffer_descriptors == other.info.constant_buffer_descriptors && - info.storage_buffers_descriptors == other.info.storage_buffers_descriptors && - info.texture_buffer_descriptors == other.info.texture_buffer_descriptors && - info.image_buffer_descriptors == other.info.image_buffer_descriptors && - info.texture_descriptors == other.info.texture_descriptors && - info.image_descriptors == other.info.image_descriptors; + info.storage_buffers_descriptors == other.info.storage_buffers_descriptors && + info.texture_buffer_descriptors == other.info.texture_buffer_descriptors && + info.image_buffer_descriptors == other.info.image_buffer_descriptors && + info.texture_descriptors == other.info.texture_descriptors && + info.image_descriptors == other.info.image_descriptors; } }; diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/samplers.cpp b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/samplers.cpp index b7f7e018..e83233f8 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/samplers.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/samplers.cpp @@ -207,5 +207,4 @@ namespace skyline::gpu::interconnect::maxwell3d { return sampler.get(); } - } \ No newline at end of file diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/samplers.h b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/samplers.h index cb9bff8f..0f1a2e5e 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/samplers.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/samplers.h @@ -39,7 +39,6 @@ namespace skyline::gpu::interconnect::maxwell3d { tsl::robin_map, util::ObjectHash> texSamplerStore; std::vector texSamplerCache; - public: Samplers(DirtyManager &manager, const SamplerPoolState::EngineRegisters &engine); diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/state_updater.h b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/state_updater.h index 90a8b846..8c2bf347 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/state_updater.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/state_updater.h @@ -27,7 +27,7 @@ namespace skyline::gpu::interconnect::maxwell3d { Cmd cmd; CmdHolder(Cmd &&cmd) : cmd{cmd} {} - + CmdHolder() = default; static void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer, StateUpdateCmdHeader *header) { @@ -55,7 +55,7 @@ namespace skyline::gpu::interconnect::maxwell3d { base.buffers[i] = views[i].GetBuffer()->GetBacking(); base.offsets[i] = views[i].GetOffset(); } - + base.Record(gpu, commandBuffer); } @@ -68,7 +68,7 @@ namespace skyline::gpu::interconnect::maxwell3d { void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer) { commandBuffer.bindIndexBuffer(buffer, offset, indexType); } - + vk::Buffer buffer; vk::DeviceSize offset; vk::IndexType indexType; @@ -81,7 +81,7 @@ namespace skyline::gpu::interconnect::maxwell3d { base.offset = view.GetOffset(); base.Record(gpu, commandBuffer); } - + SetIndexBufferCmdImpl base; BufferView view; }; @@ -91,7 +91,7 @@ namespace skyline::gpu::interconnect::maxwell3d { void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer) { commandBuffer.bindTransformFeedbackBuffersEXT(binding, buffer, offset, size); } - + u32 binding; vk::Buffer buffer; vk::DeviceSize offset; @@ -105,7 +105,7 @@ namespace skyline::gpu::interconnect::maxwell3d { base.offset = view.GetOffset(); base.Record(gpu, commandBuffer); } - + SetTransformFeedbackBufferCmdImpl base; BufferView view; }; @@ -115,7 +115,7 @@ namespace skyline::gpu::interconnect::maxwell3d { void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer) { commandBuffer.setViewport(index, viewport); } - + u32 index; vk::Viewport viewport; }; @@ -125,17 +125,17 @@ namespace skyline::gpu::interconnect::maxwell3d { void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer) { commandBuffer.setScissor(index, scissor); } - + u32 index; vk::Rect2D scissor; }; using SetScissorCmd = CmdHolder; - + struct SetLineWidthCmdImpl { void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer) { commandBuffer.setLineWidth(lineWidth); } - + float lineWidth; }; using SetLineWidthCmd = CmdHolder; @@ -144,7 +144,7 @@ namespace skyline::gpu::interconnect::maxwell3d { void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer) { commandBuffer.setDepthBias(depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); } - + float depthBiasConstantFactor; float depthBiasClamp; float depthBiasSlopeFactor; @@ -155,7 +155,7 @@ namespace skyline::gpu::interconnect::maxwell3d { void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer) { commandBuffer.setBlendConstants(blendConstants.data()); } - + std::array blendConstants; }; using SetBlendConstantsCmd = CmdHolder; @@ -164,7 +164,7 @@ namespace skyline::gpu::interconnect::maxwell3d { void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer) { commandBuffer.setDepthBounds(minDepthBounds, maxDepthBounds); } - + float minDepthBounds; float maxDepthBounds; }; @@ -176,7 +176,7 @@ namespace skyline::gpu::interconnect::maxwell3d { commandBuffer.setStencilReference(flags, funcRef); commandBuffer.setStencilWriteMask(flags, mask); } - + vk::StencilFaceFlags flags; u32 funcRef; u32 funcMask; @@ -184,7 +184,8 @@ namespace skyline::gpu::interconnect::maxwell3d { }; using SetBaseStencilStateCmd = CmdHolder; - struct SetDescriptorSetWithUpdateCmdImpl { + template + struct SetDescriptorSetCmdImpl { void Record(GPU &gpu, vk::raii::CommandBuffer &commandBuffer) { // Resolve descriptor infos from dynamic bindings for (size_t i{}; i < updateInfo->bufferDescDynamicBindings.size(); i++) { @@ -245,7 +246,7 @@ namespace skyline::gpu::interconnect::maxwell3d { class StateUpdater { private: StateUpdateCmdHeader *first; - + public: StateUpdater(StateUpdateCmdHeader *first) : first{first} {} @@ -268,7 +269,7 @@ namespace skyline::gpu::interconnect::maxwell3d { SetVertexBuffersDynamicCmd *vertexBatchBind{}; StateUpdateCmdHeader *head{}; StateUpdateCmdHeader *tail{}; - + void AppendCmd(StateUpdateCmdHeader *cmd) { if (tail) { tail->next = cmd; @@ -278,7 +279,7 @@ namespace skyline::gpu::interconnect::maxwell3d { tail = head; } } - + template void AppendCmd(typename Cmd::CmdType &&contents) { Cmd *cmd{allocator.template EmplaceUntracked(std::forward(contents))}; @@ -332,101 +333,121 @@ namespace skyline::gpu::interconnect::maxwell3d { } void SetIndexBuffer(const BufferBinding &binding, vk::IndexType indexType) { - AppendCmd({ - .indexType = indexType, - .buffer = binding.buffer, - .offset = binding.offset, - }); + AppendCmd( + { + .indexType = indexType, + .buffer = binding.buffer, + .offset = binding.offset, + }); } void SetIndexBuffer(BufferView view, vk::IndexType indexType) { view.GetBuffer()->BlockSequencedCpuBackingWrites(); - AppendCmd({ - .base.indexType = indexType, - .view = view, - }); + AppendCmd( + { + .base.indexType = indexType, + .view = view, + }); } void SetTransformFeedbackBuffer(u32 index, const BufferBinding &binding) { - AppendCmd({ - .binding = index, - .buffer = binding.buffer, - .offset = binding.offset, - }); + AppendCmd( + { + .binding = index, + .buffer = binding.buffer, + .offset = binding.offset, + }); } void SetTransformFeedbackBuffer(u32 index, BufferView view) { view.GetBuffer()->BlockSequencedCpuBackingWrites(); - AppendCmd({ - .base.binding = index, - .view = view, - }); + AppendCmd( + { + .base.binding = index, + .view = view, + }); } void SetViewport(u32 index, const vk::Viewport &viewport) { - AppendCmd({ - .index = index, - .viewport = viewport, - }); + AppendCmd( + { + .index = index, + .viewport = viewport, + }); } void SetScissor(u32 index, const vk::Rect2D &scissor) { - AppendCmd({ - .index = index, - .scissor = scissor, - }); + AppendCmd( + { + .index = index, + .scissor = scissor, + }); } void SetLineWidth(float lineWidth) { - AppendCmd({ - .lineWidth = lineWidth, - }); + AppendCmd( + { + .lineWidth = lineWidth, + }); } void SetDepthBias(float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) { - AppendCmd({ - .depthBiasConstantFactor = depthBiasConstantFactor, - .depthBiasClamp = depthBiasClamp, - .depthBiasSlopeFactor = depthBiasSlopeFactor, - }); + AppendCmd( + { + .depthBiasConstantFactor = depthBiasConstantFactor, + .depthBiasClamp = depthBiasClamp, + .depthBiasSlopeFactor = depthBiasSlopeFactor, + }); } void SetBlendConstants(const std::array &blendConstants) { - AppendCmd({ - .blendConstants = blendConstants, - }); + AppendCmd( + { + .blendConstants = blendConstants, + }); } void SetDepthBounds(float minDepthBounds, float maxDepthBounds) { - AppendCmd({ - .minDepthBounds = minDepthBounds, - .maxDepthBounds = maxDepthBounds, - }); + AppendCmd( + { + .minDepthBounds = minDepthBounds, + .maxDepthBounds = maxDepthBounds, + }); } void SetBaseStencilState(vk::StencilFaceFlags flags, u32 funcRef, u32 funcMask, u32 mask) { - AppendCmd({ - .flags = flags, - .funcRef = funcRef, - .funcMask = funcMask, - .mask = mask, - }); + AppendCmd( + { + .flags = flags, + .funcRef = funcRef, + .funcMask = funcMask, + .mask = mask, + }); } void SetDescriptorSetWithUpdate(DescriptorUpdateInfo *updateInfo, DescriptorAllocator::ActiveDescriptorSet *dstSet, DescriptorAllocator::ActiveDescriptorSet *srcSet) { - AppendCmd({ - .updateInfo = updateInfo, - .srcSet = srcSet, - .dstSet = dstSet, - }); + AppendCmd( + { + .updateInfo = updateInfo, + .srcSet = srcSet, + .dstSet = dstSet, + }); } void SetPipeline(vk::Pipeline pipeline) { - AppendCmd({ - .pipeline = pipeline, - }); + AppendCmd( + { + .pipeline = pipeline, + }); + } + + void SetDescriptorSetWithPush(DescriptorUpdateInfo *updateInfo) { + AppendCmd( + { + .updateInfo = updateInfo, + }); } }; } diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/tic.h b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/tic.h index cdfe230b..c656eb5f 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/tic.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/tic.h @@ -200,7 +200,6 @@ namespace skyline::gpu::interconnect { e16to1 = 7, }; - // 0x00 struct FormatWord { static constexpr u32 FormatColorComponentPadMask{(1U << 31) | 0b111'111'111'111'1111111U}; //!< Mask for the format, component and pad fields diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/tsc.h b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/tsc.h index ae28812a..7ce333e2 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/tsc.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/tsc.h @@ -112,7 +112,7 @@ namespace skyline::gpu::interconnect { }; public: - bool operator==(const TextureSamplerControl&) const = default; + bool operator==(const TextureSamplerControl &) const = default; float MaxAnisotropy() { constexpr size_t AnisotropyCount{8}; //!< The amount of unique anisotropy values that can be represented (2^3 — 3-bit value)