mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
freedreno: Moar header C++-proofing
Signed-off-by: Rob Clark <robdclark@chromium.org> Acked-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>
This commit is contained in:
parent
133a3e4dd3
commit
27fe7d8fb4
3 changed files with 49 additions and 10 deletions
|
|
@ -37,6 +37,10 @@
|
|||
#include "freedreno_fence.h"
|
||||
#include "freedreno_util.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#define BATCH_DEBUG FD_DBG(MSGS)
|
||||
#else
|
||||
|
|
@ -416,12 +420,18 @@ fd_event_write(struct fd_batch *batch, struct fd_ringbuffer *ring,
|
|||
static inline struct fd_ringbuffer *
|
||||
fd_batch_get_epilogue(struct fd_batch *batch)
|
||||
{
|
||||
if (batch->epilogue == NULL)
|
||||
batch->epilogue = fd_submit_new_ringbuffer(batch->submit, 0x1000, 0);
|
||||
if (batch->epilogue == NULL) {
|
||||
batch->epilogue = fd_submit_new_ringbuffer(batch->submit, 0x1000,
|
||||
(enum fd_ringbuffer_flags)0);
|
||||
}
|
||||
|
||||
return batch->epilogue;
|
||||
}
|
||||
|
||||
struct fd_ringbuffer *fd_batch_get_prologue(struct fd_batch *batch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FREEDRENO_BATCH_H_ */
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@
|
|||
#include "freedreno_screen.h"
|
||||
#include "freedreno_util.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BORDER_COLOR_UPLOAD_SIZE (2 * PIPE_MAX_SAMPLERS * BORDERCOLOR_SIZE)
|
||||
|
||||
struct fd_vertex_stateobj;
|
||||
|
|
@ -576,6 +580,19 @@ fd_context_dirty_resource(enum fd_dirty_3d_state dirty)
|
|||
FD_DIRTY_TEX | FD_DIRTY_STREAMOUT);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define or_dirty(d, mask) \
|
||||
do { \
|
||||
decltype(mask) _d = (d); \
|
||||
d = (decltype(mask))(_d | (mask)); \
|
||||
} while (0)
|
||||
#else
|
||||
#define or_dirty(d, mask) \
|
||||
do { \
|
||||
d |= (mask); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/* Mark specified non-shader-stage related state as dirty: */
|
||||
static inline void
|
||||
fd_context_dirty(struct fd_context *ctx, enum fd_dirty_3d_state dirty) assert_dt
|
||||
|
|
@ -586,9 +603,9 @@ fd_context_dirty(struct fd_context *ctx, enum fd_dirty_3d_state dirty) assert_dt
|
|||
ctx->gen_dirty |= ctx->gen_dirty_map[ffs(dirty) - 1];
|
||||
|
||||
if (fd_context_dirty_resource(dirty))
|
||||
dirty |= FD_DIRTY_RESOURCE;
|
||||
or_dirty(dirty, FD_DIRTY_RESOURCE);
|
||||
|
||||
ctx->dirty |= dirty;
|
||||
or_dirty(ctx->dirty, dirty);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
@ -612,7 +629,7 @@ fd_context_dirty_shader(struct fd_context *ctx, enum pipe_shader_type shader,
|
|||
|
||||
ctx->gen_dirty |= ctx->gen_dirty_shader_map[shader][ffs(dirty) - 1];
|
||||
|
||||
ctx->dirty_shader[shader] |= dirty;
|
||||
or_dirty(ctx->dirty_shader[shader], dirty);
|
||||
fd_context_dirty(ctx, map[ffs(dirty) - 1]);
|
||||
}
|
||||
|
||||
|
|
@ -621,7 +638,7 @@ static inline void
|
|||
fd_context_all_dirty(struct fd_context *ctx) assert_dt
|
||||
{
|
||||
ctx->last.dirty = true;
|
||||
ctx->dirty = ~0;
|
||||
ctx->dirty = (enum fd_dirty_3d_state) ~0;
|
||||
|
||||
/* NOTE: don't use ~0 for gen_dirty, because the gen specific
|
||||
* emit code will loop over all the bits:
|
||||
|
|
@ -629,14 +646,14 @@ fd_context_all_dirty(struct fd_context *ctx) assert_dt
|
|||
ctx->gen_dirty = ctx->gen_all_dirty;
|
||||
|
||||
for (unsigned i = 0; i < PIPE_SHADER_TYPES; i++)
|
||||
ctx->dirty_shader[i] = ~0;
|
||||
ctx->dirty_shader[i] = (enum fd_dirty_shader_state) ~0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
fd_context_all_clean(struct fd_context *ctx) assert_dt
|
||||
{
|
||||
ctx->last.dirty = false;
|
||||
ctx->dirty = 0;
|
||||
ctx->dirty = (enum fd_dirty_3d_state)0;
|
||||
ctx->gen_dirty = 0;
|
||||
for (unsigned i = 0; i < PIPE_SHADER_TYPES; i++) {
|
||||
/* don't mark compute state as clean, since it is not emitted
|
||||
|
|
@ -646,7 +663,7 @@ fd_context_all_clean(struct fd_context *ctx) assert_dt
|
|||
*/
|
||||
if (i == PIPE_SHADER_COMPUTE)
|
||||
continue;
|
||||
ctx->dirty_shader[i] = 0;
|
||||
ctx->dirty_shader[i] = (enum fd_dirty_shader_state)0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -710,4 +727,8 @@ struct pipe_context *fd_context_init_tc(struct pipe_context *pctx,
|
|||
|
||||
void fd_context_destroy(struct pipe_context *pctx) assert_dt;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FREEDRENO_CONTEXT_H_ */
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@
|
|||
#include "adreno_pm4.xml.h"
|
||||
#include "disasm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum adreno_rb_depth_format fd_pipe2depth(enum pipe_format format);
|
||||
enum pc_di_index_size fd_pipe2index(enum pipe_format format);
|
||||
enum pipe_format fd_gmem_restore_format(enum pipe_format format);
|
||||
|
|
@ -458,7 +462,7 @@ fd4_stage2shadersb(gl_shader_stage type)
|
|||
return SB4_CS_SHADER;
|
||||
default:
|
||||
unreachable("bad shader type");
|
||||
return ~0;
|
||||
return (enum a4xx_state_block) ~0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -478,4 +482,8 @@ fd4_size2indextype(unsigned index_size)
|
|||
return INDEX4_SIZE_32_BIT;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FREEDRENO_UTIL_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue