mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
Merge remote-tracking branch 'remotes/origin/vulkan2'
This commit is contained in:
commit
90cc0cf35b
6 changed files with 13 additions and 11 deletions
|
@ -868,7 +868,7 @@ void GLPPRenderState::Draw()
|
||||||
|
|
||||||
const PPTextureInput &input = Textures[index];
|
const PPTextureInput &input = Textures[index];
|
||||||
int filter = (input.Filter == PPFilterMode::Nearest) ? GL_NEAREST : GL_LINEAR;
|
int filter = (input.Filter == PPFilterMode::Nearest) ? GL_NEAREST : GL_LINEAR;
|
||||||
int wrap = (input.Wrap == PPWrapMode::Clamp) ? GL_CLAMP : GL_REPEAT;
|
int wrap = (input.Wrap == PPWrapMode::Clamp) ? GL_CLAMP_TO_EDGE : GL_REPEAT;
|
||||||
|
|
||||||
switch (input.Type)
|
switch (input.Type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -173,7 +173,7 @@ void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
|
||||||
PalEntry color1 = side->GetSpecialColor(tierndx, side_t::walltop, frontsector);
|
PalEntry color1 = side->GetSpecialColor(tierndx, side_t::walltop, frontsector);
|
||||||
PalEntry color2 = side->GetSpecialColor(tierndx, side_t::wallbottom, frontsector);
|
PalEntry color2 = side->GetSpecialColor(tierndx, side_t::wallbottom, frontsector);
|
||||||
state.SetObjectColor(color1);
|
state.SetObjectColor(color1);
|
||||||
state.SetObjectColor2((color1 != color2) ? color2 : 0);
|
state.SetObjectColor2((color1 != color2) ? color2 : PalEntry(0));
|
||||||
state.SetAddColor(side->GetAdditiveColor(tierndx, frontsector));
|
state.SetAddColor(side->GetAdditiveColor(tierndx, frontsector));
|
||||||
if (color1 != color2)
|
if (color1 != color2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -287,7 +287,7 @@ void VkPostprocess::RenderBuffersReset()
|
||||||
|
|
||||||
VulkanSampler *VkPostprocess::GetSampler(PPFilterMode filter, PPWrapMode wrap)
|
VulkanSampler *VkPostprocess::GetSampler(PPFilterMode filter, PPWrapMode wrap)
|
||||||
{
|
{
|
||||||
int index = (((int)filter) << 2) | (int)wrap;
|
int index = (((int)filter) << 1) | (int)wrap;
|
||||||
auto &sampler = mSamplers[index];
|
auto &sampler = mSamplers[index];
|
||||||
if (sampler)
|
if (sampler)
|
||||||
return sampler.get();
|
return sampler.get();
|
||||||
|
|
|
@ -75,7 +75,7 @@ private:
|
||||||
|
|
||||||
VulkanSampler *GetSampler(PPFilterMode filter, PPWrapMode wrap);
|
VulkanSampler *GetSampler(PPFilterMode filter, PPWrapMode wrap);
|
||||||
|
|
||||||
std::array<std::unique_ptr<VulkanSampler>, 16> mSamplers;
|
std::array<std::unique_ptr<VulkanSampler>, 4> mSamplers;
|
||||||
std::map<VkPPRenderPassKey, std::unique_ptr<VkPPRenderPassSetup>> mRenderPassSetup;
|
std::map<VkPPRenderPassKey, std::unique_ptr<VkPPRenderPassSetup>> mRenderPassSetup;
|
||||||
std::unique_ptr<VulkanDescriptorPool> mDescriptorPool;
|
std::unique_ptr<VulkanDescriptorPool> mDescriptorPool;
|
||||||
int mCurrentPipelineImage = 0;
|
int mCurrentPipelineImage = 0;
|
||||||
|
|
|
@ -191,7 +191,7 @@ void VulkanFrameBuffer::DeleteFrameObjects()
|
||||||
FrameDeleteList.CommandBuffers.clear();
|
FrameDeleteList.CommandBuffers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanFrameBuffer::FlushCommands(VulkanCommandBuffer **commands, size_t count, bool finish)
|
void VulkanFrameBuffer::FlushCommands(VulkanCommandBuffer **commands, size_t count, bool finish, bool lastsubmit)
|
||||||
{
|
{
|
||||||
int currentIndex = mNextSubmit % maxConcurrentSubmitCount;
|
int currentIndex = mNextSubmit % maxConcurrentSubmitCount;
|
||||||
|
|
||||||
|
@ -215,12 +215,14 @@ void VulkanFrameBuffer::FlushCommands(VulkanCommandBuffer **commands, size_t cou
|
||||||
submit.addSignal(mRenderFinishedSemaphore.get());
|
submit.addSignal(mRenderFinishedSemaphore.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!lastsubmit)
|
||||||
submit.addSignal(mSubmitSemaphore[currentIndex].get());
|
submit.addSignal(mSubmitSemaphore[currentIndex].get());
|
||||||
|
|
||||||
submit.execute(device, device->graphicsQueue, mSubmitFence[currentIndex].get());
|
submit.execute(device, device->graphicsQueue, mSubmitFence[currentIndex].get());
|
||||||
mNextSubmit++;
|
mNextSubmit++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanFrameBuffer::FlushCommands(bool finish)
|
void VulkanFrameBuffer::FlushCommands(bool finish, bool lastsubmit)
|
||||||
{
|
{
|
||||||
if (mDrawCommands || mTransferCommands)
|
if (mDrawCommands || mTransferCommands)
|
||||||
{
|
{
|
||||||
|
@ -241,7 +243,7 @@ void VulkanFrameBuffer::FlushCommands(bool finish)
|
||||||
FrameDeleteList.CommandBuffers.push_back(std::move(mDrawCommands));
|
FrameDeleteList.CommandBuffers.push_back(std::move(mDrawCommands));
|
||||||
}
|
}
|
||||||
|
|
||||||
FlushCommands(commands, count, finish);
|
FlushCommands(commands, count, finish, lastsubmit);
|
||||||
|
|
||||||
current_rendered_commandbuffers += (int)count;
|
current_rendered_commandbuffers += (int)count;
|
||||||
}
|
}
|
||||||
|
@ -259,7 +261,7 @@ void VulkanFrameBuffer::WaitForCommands(bool finish)
|
||||||
mPostprocess->DrawPresentTexture(mOutputLetterbox, true, true);
|
mPostprocess->DrawPresentTexture(mOutputLetterbox, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
FlushCommands(finish);
|
FlushCommands(finish, true);
|
||||||
|
|
||||||
if (finish)
|
if (finish)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
VkPostprocess *GetPostprocess() { return mPostprocess.get(); }
|
VkPostprocess *GetPostprocess() { return mPostprocess.get(); }
|
||||||
VkRenderBuffers *GetBuffers() { return mActiveRenderBuffers; }
|
VkRenderBuffers *GetBuffers() { return mActiveRenderBuffers; }
|
||||||
|
|
||||||
void FlushCommands(bool finish);
|
void FlushCommands(bool finish, bool lastsubmit = false);
|
||||||
|
|
||||||
unsigned int GetLightBufferBlockSize() const;
|
unsigned int GetLightBufferBlockSize() const;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ private:
|
||||||
void CopyScreenToBuffer(int w, int h, void *data);
|
void CopyScreenToBuffer(int w, int h, void *data);
|
||||||
void UpdateShadowMap();
|
void UpdateShadowMap();
|
||||||
void DeleteFrameObjects();
|
void DeleteFrameObjects();
|
||||||
void FlushCommands(VulkanCommandBuffer **commands, size_t count, bool finish);
|
void FlushCommands(VulkanCommandBuffer **commands, size_t count, bool finish, bool lastsubmit);
|
||||||
|
|
||||||
std::unique_ptr<VkShaderManager> mShaderManager;
|
std::unique_ptr<VkShaderManager> mShaderManager;
|
||||||
std::unique_ptr<VkSamplerManager> mSamplerManager;
|
std::unique_ptr<VkSamplerManager> mSamplerManager;
|
||||||
|
|
Loading…
Reference in a new issue