mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
gallium,util: Move blend enums to util/
For sharing across the tree. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Italo Nicola <italonicola@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
This commit is contained in:
parent
b0313d9f09
commit
02868c9e77
4 changed files with 66 additions and 52 deletions
|
|
@ -465,7 +465,7 @@ endif
|
|||
prog_enums2names = files('driver_trace/enums2names.py')
|
||||
files_libgallium += custom_target(
|
||||
'tr_util.[ch]',
|
||||
input: '../include/pipe/p_defines.h',
|
||||
input: ['../include/pipe/p_defines.h', '../../util/blend.h'],
|
||||
output: ['tr_util.c', 'tr_util.h'],
|
||||
command: [prog_python, prog_enums2names, '@INPUT@', '-C', '@OUTPUT0@', '-H', '@OUTPUT1@', '-I', 'tr_util.h'],
|
||||
depend_files: prog_enums2names,
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@
|
|||
#ifndef PIPE_DEFINES_H
|
||||
#define PIPE_DEFINES_H
|
||||
|
||||
/* For pipe_blend* and pipe_logicop enums */
|
||||
#include "util/blend.h"
|
||||
|
||||
#include "util/compiler.h"
|
||||
|
||||
#include "compiler/shader_enums.h"
|
||||
|
|
@ -54,57 +57,6 @@ enum pipe_error
|
|||
/* TODO */
|
||||
};
|
||||
|
||||
enum pipe_blendfactor {
|
||||
PIPE_BLENDFACTOR_ONE = 1,
|
||||
PIPE_BLENDFACTOR_SRC_COLOR,
|
||||
PIPE_BLENDFACTOR_SRC_ALPHA,
|
||||
PIPE_BLENDFACTOR_DST_ALPHA,
|
||||
PIPE_BLENDFACTOR_DST_COLOR,
|
||||
PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE,
|
||||
PIPE_BLENDFACTOR_CONST_COLOR,
|
||||
PIPE_BLENDFACTOR_CONST_ALPHA,
|
||||
PIPE_BLENDFACTOR_SRC1_COLOR,
|
||||
PIPE_BLENDFACTOR_SRC1_ALPHA,
|
||||
|
||||
PIPE_BLENDFACTOR_ZERO = 0x11,
|
||||
PIPE_BLENDFACTOR_INV_SRC_COLOR,
|
||||
PIPE_BLENDFACTOR_INV_SRC_ALPHA,
|
||||
PIPE_BLENDFACTOR_INV_DST_ALPHA,
|
||||
PIPE_BLENDFACTOR_INV_DST_COLOR,
|
||||
|
||||
PIPE_BLENDFACTOR_INV_CONST_COLOR = 0x17,
|
||||
PIPE_BLENDFACTOR_INV_CONST_ALPHA,
|
||||
PIPE_BLENDFACTOR_INV_SRC1_COLOR,
|
||||
PIPE_BLENDFACTOR_INV_SRC1_ALPHA,
|
||||
};
|
||||
|
||||
enum pipe_blend_func {
|
||||
PIPE_BLEND_ADD,
|
||||
PIPE_BLEND_SUBTRACT,
|
||||
PIPE_BLEND_REVERSE_SUBTRACT,
|
||||
PIPE_BLEND_MIN,
|
||||
PIPE_BLEND_MAX,
|
||||
};
|
||||
|
||||
enum pipe_logicop {
|
||||
PIPE_LOGICOP_CLEAR,
|
||||
PIPE_LOGICOP_NOR,
|
||||
PIPE_LOGICOP_AND_INVERTED,
|
||||
PIPE_LOGICOP_COPY_INVERTED,
|
||||
PIPE_LOGICOP_AND_REVERSE,
|
||||
PIPE_LOGICOP_INVERT,
|
||||
PIPE_LOGICOP_XOR,
|
||||
PIPE_LOGICOP_NAND,
|
||||
PIPE_LOGICOP_AND,
|
||||
PIPE_LOGICOP_EQUIV,
|
||||
PIPE_LOGICOP_NOOP,
|
||||
PIPE_LOGICOP_OR_INVERTED,
|
||||
PIPE_LOGICOP_COPY,
|
||||
PIPE_LOGICOP_OR_REVERSE,
|
||||
PIPE_LOGICOP_OR,
|
||||
PIPE_LOGICOP_SET,
|
||||
};
|
||||
|
||||
#define PIPE_MASK_R 0x1
|
||||
#define PIPE_MASK_G 0x2
|
||||
#define PIPE_MASK_B 0x4
|
||||
|
|
|
|||
61
src/util/blend.h
Normal file
61
src/util/blend.h
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright 2023 Valve Corporation
|
||||
* Copyright 2007 VMware, Inc.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#ifndef UTIL_BLEND_H
|
||||
#define UTIL_BLEND_H
|
||||
|
||||
enum pipe_blendfactor {
|
||||
PIPE_BLENDFACTOR_ONE = 1,
|
||||
PIPE_BLENDFACTOR_SRC_COLOR,
|
||||
PIPE_BLENDFACTOR_SRC_ALPHA,
|
||||
PIPE_BLENDFACTOR_DST_ALPHA,
|
||||
PIPE_BLENDFACTOR_DST_COLOR,
|
||||
PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE,
|
||||
PIPE_BLENDFACTOR_CONST_COLOR,
|
||||
PIPE_BLENDFACTOR_CONST_ALPHA,
|
||||
PIPE_BLENDFACTOR_SRC1_COLOR,
|
||||
PIPE_BLENDFACTOR_SRC1_ALPHA,
|
||||
|
||||
PIPE_BLENDFACTOR_ZERO = 0x11,
|
||||
PIPE_BLENDFACTOR_INV_SRC_COLOR,
|
||||
PIPE_BLENDFACTOR_INV_SRC_ALPHA,
|
||||
PIPE_BLENDFACTOR_INV_DST_ALPHA,
|
||||
PIPE_BLENDFACTOR_INV_DST_COLOR,
|
||||
|
||||
PIPE_BLENDFACTOR_INV_CONST_COLOR = 0x17,
|
||||
PIPE_BLENDFACTOR_INV_CONST_ALPHA,
|
||||
PIPE_BLENDFACTOR_INV_SRC1_COLOR,
|
||||
PIPE_BLENDFACTOR_INV_SRC1_ALPHA,
|
||||
};
|
||||
|
||||
enum pipe_blend_func {
|
||||
PIPE_BLEND_ADD,
|
||||
PIPE_BLEND_SUBTRACT,
|
||||
PIPE_BLEND_REVERSE_SUBTRACT,
|
||||
PIPE_BLEND_MIN,
|
||||
PIPE_BLEND_MAX,
|
||||
};
|
||||
|
||||
enum pipe_logicop {
|
||||
PIPE_LOGICOP_CLEAR,
|
||||
PIPE_LOGICOP_NOR,
|
||||
PIPE_LOGICOP_AND_INVERTED,
|
||||
PIPE_LOGICOP_COPY_INVERTED,
|
||||
PIPE_LOGICOP_AND_REVERSE,
|
||||
PIPE_LOGICOP_INVERT,
|
||||
PIPE_LOGICOP_XOR,
|
||||
PIPE_LOGICOP_NAND,
|
||||
PIPE_LOGICOP_AND,
|
||||
PIPE_LOGICOP_EQUIV,
|
||||
PIPE_LOGICOP_NOOP,
|
||||
PIPE_LOGICOP_OR_INVERTED,
|
||||
PIPE_LOGICOP_COPY,
|
||||
PIPE_LOGICOP_OR_REVERSE,
|
||||
PIPE_LOGICOP_OR,
|
||||
PIPE_LOGICOP_SET,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -33,6 +33,7 @@ files_mesa_util = files(
|
|||
'bitscan.c',
|
||||
'bitscan.h',
|
||||
'bitset.h',
|
||||
'blend.h',
|
||||
'blob.c',
|
||||
'blob.h',
|
||||
'build_id.c',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue