depth == util_num_layers(tex, level);
}
+static inline bool
+util_logicop_reads_dest(enum pipe_logicop op)
+{
+ switch (op) {
+ 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:
+ return true;
+ case PIPE_LOGICOP_CLEAR:
+ case PIPE_LOGICOP_COPY_INVERTED:
+ case PIPE_LOGICOP_COPY:
+ case PIPE_LOGICOP_SET:
+ return false;
+ }
+ unreachable("bad logicop");
+}
+
static inline struct pipe_context *
pipe_create_multimedia_context(struct pipe_screen *screen)
{
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);
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);
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);
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);