Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/platform/linux/cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ namespace cuda {
* @brief Configures shader parameters for the specified colorspace.
*/
void apply_colorspace() override {
sws.apply_colorspace(colorspace);
sws.apply_colorspace(colorspace, is_yuv444);
}

file_t file;
Expand Down
10 changes: 6 additions & 4 deletions src/platform/linux/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ namespace egl {
return yuv444;
}

void sws_t::apply_colorspace(const video::sunshine_colorspace_t &colorspace) {
void sws_t::apply_colorspace(const video::sunshine_colorspace_t &colorspace, bool is_yuv444) {
auto color_p = video::color_vectors_from_colorspace(colorspace, true);

std::string_view members[] {
Expand All @@ -869,9 +869,11 @@ namespace egl {

color_matrix.update(members, sizeof(members) / sizeof(decltype(members[0])));

program[0].bind(color_matrix);
program[1].bind(color_matrix);
program[2].bind(color_matrix);
int planesCount = is_yuv444 ? 3 : 2;

for (int i = 0; i < planesCount; i++) {
program[i].bind(color_matrix);
}
}

int configure_sws_pipeline(sws_t &sws, const video::color_t *color_p, gl::tex_t &&tex, bool is_yuv444) {
Expand Down
2 changes: 1 addition & 1 deletion src/platform/linux/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ namespace egl {
void load_ram(platf::img_t &img);
void load_vram(img_descriptor_t &img, int offset_x, int offset_y, int texture, bool is_yuv444);

void apply_colorspace(const video::sunshine_colorspace_t &colorspace);
void apply_colorspace(const video::sunshine_colorspace_t &colorspace, bool is_yuv444);

// The first texture is the monitor image.
// The second texture is the cursor image
Expand Down
2 changes: 1 addition & 1 deletion src/platform/linux/vaapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ namespace va {
}

void apply_colorspace() override {
sws.apply_colorspace(colorspace);
sws.apply_colorspace(colorspace, false);
}

va::display_t::pointer va_display;
Expand Down
Loading