mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-05 11:27:06 +02:00
[vulkan] Adjusted not indexed Quad's handling for QuadStrip + Adjusted Quad's calculations for LUT
This commit is contained in:
parent
d835cab32d
commit
610e9eb516
1 changed files with 11 additions and 1 deletions
|
|
@ -231,7 +231,7 @@ public:
|
||||||
const VkIndexType index_type_ = index_type;
|
const VkIndexType index_type_ = index_type;
|
||||||
const size_t sub_first_offset = static_cast<size_t>(first % 4) * GetQuadsNum(num_indices);
|
const size_t sub_first_offset = static_cast<size_t>(first % 4) * GetQuadsNum(num_indices);
|
||||||
const size_t offset =
|
const size_t offset =
|
||||||
(sub_first_offset + GetQuadsNum(first)) * 6ULL * BytesPerIndex(index_type);
|
(sub_first_offset + GetFirstOffsetQuads(first)) * 6ULL * BytesPerIndex(index_type);
|
||||||
scheduler.Record([buffer_ = *buffer, index_type_, offset](vk::CommandBuffer cmdbuf) {
|
scheduler.Record([buffer_ = *buffer, index_type_, offset](vk::CommandBuffer cmdbuf) {
|
||||||
cmdbuf.BindIndexBuffer(buffer_, offset, index_type_);
|
cmdbuf.BindIndexBuffer(buffer_, offset, index_type_);
|
||||||
});
|
});
|
||||||
|
|
@ -240,6 +240,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
virtual u32 GetQuadsNum(u32 num_indices) const = 0;
|
virtual u32 GetQuadsNum(u32 num_indices) const = 0;
|
||||||
|
|
||||||
|
virtual u32 GetFirstOffsetQuads(u32 first) const = 0;
|
||||||
|
|
||||||
virtual void MakeAndUpdateIndices(u8* staging_data, size_t quad_size, u32 quad, u32 first) = 0;
|
virtual void MakeAndUpdateIndices(u8* staging_data, size_t quad_size, u32 quad, u32 first) = 0;
|
||||||
|
|
||||||
const Device& device;
|
const Device& device;
|
||||||
|
|
@ -266,6 +268,10 @@ private:
|
||||||
return num_indices_ / 4;
|
return num_indices_ / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 GetFirstOffsetQuads(u32 first) const override {
|
||||||
|
return first / 4;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static std::array<T, 6> MakeIndices(u32 quad, u32 first) {
|
static std::array<T, 6> MakeIndices(u32 quad, u32 first) {
|
||||||
std::array<T, 6> indices{0, 1, 2, 0, 2, 3};
|
std::array<T, 6> indices{0, 1, 2, 0, 2, 3};
|
||||||
|
|
@ -306,6 +312,10 @@ private:
|
||||||
return num_indices_ >= 4 ? (num_indices_ - 2) / 2 : 0;
|
return num_indices_ >= 4 ? (num_indices_ - 2) / 2 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 GetFirstOffsetQuads(u32 first) const override {
|
||||||
|
return (first / 4) * 2;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static std::array<T, 6> MakeIndices(u32 quad, u32 first) {
|
static std::array<T, 6> MakeIndices(u32 quad, u32 first) {
|
||||||
std::array<T, 6> indices{0, 3, 1, 0, 2, 3};
|
std::array<T, 6> indices{0, 3, 1, 0, 2, 3};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue