Flag shader blending as broken on Adreno for now.

This commit is contained in:
Henrik Rydgård 2022-09-16 19:18:38 +02:00
parent 5f5277a409
commit 262a306b9a
10 changed files with 30 additions and 13 deletions

View file

@ -789,7 +789,6 @@ VKContext::VKContext(VulkanContext *vulkan, bool splitSubmit)
caps_.textureNPOTFullySupported = true; caps_.textureNPOTFullySupported = true;
caps_.fragmentShaderDepthWriteSupported = true; caps_.fragmentShaderDepthWriteSupported = true;
caps_.logicOpSupported = vulkan->GetDeviceFeatures().enabled.logicOp != 0; caps_.logicOpSupported = vulkan->GetDeviceFeatures().enabled.logicOp != 0;
caps_.framebufferFetchSupported = true; // Limited, through input attachments and self-dependencies.
auto deviceProps = vulkan->GetPhysicalDeviceProperties(vulkan_->GetCurrentPhysicalDeviceIndex()).properties; auto deviceProps = vulkan->GetPhysicalDeviceProperties(vulkan_->GetCurrentPhysicalDeviceIndex()).properties;
switch (deviceProps.vendorID) { switch (deviceProps.vendorID) {
@ -813,6 +812,11 @@ VKContext::VKContext(VulkanContext *vulkan, bool splitSubmit)
// Color write mask not masking write in certain scenarios with a depth test, see #10421. // Color write mask not masking write in certain scenarios with a depth test, see #10421.
// Known still present on driver 0x80180000 and Adreno 5xx (possibly more.) // Known still present on driver 0x80180000 and Adreno 5xx (possibly more.)
bugs_.Infest(Bugs::COLORWRITEMASK_BROKEN_WITH_DEPTHTEST); bugs_.Infest(Bugs::COLORWRITEMASK_BROKEN_WITH_DEPTHTEST);
// Trying to follow all the rules in https://registry.khronos.org/vulkan/specs/1.3/html/vkspec.html#synchronization-pipeline-barriers-subpass-self-dependencies
// and https://registry.khronos.org/vulkan/specs/1.3/html/vkspec.html#renderpass-feedbackloop, but still it doesn't
// quite work - artifacts on triangle boundaries on Adreno.
bugs_.Infest(Bugs::SUBPASS_FEEDBACK_BROKEN);
} else if (caps_.vendor == GPUVendor::VENDOR_AMD) { } else if (caps_.vendor == GPUVendor::VENDOR_AMD) {
// See issue #10074, and also #10065 (AMD) and #10109 for the choice of the driver version to check for. // See issue #10074, and also #10065 (AMD) and #10109 for the choice of the driver version to check for.
if (deviceProps.driverVersion < 0x00407000) { if (deviceProps.driverVersion < 0x00407000) {
@ -839,6 +843,10 @@ VKContext::VKContext(VulkanContext *vulkan, bool splitSubmit)
} }
} }
// Limited, through input attachments and self-dependencies.
// We turn it off here already if buggy.
caps_.framebufferFetchSupported = !bugs_.Has(Bugs::SUBPASS_FEEDBACK_BROKEN);
caps_.deviceID = deviceProps.deviceID; caps_.deviceID = deviceProps.deviceID;
device_ = vulkan->GetDevice(); device_ = vulkan->GetDevice();

View file

@ -681,6 +681,7 @@ const char *Bugs::GetBugName(uint32_t bug) {
case MALI_STENCIL_DISCARD_BUG: return "MALI_STENCIL_DISCARD_BUG"; case MALI_STENCIL_DISCARD_BUG: return "MALI_STENCIL_DISCARD_BUG";
case RASPBERRY_SHADER_COMP_HANG: return "RASPBERRY_SHADER_COMP_HANG"; case RASPBERRY_SHADER_COMP_HANG: return "RASPBERRY_SHADER_COMP_HANG";
case MALI_CONSTANT_LOAD_BUG: return "MALI_CONSTANT_LOAD_BUG"; case MALI_CONSTANT_LOAD_BUG: return "MALI_CONSTANT_LOAD_BUG";
case SUBPASS_FEEDBACK_BROKEN: return "SUBPASS_FEEDBACK_BROKEN";
default: return "(N/A)"; default: return "(N/A)";
} }
} }

View file

@ -332,6 +332,7 @@ public:
MALI_STENCIL_DISCARD_BUG = 8, MALI_STENCIL_DISCARD_BUG = 8,
RASPBERRY_SHADER_COMP_HANG = 9, RASPBERRY_SHADER_COMP_HANG = 9,
MALI_CONSTANT_LOAD_BUG = 10, MALI_CONSTANT_LOAD_BUG = 10,
SUBPASS_FEEDBACK_BROKEN = 11,
MAX_BUG, MAX_BUG,
}; };

View file

@ -187,7 +187,7 @@ public:
disabled_ = *value_ < 0; disabled_ = *value_ < 0;
} }
const char *tag() const { return "SliderPopup"; } const char *tag() const override { return "SliderPopup"; }
Event OnChange; Event OnChange;
@ -216,7 +216,7 @@ public:
: PopupScreen(title, "OK", "Cancel"), units_(units), value_(value), originalValue_(*value), minValue_(minValue), maxValue_(maxValue), step_(step), changing_(false), liveUpdate_(liveUpdate) {} : PopupScreen(title, "OK", "Cancel"), units_(units), value_(value), originalValue_(*value), minValue_(minValue), maxValue_(maxValue), step_(step), changing_(false), liveUpdate_(liveUpdate) {}
void CreatePopupContents(UI::ViewGroup *parent) override; void CreatePopupContents(UI::ViewGroup *parent) override;
const char *tag() const { return "SliderFloatPopup"; } const char *tag() const override { return "SliderFloatPopup"; }
Event OnChange; Event OnChange;
@ -245,7 +245,7 @@ public:
: PopupScreen(title, "OK", "Cancel"), value_(value), placeholder_(placeholder), maxLen_(maxLen) {} : PopupScreen(title, "OK", "Cancel"), value_(value), placeholder_(placeholder), maxLen_(maxLen) {}
virtual void CreatePopupContents(ViewGroup *parent) override; virtual void CreatePopupContents(ViewGroup *parent) override;
const char *tag() const { return "TextEditPopup"; } const char *tag() const override { return "TextEditPopup"; }
Event OnChange; Event OnChange;

View file

@ -153,23 +153,21 @@ void DrawEngineD3D11::ApplyDrawState(int prim) {
// We ignore the logicState on D3D since there's no support, the emulation of it is blend-and-shader only. // We ignore the logicState on D3D since there's no support, the emulation of it is blend-and-shader only.
if (pipelineState_.FramebufferRead()) { if (pipelineState_.FramebufferRead()) {
FBOTexState fboTexBindState_ = FBO_TEX_NONE; FBOTexState fboTexBindState = FBO_TEX_NONE;
ApplyFramebufferRead(&fboTexBindState_); ApplyFramebufferRead(&fboTexBindState);
// The shader takes over the responsibility for blending, so recompute. // The shader takes over the responsibility for blending, so recompute.
ApplyStencilReplaceAndLogicOpIgnoreBlend(blendState.replaceAlphaWithStencil, blendState); ApplyStencilReplaceAndLogicOpIgnoreBlend(blendState.replaceAlphaWithStencil, blendState);
if (fboTexBindState_ == FBO_TEX_COPY_BIND_TEX) { if (fboTexBindState == FBO_TEX_COPY_BIND_TEX) {
framebufferManager_->BindFramebufferAsColorTexture(1, framebufferManager_->GetCurrentRenderVFB(), BINDFBCOLOR_MAY_COPY); framebufferManager_->BindFramebufferAsColorTexture(1, framebufferManager_->GetCurrentRenderVFB(), BINDFBCOLOR_MAY_COPY);
// No sampler required, we do a plain Load in the pixel shader. // No sampler required, we do a plain Load in the pixel shader.
fboTexBound_ = true; fboTexBound_ = true;
fboTexBindState_ = FBO_TEX_NONE; fboTexBindState = FBO_TEX_NONE;
framebufferManager_->RebindFramebuffer("RebindFramebuffer - ApplyDrawState"); framebufferManager_->RebindFramebuffer("RebindFramebuffer - ApplyDrawState");
// Must dirty blend state here so we re-copy next time. Example: Lunar's spell effects. // Must dirty blend state here so we re-copy next time. Example: Lunar's spell effects.
dirtyRequiresRecheck_ |= DIRTY_BLEND_STATE; dirtyRequiresRecheck_ |= DIRTY_BLEND_STATE;
gstate_c.Dirty(DIRTY_BLEND_STATE); gstate_c.Dirty(DIRTY_BLEND_STATE);
} else if (fboTexBindState_ == FBO_TEX_READ_FRAMEBUFFER) {
fboTexBindState_ = FBO_TEX_NONE;
} }
dirtyRequiresRecheck_ |= DIRTY_FRAGMENTSHADER_STATE; dirtyRequiresRecheck_ |= DIRTY_FRAGMENTSHADER_STATE;

View file

@ -389,6 +389,7 @@ VkDescriptorSet DrawEngineVulkan::GetOrCreateDescriptorSet(VkImageView imageView
key.base_ = base; key.base_ = base;
key.light_ = light; key.light_ = light;
key.bone_ = bone; key.bone_ = bone;
key.secondaryIsInputAttachment = boundSecondaryIsInputAttachment_;
FrameData &frame = GetCurFrame(); FrameData &frame = GetCurFrame();
// See if we already have this descriptor set cached. // See if we already have this descriptor set cached.

View file

@ -217,6 +217,8 @@ private:
// Secondary texture for shader blending // Secondary texture for shader blending
VkImageView boundSecondary_ = VK_NULL_HANDLE; VkImageView boundSecondary_ = VK_NULL_HANDLE;
bool boundSecondaryIsInputAttachment_ = false;
// CLUT texture for shader depal // CLUT texture for shader depal
VkImageView boundDepal_ = VK_NULL_HANDLE; VkImageView boundDepal_ = VK_NULL_HANDLE;
bool boundDepalSmoothed_ = false; bool boundDepalSmoothed_ = false;

View file

@ -229,8 +229,10 @@ void GPU_Vulkan::CheckGPUFeatures() {
features |= GPU_SUPPORTS_TEXTURE_FLOAT; features |= GPU_SUPPORTS_TEXTURE_FLOAT;
features |= GPU_SUPPORTS_DEPTH_TEXTURE; features |= GPU_SUPPORTS_DEPTH_TEXTURE;
// input attachments // through input attachments, when not broken.
features |= GPU_SUPPORTS_ANY_FRAMEBUFFER_FETCH; if (draw_->GetDeviceCaps().framebufferFetchSupported) {
features |= GPU_SUPPORTS_ANY_FRAMEBUFFER_FETCH;
}
auto &enabledFeatures = vulkan->GetDeviceFeatures().enabled; auto &enabledFeatures = vulkan->GetDeviceFeatures().enabled;
if (enabledFeatures.depthClamp) { if (enabledFeatures.depthClamp) {

View file

@ -368,6 +368,7 @@ void DrawEngineVulkan::BindShaderBlendTex() {
bool bindResult = framebufferManager_->BindFramebufferAsColorTexture(1, framebufferManager_->GetCurrentRenderVFB(), BINDFBCOLOR_MAY_COPY); bool bindResult = framebufferManager_->BindFramebufferAsColorTexture(1, framebufferManager_->GetCurrentRenderVFB(), BINDFBCOLOR_MAY_COPY);
_dbg_assert_(bindResult); _dbg_assert_(bindResult);
boundSecondary_ = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::BOUND_TEXTURE1_IMAGEVIEW); boundSecondary_ = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::BOUND_TEXTURE1_IMAGEVIEW);
boundSecondaryIsInputAttachment_ = false;
fboTexBound_ = true; fboTexBound_ = true;
fboTexBindState_ = FBO_TEX_NONE; fboTexBindState_ = FBO_TEX_NONE;
@ -376,7 +377,10 @@ void DrawEngineVulkan::BindShaderBlendTex() {
} else if (fboTexBindState_ == FBO_TEX_READ_FRAMEBUFFER) { } else if (fboTexBindState_ == FBO_TEX_READ_FRAMEBUFFER) {
draw_->BindCurrentFramebufferForColorInput(); draw_->BindCurrentFramebufferForColorInput();
boundSecondary_ = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW); boundSecondary_ = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW);
boundSecondaryIsInputAttachment_ = true;
fboTexBindState_ = FBO_TEX_NONE; fboTexBindState_ = FBO_TEX_NONE;
} else {
boundSecondary_ = VK_NULL_HANDLE;
} }
} }
} }

View file

@ -30,7 +30,7 @@ public:
virtual void update() override; virtual void update() override;
virtual bool key(const KeyInput &key) override; virtual bool key(const KeyInput &key) override;
const char *tag() const { return "install_zip"; } const char *tag() const override { return "install_zip"; }
protected: protected:
virtual void CreateViews() override; virtual void CreateViews() override;