Skip to content

Commit

Permalink
shaders: drop v5 deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
haasn committed Sep 30, 2023
1 parent a8b5e5d commit 9ece6d8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 36 deletions.
10 changes: 0 additions & 10 deletions src/include/libplacebo/shaders/colorspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ struct pl_peak_detect_params {
bool allow_delayed;

// --- Deprecated / removed fields
PL_DEPRECATED_IN(v5.256) float overshoot_margin;
PL_DEPRECATED_IN(v6.313) float minimum_peak;
};

Expand Down Expand Up @@ -185,15 +184,6 @@ PL_API bool pl_shader_detect_peak(pl_shader sh, struct pl_color_space csp,
PL_API bool pl_get_detected_hdr_metadata(const pl_shader_obj state,
struct pl_hdr_metadata *metadata);

// After dispatching the above shader, this function *may* be used to read out
// the detected CLL and FALL directly (in PL_HDR_NORM units). If the shader
// has never been dispatched yet, i.e. no information is available, this will
// return false.
//
// Deprecated in favor of `pl_get_detected_hdr_metadata`
PL_DEPRECATED_IN(v5.255) PL_API bool
pl_get_detected_peak(const pl_shader_obj state, float *out_cll, float *out_fall);

// Resets the peak detection state in a given tone mapping state object. This
// is not equal to `pl_shader_obj_destroy`, because it does not destroy any
// state used by `pl_shader_tone_map`.
Expand Down
6 changes: 0 additions & 6 deletions src/include/libplacebo/shaders/sampling.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,6 @@ PL_API extern const struct pl_distort_params pl_distort_default_params;
PL_API void pl_shader_distort(pl_shader sh, pl_tex tex, int out_w, int out_h,
const struct pl_distort_params *params);

enum PL_DEPRECATED_IN(v5.229) { // for `int pass`
PL_SEP_VERT = 0,
PL_SEP_HORIZ,
PL_SEP_PASSES
};

PL_API_END

#endif // LIBPLACEBO_SHADERS_SAMPLING_H_
13 changes: 0 additions & 13 deletions src/shaders/colorspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1410,19 +1410,6 @@ bool pl_get_detected_hdr_metadata(const pl_shader_obj state,
return true;
}

bool pl_get_detected_peak(const pl_shader_obj state,
float *out_peak, float *out_avg)
{
struct pl_hdr_metadata data;
if (!pl_get_detected_hdr_metadata(state, &data))
return false;

// Preserves old behavior
*out_peak = pl_hdr_rescale(PL_HDR_PQ, PL_HDR_NORM, data.max_pq_y);
*out_avg = pl_hdr_rescale(PL_HDR_PQ, PL_HDR_NORM, data.avg_pq_y);
return true;
}

void pl_reset_detected_peak(pl_shader_obj state)
{
if (!state || state->type != PL_SHADER_OBJ_COLOR_MAP)
Expand Down
11 changes: 4 additions & 7 deletions src/tests/gpu_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,8 @@ static void pl_shader_tests(pl_gpu gpu)
.height = fbo->params.h,
}));

float peak, avg;
REQUIRE(pl_get_detected_peak(peak_state, &peak, &avg));
struct pl_hdr_metadata hdr;
REQUIRE(pl_get_detected_hdr_metadata(peak_state, &hdr));

float real_peak = 0, real_avg = 0;
for (int y = 0; y < FBO_H; y++) {
Expand All @@ -669,11 +669,8 @@ static void pl_shader_tests(pl_gpu gpu)
}
}
real_avg = real_avg / (FBO_W * FBO_H);

real_avg = pl_hdr_rescale(PL_HDR_PQ, PL_HDR_NORM, real_avg);
real_peak = pl_hdr_rescale(PL_HDR_PQ, PL_HDR_NORM, real_peak);
REQUIRE_FEQ(peak, real_peak, 1e-3);
REQUIRE_FEQ(avg, real_avg, 1e-2);
REQUIRE_FEQ(hdr.max_pq_y, real_peak, 1e-4);
REQUIRE_FEQ(hdr.avg_pq_y, real_avg, 1e-3);
}

pl_dispatch_abort(dp, &sh);
Expand Down

0 comments on commit 9ece6d8

Please sign in to comment.