Skip to content

filter: fix YCBCR2RGBA shader compilation error from format mismatch#184

Open
crmurillo wants to merge 2 commits intoKhronosGroup:mainfrom
crmurillo:fix_ycbcr2rgba_filter
Open

filter: fix YCBCR2RGBA shader compilation error from format mismatch#184
crmurillo wants to merge 2 commits intoKhronosGroup:mainfrom
crmurillo:fix_ycbcr2rgba_filter

Conversation

@crmurillo
Copy link
Contributor

Description

When the filter YCBCR2RGBA is active, the output image of the filter was created with the decoder's output image format (YCbCr format), causing the shader generator to emit YCbCr output bindings instead of RGBA. This led to undeclared identifier errors at shader compile time.

This patch adds a function to retrieve the filter output format: GetOutputFormat().
The RGBA format is selected based on the bit-depth of the input format. Currently, R8G8B8A8 is selected for 8-bit and R16G16B16A16 for the rest. The function will be expanded when there are more tests for other bit-depths.

Also guard plane-view asserts for single-plane RGBA outputs.

Type of change

bug fix

Issue (optional)

Fixes #147

Tests

Intel(R) UHD Graphics 770 (ADL-S GT1) / Intel open-source Mesa driver Mesa 26.1.0-devel (git-055aec542e) / Ubuntu 24.04.4 LTS

Total Tests: 76
Passed: 51
Crashed: 0
Failed: 0
Not Supported: 16
Skipped: 9 (in skip list)
Success Rate: 100.0%

AMD Radeon RX 7600 (RADV NAVI33) / radv Mesa 26.1.0-devel (git-055aec542e) / Ubuntu 24.04.4 LTS

Total Tests: 76
Passed: 65
Crashed: 0
Failed: 0
Not Supported: 7
Skipped: 4 (in skip list)
Success Rate: 100.0%

NVIDIA GeForce RTX 4060 Ti / NVIDIA 595.44.00 / Ubuntu 22.04.5 LTS

Total Tests: 76
Passed: 64
Crashed: 0
Failed: 0
Not Supported: 10
Skipped: 2 (in skip list)
Success Rate: 100.0%

The output image of the filter was created with the decoder's outImageFormat (YCbCr
format), causing the shader generator to emit YCbCr output bindings
instead of RGBA, leading to undeclared identifier errors at
shader compile time. Add GetOutputFormat() to select the RGBA
format, currently,R8G8B8A8 for 8-bit and R16G16B16A16 for 10/12/16-bit inputs.
Also guard plane-view asserts for single-plane RGBA outputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

h264_clip_a_filter_ycbcr2rgba: calling --enablePostProcessFilter 2 result in a shader error

1 participant