Only sample directly from the video decoder output texture on Intel GPUs

This technique seems to actually make performance worse on some AMD GPUs (RX 480)
and causes rendering errors on others (HD 5570). These might be AMD-specific bugs
but let's not risk a behavior change for AMD/NVIDIA where nobody was having perf
issues with the old copy method anyway.
This commit is contained in:
Cameron Gutman
2024-06-29 14:44:08 -05:00
parent 0abb9fd7c2
commit 335ed0e8e6
2 changed files with 138 additions and 25 deletions
@@ -29,7 +29,8 @@ private:
static void unlockContext(void* lock_ctx);
bool setupRenderingResources();
bool setupTexturePoolViews(AVD3D11VAFramesContext* frameContext);
bool setupVideoTexture(); // for !m_BindDecoderOutputTextures
bool setupTexturePoolViews(AVD3D11VAFramesContext* frameContext); // for m_BindDecoderOutputTextures
void renderOverlay(Overlay::OverlayType type);
void bindColorConversion(AVFrame* frame);
void renderVideo(AVFrame* frame);
@@ -46,6 +47,7 @@ private:
ID3D11DeviceContext* m_DeviceContext;
ID3D11RenderTargetView* m_RenderTargetView;
SDL_mutex* m_ContextLock;
bool m_BindDecoderOutputTextures;
DECODER_PARAMETERS m_DecoderParams;
int m_TextureAlignment;
@@ -62,6 +64,10 @@ private:
ID3D11PixelShader* m_VideoBt2020LimPixelShader;
ID3D11Buffer* m_VideoVertexBuffer;
// Only valid if !m_BindDecoderOutputTextures
ID3D11Texture2D* m_VideoTexture;
// Only index 0 is valid if !m_BindDecoderOutputTextures
#define DECODER_BUFFER_POOL_SIZE 17
ID3D11ShaderResourceView* m_VideoTextureResourceViews[DECODER_BUFFER_POOL_SIZE][2];