Skip to content

Commit

Permalink
[d3d12] build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PanosK92 committed Dec 18, 2024
1 parent c5201ea commit 65307be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions runtime/RHI/RHI_SwapChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

namespace Spartan
{
static const uint8_t max_buffer_count = 3;
static const RHI_Format format_sdr = RHI_Format::R8G8B8A8_Unorm;
static const RHI_Format format_hdr = RHI_Format::R10G10B10A2_Unorm;

class RHI_SwapChain : public SpartanObject
{
public:
Expand Down Expand Up @@ -76,6 +72,10 @@ namespace Spartan
RHI_Image_Layout GetLayout() const;
void SetLayout(const RHI_Image_Layout& layout, RHI_CommandList* cmd_list);

static const uint8_t max_buffer_count = 3;
static const RHI_Format format_sdr = RHI_Format::R8G8B8A8_Unorm;
static const RHI_Format format_hdr = RHI_Format::R10G10B10A2_Unorm;

private:
void Create();
void Destroy();
Expand All @@ -94,8 +94,8 @@ namespace Spartan
uint32_t m_image_index = std::numeric_limits<uint32_t>::max();
void* m_sdl_window = nullptr;
std::array<RHI_Image_Layout, max_buffer_count> m_layouts = { RHI_Image_Layout::Max };
std::array<std::unique_ptr<RHI_SyncPrimitive>, max_buffer_count> m_image_acquired_semaphore;
std::array<std::unique_ptr<RHI_SyncPrimitive>, max_buffer_count> m_image_acquired_fence;
std::array<std::shared_ptr<RHI_SyncPrimitive>, max_buffer_count> m_image_acquired_semaphore;
std::array<std::shared_ptr<RHI_SyncPrimitive>, max_buffer_count> m_image_acquired_fence;
std::vector<RHI_SyncPrimitive*> m_wait_semaphores;

// rhi
Expand Down
6 changes: 3 additions & 3 deletions runtime/RHI/Vulkan/Vulkan_SwapChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ namespace Spartan
create_info.components.b = VK_COMPONENT_SWIZZLE_IDENTITY;
create_info.components.a = VK_COMPONENT_SWIZZLE_IDENTITY;

SP_ASSERT_MSG(vkCreateImageView(RHI_Context::device, &create_info, nullptr, reinterpret_cast<VkImageView*>(&m_rhi_rtv[i])) == VK_SUCCESS, "Failed to create swapchain RTV");
SP_ASSERT_VK(vkCreateImageView(RHI_Context::device, &create_info, nullptr, reinterpret_cast<VkImageView*>(&m_rhi_rtv[i])));
}
}

Expand All @@ -344,8 +344,8 @@ namespace Spartan
for (uint32_t i = 0; i < m_buffer_count; i++)
{
string name = (string("swapchain_image_acquired_") + to_string(i));
m_image_acquired_semaphore[i] = make_unique<RHI_SyncPrimitive>(RHI_SyncPrimitive_Type::Semaphore, name.c_str());
m_image_acquired_fence[i] = make_unique<RHI_SyncPrimitive>(RHI_SyncPrimitive_Type::Fence, name.c_str());
m_image_acquired_semaphore[i] = make_shared<RHI_SyncPrimitive>(RHI_SyncPrimitive_Type::Semaphore, name.c_str());
m_image_acquired_fence[i] = make_shared<RHI_SyncPrimitive>(RHI_SyncPrimitive_Type::Fence, name.c_str());
}
}

Expand Down

0 comments on commit 65307be

Please sign in to comment.