aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2020-04-29 17:31:56 -0700
committerMarge Bot <[email protected]>2020-04-30 03:45:12 +0000
commitf78af3372131e4c2f0344396d3490abe816992cf (patch)
tree802b5af1c3171caefd3a4dc2b283aa4fb9ad88c2 /src/gallium/drivers/freedreno
parent51a82ec3e437d1d2dc4c688578640d25b3e7f0a2 (diff)
gallium: extract out logicop helper
Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4826>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_blend.c18
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_blend.c18
-rw-r--r--src/gallium/drivers/freedreno/a5xx/fd5_blend.c18
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_blend.c18
4 files changed, 4 insertions, 68 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_blend.c b/src/gallium/drivers/freedreno/a3xx/fd3_blend.c
index 383e557f18e..5773ed2eef4 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_blend.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_blend.c
@@ -66,23 +66,7 @@ fd3_blend_state_create(struct pipe_context *pctx,
if (cso->logicop_enable) {
rop = cso->logicop_func; /* maps 1:1 */
-
- switch (cso->logicop_func) {
- case PIPE_LOGICOP_NOR:
- case PIPE_LOGICOP_AND_INVERTED:
- case PIPE_LOGICOP_AND_REVERSE:
- case PIPE_LOGICOP_INVERT:
- case PIPE_LOGICOP_XOR:
- case PIPE_LOGICOP_NAND:
- case PIPE_LOGICOP_AND:
- case PIPE_LOGICOP_EQUIV:
- case PIPE_LOGICOP_NOOP:
- case PIPE_LOGICOP_OR_INVERTED:
- case PIPE_LOGICOP_OR_REVERSE:
- case PIPE_LOGICOP_OR:
- reads_dest = true;
- break;
- }
+ reads_dest = util_logicop_reads_dest(cso->logicop_func);
}
so = CALLOC_STRUCT(fd3_blend_stateobj);
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_blend.c b/src/gallium/drivers/freedreno/a4xx/fd4_blend.c
index 9a728088192..9b067e0e07b 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_blend.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_blend.c
@@ -64,23 +64,7 @@ fd4_blend_state_create(struct pipe_context *pctx,
if (cso->logicop_enable) {
rop = cso->logicop_func; /* maps 1:1 */
-
- switch (cso->logicop_func) {
- case PIPE_LOGICOP_NOR:
- case PIPE_LOGICOP_AND_INVERTED:
- case PIPE_LOGICOP_AND_REVERSE:
- case PIPE_LOGICOP_INVERT:
- case PIPE_LOGICOP_XOR:
- case PIPE_LOGICOP_NAND:
- case PIPE_LOGICOP_AND:
- case PIPE_LOGICOP_EQUIV:
- case PIPE_LOGICOP_NOOP:
- case PIPE_LOGICOP_OR_INVERTED:
- case PIPE_LOGICOP_OR_REVERSE:
- case PIPE_LOGICOP_OR:
- reads_dest = true;
- break;
- }
+ reads_dest = util_logicop_reads_dest(cso->logicop_func);
}
so = CALLOC_STRUCT(fd4_blend_stateobj);
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_blend.c b/src/gallium/drivers/freedreno/a5xx/fd5_blend.c
index a7efcca6187..c98d7c5863a 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_blend.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_blend.c
@@ -65,23 +65,7 @@ fd5_blend_state_create(struct pipe_context *pctx,
if (cso->logicop_enable) {
rop = cso->logicop_func; /* maps 1:1 */
-
- switch (cso->logicop_func) {
- case PIPE_LOGICOP_NOR:
- case PIPE_LOGICOP_AND_INVERTED:
- case PIPE_LOGICOP_AND_REVERSE:
- case PIPE_LOGICOP_INVERT:
- case PIPE_LOGICOP_XOR:
- case PIPE_LOGICOP_NAND:
- case PIPE_LOGICOP_AND:
- case PIPE_LOGICOP_EQUIV:
- case PIPE_LOGICOP_NOOP:
- case PIPE_LOGICOP_OR_INVERTED:
- case PIPE_LOGICOP_OR_REVERSE:
- case PIPE_LOGICOP_OR:
- reads_dest = true;
- break;
- }
+ reads_dest = util_logicop_reads_dest(cso->logicop_func);
}
so = CALLOC_STRUCT(fd5_blend_stateobj);
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blend.c b/src/gallium/drivers/freedreno/a6xx/fd6_blend.c
index 734f1868b01..40a99822297 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_blend.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_blend.c
@@ -68,23 +68,7 @@ fd6_blend_state_create(struct pipe_context *pctx,
if (cso->logicop_enable) {
rop = cso->logicop_func; /* maps 1:1 */
-
- switch (cso->logicop_func) {
- case PIPE_LOGICOP_NOR:
- case PIPE_LOGICOP_AND_INVERTED:
- case PIPE_LOGICOP_AND_REVERSE:
- case PIPE_LOGICOP_INVERT:
- case PIPE_LOGICOP_XOR:
- case PIPE_LOGICOP_NAND:
- case PIPE_LOGICOP_AND:
- case PIPE_LOGICOP_EQUIV:
- case PIPE_LOGICOP_NOOP:
- case PIPE_LOGICOP_OR_INVERTED:
- case PIPE_LOGICOP_OR_REVERSE:
- case PIPE_LOGICOP_OR:
- reads_dest = true;
- break;
- }
+ reads_dest = util_logicop_reads_dest(cso->logicop_func);
}
so = CALLOC_STRUCT(fd6_blend_stateobj);