Commit 21d079b8 authored by Niklas Haas's avatar Niklas Haas

shaders: hide `uint8_t ident` from `pl_shader_reset`

This was accidentally left exposed from a previous version of the API.
It makes no sense in the public-facing code, so move it to the private
`pl_shader_reset_ex`.

Also swap the order of parameters for consistency.
parent 1f8956f0
......@@ -2,7 +2,7 @@ project('libplacebo', ['c', 'cpp'],
license: 'LGPL2.1+',
default_options: ['c_std=c99'],
meson_version: '>=0.47',
version: '1.13.0',
version: '1.14.0',
)
# Version number
......
......@@ -121,7 +121,7 @@ struct pl_shader *pl_dispatch_begin_ex(struct pl_dispatch *dp, bool unique)
struct pl_shader *sh;
if (TARRAY_POP(dp->shaders, dp->num_shaders, &sh)) {
pl_shader_reset(sh, ident, dp->current_index);
pl_shader_reset_ex(sh, dp->current_index, ident);
return sh;
}
......
......@@ -53,7 +53,7 @@ void pl_shader_free(struct pl_shader **sh);
// Resets a pl_shader to a blank slate, without releasing internal memory.
// If you're going to be re-generating shaders often, this function will let
// you skip the re-allocation overhead.
void pl_shader_reset(struct pl_shader *sh, uint8_t ident, uint8_t index);
void pl_shader_reset(struct pl_shader *sh, uint8_t index);
// Returns whether or not a shader is in a "failed" state. Trying to modify a
// shader in illegal ways (e.g. signature mismatch) will result in the shader
......
......@@ -56,7 +56,7 @@ void pl_shader_free(struct pl_shader **psh)
TA_FREEP(psh);
}
void pl_shader_reset(struct pl_shader *sh, uint8_t ident, uint8_t index)
void pl_shader_reset_ex(struct pl_shader *sh, uint8_t index, uint8_t ident)
{
struct pl_shader new = {
.ctx = sh->ctx,
......@@ -82,6 +82,11 @@ void pl_shader_reset(struct pl_shader *sh, uint8_t ident, uint8_t index)
*sh = new;
}
void pl_shader_reset(struct pl_shader *sh, uint8_t index)
{
pl_shader_reset_ex(sh, index, 0);
}
bool pl_shader_is_failed(const struct pl_shader *sh)
{
return sh->failed;
......
......@@ -69,6 +69,9 @@ struct pl_shader *pl_shader_alloc_ex(struct pl_context *ctx,
const struct pl_gpu *gpu,
uint8_t index, uint8_t ident);
// Like `pl_shader_reset`, but also has this extra `uint8_t ident`.
void pl_shader_reset_ex(struct pl_shader *sh, uint8_t index, uint8_t ident);
// Attempt enabling compute shaders for this pass, if possible
bool sh_try_compute(struct pl_shader *sh, int bw, int bh, bool flex, size_t mem);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment