diff options
Diffstat (limited to 'src/gallium/drivers')
38 files changed, 202 insertions, 202 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c index 982c9c2b097..aa47267444f 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c @@ -186,8 +186,8 @@ emit_mem2gmem_surf(struct fd_context *ctx, uint32_t base, A2XX_RB_COLOR_INFO_BASE(base) | A2XX_RB_COLOR_INFO_FORMAT(fd2_pipe2color(psurf->format))); - swiz = fd2_tex_swiz(psurf->format, PIPE_SWIZZLE_RED, PIPE_SWIZZLE_GREEN, - PIPE_SWIZZLE_BLUE, PIPE_SWIZZLE_ALPHA); + swiz = fd2_tex_swiz(psurf->format, PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y, + PIPE_SWIZZLE_Z, PIPE_SWIZZLE_W); /* emit fb as a texture: */ OUT_PKT3(ring, CP_SET_CONSTANT, 7); diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_util.c b/src/gallium/drivers/freedreno/a2xx/fd2_util.c index 9781326a5af..6cece91a277 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_util.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_util.c @@ -294,12 +294,12 @@ tex_swiz(unsigned swiz) { switch (swiz) { default: - case PIPE_SWIZZLE_RED: return SQ_TEX_X; - case PIPE_SWIZZLE_GREEN: return SQ_TEX_Y; - case PIPE_SWIZZLE_BLUE: return SQ_TEX_Z; - case PIPE_SWIZZLE_ALPHA: return SQ_TEX_W; - case PIPE_SWIZZLE_ZERO: return SQ_TEX_ZERO; - case PIPE_SWIZZLE_ONE: return SQ_TEX_ONE; + case PIPE_SWIZZLE_X: return SQ_TEX_X; + case PIPE_SWIZZLE_Y: return SQ_TEX_Y; + case PIPE_SWIZZLE_Z: return SQ_TEX_Z; + case PIPE_SWIZZLE_W: return SQ_TEX_W; + case PIPE_SWIZZLE_0: return SQ_TEX_ZERO; + case PIPE_SWIZZLE_1: return SQ_TEX_ONE; } } @@ -311,8 +311,8 @@ fd2_tex_swiz(enum pipe_format format, unsigned swizzle_r, unsigned swizzle_g, util_format_description(format); uint8_t swiz[] = { swizzle_r, swizzle_g, swizzle_b, swizzle_a, - PIPE_SWIZZLE_ZERO, PIPE_SWIZZLE_ONE, - PIPE_SWIZZLE_ONE, PIPE_SWIZZLE_ONE, + PIPE_SWIZZLE_0, PIPE_SWIZZLE_1, + PIPE_SWIZZLE_1, PIPE_SWIZZLE_1, }; return A2XX_SQ_TEX_3_SWIZ_X(tex_swiz(swiz[desc->swizzle[0]])) | diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c index adfa9a96a46..7d508e7397c 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c @@ -309,8 +309,8 @@ fd3_emit_gmem_restore_tex(struct fd_ringbuffer *ring, OUT_RING(ring, A3XX_TEX_CONST_0_FMT(fd3_pipe2tex(format)) | A3XX_TEX_CONST_0_TYPE(A3XX_TEX_2D) | - fd3_tex_swiz(format, PIPE_SWIZZLE_RED, PIPE_SWIZZLE_GREEN, - PIPE_SWIZZLE_BLUE, PIPE_SWIZZLE_ALPHA)); + fd3_tex_swiz(format, PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y, + PIPE_SWIZZLE_Z, PIPE_SWIZZLE_W)); OUT_RING(ring, A3XX_TEX_CONST_1_FETCHSIZE(TFETCH_DISABLE) | A3XX_TEX_CONST_1_WIDTH(psurf[i]->width) | A3XX_TEX_CONST_1_HEIGHT(psurf[i]->height)); diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_format.c b/src/gallium/drivers/freedreno/a3xx/fd3_format.c index 52ea9444517..7050ded133d 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_format.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_format.c @@ -391,12 +391,12 @@ tex_swiz(unsigned swiz) { switch (swiz) { default: - case PIPE_SWIZZLE_RED: return A3XX_TEX_X; - case PIPE_SWIZZLE_GREEN: return A3XX_TEX_Y; - case PIPE_SWIZZLE_BLUE: return A3XX_TEX_Z; - case PIPE_SWIZZLE_ALPHA: return A3XX_TEX_W; - case PIPE_SWIZZLE_ZERO: return A3XX_TEX_ZERO; - case PIPE_SWIZZLE_ONE: return A3XX_TEX_ONE; + case PIPE_SWIZZLE_X: return A3XX_TEX_X; + case PIPE_SWIZZLE_Y: return A3XX_TEX_Y; + case PIPE_SWIZZLE_Z: return A3XX_TEX_Z; + case PIPE_SWIZZLE_W: return A3XX_TEX_W; + case PIPE_SWIZZLE_0: return A3XX_TEX_ZERO; + case PIPE_SWIZZLE_1: return A3XX_TEX_ONE; } } diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c index 81ed16ce8ac..e984d9bb64c 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c @@ -282,8 +282,8 @@ fd4_emit_gmem_restore_tex(struct fd_ringbuffer *ring, unsigned nr_bufs, OUT_RING(ring, A4XX_TEX_CONST_0_FMT(fd4_pipe2tex(format)) | A4XX_TEX_CONST_0_TYPE(A4XX_TEX_2D) | - fd4_tex_swiz(format, PIPE_SWIZZLE_RED, PIPE_SWIZZLE_GREEN, - PIPE_SWIZZLE_BLUE, PIPE_SWIZZLE_ALPHA)); + fd4_tex_swiz(format, PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y, + PIPE_SWIZZLE_Z, PIPE_SWIZZLE_W)); OUT_RING(ring, A4XX_TEX_CONST_1_WIDTH(bufs[i]->width) | A4XX_TEX_CONST_1_HEIGHT(bufs[i]->height)); OUT_RING(ring, A4XX_TEX_CONST_2_PITCH(slice->pitch * rsc->cpp) | diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_format.c b/src/gallium/drivers/freedreno/a4xx/fd4_format.c index c240745cec1..bd7e285f39d 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_format.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_format.c @@ -441,12 +441,12 @@ tex_swiz(unsigned swiz) { switch (swiz) { default: - case PIPE_SWIZZLE_RED: return A4XX_TEX_X; - case PIPE_SWIZZLE_GREEN: return A4XX_TEX_Y; - case PIPE_SWIZZLE_BLUE: return A4XX_TEX_Z; - case PIPE_SWIZZLE_ALPHA: return A4XX_TEX_W; - case PIPE_SWIZZLE_ZERO: return A4XX_TEX_ZERO; - case PIPE_SWIZZLE_ONE: return A4XX_TEX_ONE; + case PIPE_SWIZZLE_X: return A4XX_TEX_X; + case PIPE_SWIZZLE_Y: return A4XX_TEX_Y; + case PIPE_SWIZZLE_Z: return A4XX_TEX_Z; + case PIPE_SWIZZLE_W: return A4XX_TEX_W; + case PIPE_SWIZZLE_0: return A4XX_TEX_ZERO; + case PIPE_SWIZZLE_1: return A4XX_TEX_ONE; } } diff --git a/src/gallium/drivers/i915/i915_state_sampler.c b/src/gallium/drivers/i915/i915_state_sampler.c index c874361dfd9..84ed1514630 100644 --- a/src/gallium/drivers/i915/i915_state_sampler.c +++ b/src/gallium/drivers/i915/i915_state_sampler.c @@ -193,10 +193,10 @@ struct i915_tracked_state i915_hw_samplers = { static uint translate_texture_format(enum pipe_format pipeFormat, const struct pipe_sampler_view* view) { - if ( (view->swizzle_r != PIPE_SWIZZLE_RED || - view->swizzle_g != PIPE_SWIZZLE_GREEN || - view->swizzle_b != PIPE_SWIZZLE_BLUE || - view->swizzle_a != PIPE_SWIZZLE_ALPHA ) && + if ( (view->swizzle_r != PIPE_SWIZZLE_X || + view->swizzle_g != PIPE_SWIZZLE_Y || + view->swizzle_b != PIPE_SWIZZLE_Z || + view->swizzle_a != PIPE_SWIZZLE_W ) && pipeFormat != PIPE_FORMAT_Z24_UNORM_S8_UINT && pipeFormat != PIPE_FORMAT_Z24X8_UNORM ) debug_printf("i915: unsupported texture swizzle for format %d\n", pipeFormat); @@ -248,20 +248,20 @@ static uint translate_texture_format(enum pipe_format pipeFormat, case PIPE_FORMAT_Z24_UNORM_S8_UINT: case PIPE_FORMAT_Z24X8_UNORM: { - if ( view->swizzle_r == PIPE_SWIZZLE_RED && - view->swizzle_g == PIPE_SWIZZLE_RED && - view->swizzle_b == PIPE_SWIZZLE_RED && - view->swizzle_a == PIPE_SWIZZLE_ONE) + if ( view->swizzle_r == PIPE_SWIZZLE_X && + view->swizzle_g == PIPE_SWIZZLE_X && + view->swizzle_b == PIPE_SWIZZLE_X && + view->swizzle_a == PIPE_SWIZZLE_1) return (MAPSURF_32BIT | MT_32BIT_xA824); - if ( view->swizzle_r == PIPE_SWIZZLE_RED && - view->swizzle_g == PIPE_SWIZZLE_RED && - view->swizzle_b == PIPE_SWIZZLE_RED && - view->swizzle_a == PIPE_SWIZZLE_RED) + if ( view->swizzle_r == PIPE_SWIZZLE_X && + view->swizzle_g == PIPE_SWIZZLE_X && + view->swizzle_b == PIPE_SWIZZLE_X && + view->swizzle_a == PIPE_SWIZZLE_X) return (MAPSURF_32BIT | MT_32BIT_xI824); - if ( view->swizzle_r == PIPE_SWIZZLE_ZERO && - view->swizzle_g == PIPE_SWIZZLE_ZERO && - view->swizzle_b == PIPE_SWIZZLE_ZERO && - view->swizzle_a == PIPE_SWIZZLE_RED) + if ( view->swizzle_r == PIPE_SWIZZLE_0 && + view->swizzle_g == PIPE_SWIZZLE_0 && + view->swizzle_b == PIPE_SWIZZLE_0 && + view->swizzle_a == PIPE_SWIZZLE_X) return (MAPSURF_32BIT | MT_32BIT_xL824); debug_printf("i915: unsupported depth swizzle %d %d %d %d\n", view->swizzle_r, diff --git a/src/gallium/drivers/ilo/ilo_shader.c b/src/gallium/drivers/ilo/ilo_shader.c index c61716dc791..4eab174e433 100644 --- a/src/gallium/drivers/ilo/ilo_shader.c +++ b/src/gallium/drivers/ilo/ilo_shader.c @@ -265,16 +265,16 @@ ilo_shader_variant_init(struct ilo_shader_variant *variant, variant->sampler_view_swizzles[i].a = view->swizzle_a; } else if (info->shadow_samplers & (1 << i)) { - variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_RED; - variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_RED; - variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_RED; - variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_ONE; + variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_X; + variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_X; + variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_X; + variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_1; } else { - variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_RED; - variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_GREEN; - variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_BLUE; - variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_ALPHA; + variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_X; + variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_Y; + variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_Z; + variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_W; } /* @@ -323,16 +323,16 @@ ilo_shader_variant_guess(struct ilo_shader_variant *variant, variant->num_sampler_views = info->num_samplers; for (i = 0; i < info->num_samplers; i++) { if (info->shadow_samplers & (1 << i)) { - variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_RED; - variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_RED; - variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_RED; - variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_ONE; + variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_X; + variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_X; + variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_X; + variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_1; } else { - variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_RED; - variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_GREEN; - variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_BLUE; - variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_ALPHA; + variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_X; + variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_Y; + variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_Z; + variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_W; } } } diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c index 6c8f1b5222e..d2b205a370d 100644 --- a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c +++ b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c @@ -1143,19 +1143,19 @@ fs_lower_opcode_tgsi_sampling(struct fs_compile_context *fcc, swizzles[3] = fcc->variant->sampler_view_swizzles[sampler_index].a; } else { - swizzles[0] = PIPE_SWIZZLE_RED; - swizzles[1] = PIPE_SWIZZLE_GREEN; - swizzles[2] = PIPE_SWIZZLE_BLUE; - swizzles[3] = PIPE_SWIZZLE_ALPHA; + swizzles[0] = PIPE_SWIZZLE_X; + swizzles[1] = PIPE_SWIZZLE_Y; + swizzles[2] = PIPE_SWIZZLE_Z; + swizzles[3] = PIPE_SWIZZLE_W; } /* swizzle the results */ for (i = 0; i < 4; i++) { switch (swizzles[i]) { - case PIPE_SWIZZLE_ZERO: + case PIPE_SWIZZLE_0: tc_MOV(tc, dst[i], tsrc_imm_f(0.0f)); break; - case PIPE_SWIZZLE_ONE: + case PIPE_SWIZZLE_1: tc_MOV(tc, dst[i], tsrc_imm_f(1.0f)); break; default: diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c index 2b46d44f5be..514e636f327 100644 --- a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c +++ b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c @@ -610,10 +610,10 @@ vs_lower_opcode_tgsi_sampling(struct vs_compile_context *vcc, swizzles[3] = vcc->variant->sampler_view_swizzles[sampler_index].a; } else { - swizzles[0] = PIPE_SWIZZLE_RED; - swizzles[1] = PIPE_SWIZZLE_GREEN; - swizzles[2] = PIPE_SWIZZLE_BLUE; - swizzles[3] = PIPE_SWIZZLE_ALPHA; + swizzles[0] = PIPE_SWIZZLE_X; + swizzles[1] = PIPE_SWIZZLE_Y; + swizzles[2] = PIPE_SWIZZLE_Z; + swizzles[3] = PIPE_SWIZZLE_W; } swizzle_zero_mask = 0; @@ -621,11 +621,11 @@ vs_lower_opcode_tgsi_sampling(struct vs_compile_context *vcc, swizzle_normal_mask = 0; for (i = 0; i < 4; i++) { switch (swizzles[i]) { - case PIPE_SWIZZLE_ZERO: + case PIPE_SWIZZLE_0: swizzle_zero_mask |= 1 << i; swizzles[i] = i; break; - case PIPE_SWIZZLE_ONE: + case PIPE_SWIZZLE_1: swizzle_one_mask |= 1 << i; swizzles[i] = i; break; diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c index 564e19a1565..a57670d4956 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c @@ -255,13 +255,13 @@ lp_build_blend_factor(struct lp_build_blend_aos_context *bld, LLVMValueRef rgb_factor_, alpha_factor_; enum lp_build_blend_swizzle rgb_swizzle; - if (alpha_swizzle == UTIL_FORMAT_SWIZZLE_X && num_channels == 1) { + if (alpha_swizzle == PIPE_SWIZZLE_X && num_channels == 1) { return lp_build_blend_factor_unswizzled(bld, alpha_factor, TRUE); } rgb_factor_ = lp_build_blend_factor_unswizzled(bld, rgb_factor, FALSE); - if (alpha_swizzle != UTIL_FORMAT_SWIZZLE_NONE) { + if (alpha_swizzle != PIPE_SWIZZLE_NONE) { rgb_swizzle = lp_build_blend_factor_swizzle(rgb_factor); alpha_factor_ = lp_build_blend_factor_unswizzled(bld, alpha_factor, TRUE); return lp_build_blend_swizzle(bld, rgb_factor_, alpha_factor_, rgb_swizzle, alpha_swizzle, num_channels); @@ -312,7 +312,7 @@ lp_build_blend_aos(struct gallivm_state *gallivm, struct lp_build_blend_aos_context bld; LLVMValueRef src_factor, dst_factor; LLVMValueRef result; - unsigned alpha_swizzle = UTIL_FORMAT_SWIZZLE_NONE; + unsigned alpha_swizzle = PIPE_SWIZZLE_NONE; unsigned i; desc = util_format_description(cbuf_format); @@ -370,7 +370,7 @@ lp_build_blend_aos(struct gallivm_state *gallivm, rgb_alpha_same, false); - if(state->rgb_func != state->alpha_func && nr_channels > 1 && alpha_swizzle != UTIL_FORMAT_SWIZZLE_NONE) { + if(state->rgb_func != state->alpha_func && nr_channels > 1 && alpha_swizzle != PIPE_SWIZZLE_NONE) { LLVMValueRef alpha; alpha = lp_build_blend(&bld.base, diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c index b25e0413750..0c27c2f8972 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c @@ -359,7 +359,7 @@ get_z_shift_and_mask(const struct util_format_description *format_desc, z_swizzle = format_desc->swizzle[0]; - if (z_swizzle == UTIL_FORMAT_SWIZZLE_NONE) + if (z_swizzle == PIPE_SWIZZLE_NONE) return FALSE; *width = format_desc->channel[z_swizzle].size; @@ -390,7 +390,7 @@ get_s_shift_and_mask(const struct util_format_description *format_desc, s_swizzle = format_desc->swizzle[1]; - if (s_swizzle == UTIL_FORMAT_SWIZZLE_NONE) + if (s_swizzle == PIPE_SWIZZLE_NONE) return FALSE; /* just special case 64bit d/s format */ @@ -873,8 +873,8 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm, const unsigned z_swizzle = format_desc->swizzle[0]; const unsigned s_swizzle = format_desc->swizzle[1]; - assert(z_swizzle != UTIL_FORMAT_SWIZZLE_NONE || - s_swizzle != UTIL_FORMAT_SWIZZLE_NONE); + assert(z_swizzle != PIPE_SWIZZLE_NONE || + s_swizzle != PIPE_SWIZZLE_NONE); assert(depth->enabled || stencil[0].enabled); diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index cb681bac939..4f61de8000f 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -475,7 +475,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, return FALSE; /* TODO: Support stencil-only formats */ - if (format_desc->swizzle[0] == UTIL_FORMAT_SWIZZLE_NONE) { + if (format_desc->swizzle[0] == PIPE_SWIZZLE_NONE) { return FALSE; } } diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 93460a39e90..76cbb5be8ef 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -3027,7 +3027,7 @@ make_variant_key(struct llvmpipe_context *lp, * Also, force rgb/alpha func/factors match, to make AoS blending * easier. */ - if (format_desc->swizzle[3] > UTIL_FORMAT_SWIZZLE_W || + if (format_desc->swizzle[3] > PIPE_SWIZZLE_W || format_desc->swizzle[3] == format_desc->swizzle[0]) { /* Doesn't cover mixed snorm/unorm but can't render to them anyway */ boolean clamped_zero = !util_format_is_float(format) && diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c index 6a4fbbbf202..fec0ec1f705 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c @@ -135,8 +135,8 @@ emit_facing_coef(struct gallivm_state *gallivm, LLVMValueRef a0_0 = args->facing; LLVMValueRef a0_0f = LLVMBuildSIToFP(builder, a0_0, float_type, ""); LLVMValueRef a0, face_val; - const unsigned char swizzles[4] = { PIPE_SWIZZLE_RED, PIPE_SWIZZLE_ZERO, - PIPE_SWIZZLE_ZERO, PIPE_SWIZZLE_ZERO }; + const unsigned char swizzles[4] = { PIPE_SWIZZLE_X, PIPE_SWIZZLE_0, + PIPE_SWIZZLE_0, PIPE_SWIZZLE_0 }; /* Our face val is either 1 or 0 so we do * face = (val * 2) - 1 * to make it 1 or -1 diff --git a/src/gallium/drivers/nouveau/nouveau_video.c b/src/gallium/drivers/nouveau/nouveau_video.c index 8bb12b22ac1..bb3aad784c5 100644 --- a/src/gallium/drivers/nouveau/nouveau_video.c +++ b/src/gallium/drivers/nouveau/nouveau_video.c @@ -657,7 +657,7 @@ nouveau_video_buffer_sampler_view_planes(struct pipe_video_buffer *buffer) u_sampler_view_default_template(&sv_templ, buf->resources[i], buf->resources[i]->format); if (util_format_get_nr_components(buf->resources[i]->format) == 1) - sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = sv_templ.swizzle_a = PIPE_SWIZZLE_RED; + sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = sv_templ.swizzle_a = PIPE_SWIZZLE_X; buf->sampler_view_planes[i] = pipe->create_sampler_view(pipe, buf->resources[i], &sv_templ); if (!buf->sampler_view_planes[i]) @@ -695,8 +695,8 @@ nouveau_video_buffer_sampler_view_components(struct pipe_video_buffer *buffer) if (!buf->sampler_view_components[component]) { memset(&sv_templ, 0, sizeof(sv_templ)); u_sampler_view_default_template(&sv_templ, buf->resources[i], buf->resources[i]->format); - sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = PIPE_SWIZZLE_RED + j; - sv_templ.swizzle_a = PIPE_SWIZZLE_ONE; + sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = PIPE_SWIZZLE_X + j; + sv_templ.swizzle_a = PIPE_SWIZZLE_1; buf->sampler_view_components[component] = pipe->create_sampler_view(pipe, buf->resources[i], &sv_templ); if (!buf->sampler_view_components[component]) goto error; diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.c b/src/gallium/drivers/nouveau/nouveau_vp3_video.c index d76d93241f4..172d80c44c2 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video.c +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.c @@ -139,8 +139,8 @@ nouveau_vp3_video_buffer_create(struct pipe_context *pipe, goto error; for (j = 0; j < nr_components; ++j, ++component) { - sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = PIPE_SWIZZLE_RED + j; - sv_templ.swizzle_a = PIPE_SWIZZLE_ONE; + sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = PIPE_SWIZZLE_X + j; + sv_templ.swizzle_a = PIPE_SWIZZLE_1; buffer->sampler_view_components[component] = pipe->create_sampler_view(pipe, res, &sv_templ); if (!buffer->sampler_view_components[component]) diff --git a/src/gallium/drivers/nouveau/nv30/nv30_texture.c b/src/gallium/drivers/nouveau/nv30/nv30_texture.c index bfe21cceaa2..4f4f87e2ce9 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_texture.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_texture.c @@ -205,7 +205,7 @@ static inline uint32_t swizzle(const struct nv30_texfmt *fmt, unsigned cmp, unsigned swz) { uint32_t data = fmt->swz[swz].src << 8; - if (swz <= PIPE_SWIZZLE_ALPHA) + if (swz <= PIPE_SWIZZLE_W) data |= fmt->swz[swz].cmp; else data |= fmt->swz[cmp].cmp; diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c index b9cfb313fb5..89ac208c155 100644 --- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c +++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c @@ -474,10 +474,10 @@ nvfx_fragprog_parse_instruction(struct nvfx_fpc *fpc, switch (fsrc->Register.File) { case TGSI_FILE_INPUT: if(fpc->fp->info.input_semantic_name[fsrc->Register.Index] == TGSI_SEMANTIC_FOG && (0 - || fsrc->Register.SwizzleX == PIPE_SWIZZLE_ALPHA - || fsrc->Register.SwizzleY == PIPE_SWIZZLE_ALPHA - || fsrc->Register.SwizzleZ == PIPE_SWIZZLE_ALPHA - || fsrc->Register.SwizzleW == PIPE_SWIZZLE_ALPHA + || fsrc->Register.SwizzleX == PIPE_SWIZZLE_W + || fsrc->Register.SwizzleY == PIPE_SWIZZLE_W + || fsrc->Register.SwizzleZ == PIPE_SWIZZLE_W + || fsrc->Register.SwizzleW == PIPE_SWIZZLE_W )) { /* hardware puts 0 in fogcoord.w, but GL/Gallium want 1 there */ struct nvfx_src addend = nvfx_src(nvfx_fp_imm(fpc, 0, 0, 0, 1)); diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c index 68b0e18ef8f..a284f27c366 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c @@ -1122,10 +1122,10 @@ nv50_blit_set_src(struct nv50_blitctx *blit, templ.format = format; templ.u.tex.first_level = templ.u.tex.last_level = level; templ.u.tex.first_layer = templ.u.tex.last_layer = layer; - templ.swizzle_r = PIPE_SWIZZLE_RED; - templ.swizzle_g = PIPE_SWIZZLE_GREEN; - templ.swizzle_b = PIPE_SWIZZLE_BLUE; - templ.swizzle_a = PIPE_SWIZZLE_ALPHA; + templ.swizzle_r = PIPE_SWIZZLE_X; + templ.swizzle_g = PIPE_SWIZZLE_Y; + templ.swizzle_b = PIPE_SWIZZLE_Z; + templ.swizzle_a = PIPE_SWIZZLE_W; if (layer == -1) { templ.u.tex.first_layer = 0; diff --git a/src/gallium/drivers/nouveau/nv50/nv50_tex.c b/src/gallium/drivers/nouveau/nv50/nv50_tex.c index 414d326eeed..36c07bc4fc3 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_tex.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_tex.c @@ -31,13 +31,13 @@ static inline uint32_t nv50_tic_swizzle(const struct nv50_format *fmt, unsigned swz, bool tex_int) { switch (swz) { - case PIPE_SWIZZLE_RED : return fmt->tic.src_x; - case PIPE_SWIZZLE_GREEN: return fmt->tic.src_y; - case PIPE_SWIZZLE_BLUE : return fmt->tic.src_z; - case PIPE_SWIZZLE_ALPHA: return fmt->tic.src_w; - case PIPE_SWIZZLE_ONE: + case PIPE_SWIZZLE_X : return fmt->tic.src_x; + case PIPE_SWIZZLE_Y: return fmt->tic.src_y; + case PIPE_SWIZZLE_Z : return fmt->tic.src_z; + case PIPE_SWIZZLE_W: return fmt->tic.src_w; + case PIPE_SWIZZLE_1: return tex_int ? G80_TIC_SOURCE_ONE_INT : G80_TIC_SOURCE_ONE_FLOAT; - case PIPE_SWIZZLE_ZERO: + case PIPE_SWIZZLE_0: default: return G80_TIC_SOURCE_ZERO; } diff --git a/src/gallium/drivers/nouveau/nv50/nv84_video.c b/src/gallium/drivers/nouveau/nv50/nv84_video.c index 88655dbfae5..1b1f31ac485 100644 --- a/src/gallium/drivers/nouveau/nv50/nv84_video.c +++ b/src/gallium/drivers/nouveau/nv50/nv84_video.c @@ -705,8 +705,8 @@ nv84_video_buffer_create(struct pipe_context *pipe, for (j = 0; j < nr_components; ++j, ++component) { sv_templ.swizzle_r = sv_templ.swizzle_g = sv_templ.swizzle_b = - PIPE_SWIZZLE_RED + j; - sv_templ.swizzle_a = PIPE_SWIZZLE_ONE; + PIPE_SWIZZLE_X + j; + sv_templ.swizzle_a = PIPE_SWIZZLE_1; buffer->sampler_view_components[component] = pipe->create_sampler_view(pipe, res, &sv_templ); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c index e108590e215..a1775698a3d 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c @@ -959,10 +959,10 @@ nvc0_blit_set_src(struct nvc0_blitctx *ctx, templ.format = format; templ.u.tex.first_layer = templ.u.tex.last_layer = layer; templ.u.tex.first_level = templ.u.tex.last_level = level; - templ.swizzle_r = PIPE_SWIZZLE_RED; - templ.swizzle_g = PIPE_SWIZZLE_GREEN; - templ.swizzle_b = PIPE_SWIZZLE_BLUE; - templ.swizzle_a = PIPE_SWIZZLE_ALPHA; + templ.swizzle_r = PIPE_SWIZZLE_X; + templ.swizzle_g = PIPE_SWIZZLE_Y; + templ.swizzle_b = PIPE_SWIZZLE_Z; + templ.swizzle_a = PIPE_SWIZZLE_W; if (layer == -1) { templ.u.tex.first_layer = 0; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c index e04573f8249..21618468bef 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c @@ -36,13 +36,13 @@ static inline uint32_t nv50_tic_swizzle(const struct nvc0_format *fmt, unsigned swz, bool tex_int) { switch (swz) { - case PIPE_SWIZZLE_RED : return fmt->tic.src_x; - case PIPE_SWIZZLE_GREEN: return fmt->tic.src_y; - case PIPE_SWIZZLE_BLUE : return fmt->tic.src_z; - case PIPE_SWIZZLE_ALPHA: return fmt->tic.src_w; - case PIPE_SWIZZLE_ONE: + case PIPE_SWIZZLE_X : return fmt->tic.src_x; + case PIPE_SWIZZLE_Y: return fmt->tic.src_y; + case PIPE_SWIZZLE_Z : return fmt->tic.src_z; + case PIPE_SWIZZLE_W: return fmt->tic.src_w; + case PIPE_SWIZZLE_1: return tex_int ? G80_TIC_SOURCE_ONE_INT : G80_TIC_SOURCE_ONE_FLOAT; - case PIPE_SWIZZLE_ZERO: + case PIPE_SWIZZLE_0: default: return G80_TIC_SOURCE_ZERO; } diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 5c443d144ba..a4783f396e1 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -199,7 +199,7 @@ struct r300_sampler_view { unsigned width0_override; unsigned height0_override; - /* Swizzles in the UTIL_FORMAT_SWIZZLE_* representation, + /* Swizzles in the PIPE_SWIZZLE_* representation, * derived from base. */ unsigned char swizzle[4]; diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 741e263e7ed..bae669e78cb 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -865,10 +865,10 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300) /* X24x8 is sampled as Y16X16 on r3xx-r4xx. * The depth here is at the Y component. */ for (j = 0; j < 4; j++) - depth_swizzle[j] = UTIL_FORMAT_SWIZZLE_Y; + depth_swizzle[j] = PIPE_SWIZZLE_Y; } else { for (j = 0; j < 4; j++) - depth_swizzle[j] = UTIL_FORMAT_SWIZZLE_X; + depth_swizzle[j] = PIPE_SWIZZLE_X; } /* If compare mode is disabled, sampler view swizzles diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 709345a492e..da51661d5cd 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -68,22 +68,22 @@ unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format, /* Get swizzle. */ for (i = 0; i < 4; i++) { switch (swizzle[i]) { - case UTIL_FORMAT_SWIZZLE_Y: + case PIPE_SWIZZLE_Y: result |= swizzle_bit[1] << swizzle_shift[i]; break; - case UTIL_FORMAT_SWIZZLE_Z: + case PIPE_SWIZZLE_Z: result |= swizzle_bit[2] << swizzle_shift[i]; break; - case UTIL_FORMAT_SWIZZLE_W: + case PIPE_SWIZZLE_W: result |= swizzle_bit[3] << swizzle_shift[i]; break; - case UTIL_FORMAT_SWIZZLE_0: + case PIPE_SWIZZLE_0: result |= R300_TX_FORMAT_ZERO << swizzle_shift[i]; break; - case UTIL_FORMAT_SWIZZLE_1: + case PIPE_SWIZZLE_1: result |= R300_TX_FORMAT_ONE << swizzle_shift[i]; break; - default: /* UTIL_FORMAT_SWIZZLE_X */ + default: /* PIPE_SWIZZLE_X */ result |= swizzle_bit[0] << swizzle_shift[i]; } } diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 2ad9e3eb1ab..81feb293122 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1072,7 +1072,7 @@ void evergreen_init_color_surface(struct r600_context *rctx, if (rctx->b.chip_class == CAYMAN) { color_attrib |= S_028C74_FORCE_DST_ALPHA_1(desc->swizzle[3] == - UTIL_FORMAT_SWIZZLE_1); + PIPE_SWIZZLE_1); if (rtex->resource.b.b.nr_samples > 1) { unsigned log_samples = util_logbase2(rtex->resource.b.b.nr_samples); diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index cb40c20a7dd..19c61ff4435 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -2191,22 +2191,22 @@ unsigned r600_get_swizzle_combined(const unsigned char *swizzle_format, /* Get swizzle. */ for (i = 0; i < 4; i++) { switch (swizzle[i]) { - case UTIL_FORMAT_SWIZZLE_Y: + case PIPE_SWIZZLE_Y: result |= swizzle_bit[1] << swizzle_shift[i]; break; - case UTIL_FORMAT_SWIZZLE_Z: + case PIPE_SWIZZLE_Z: result |= swizzle_bit[2] << swizzle_shift[i]; break; - case UTIL_FORMAT_SWIZZLE_W: + case PIPE_SWIZZLE_W: result |= swizzle_bit[3] << swizzle_shift[i]; break; - case UTIL_FORMAT_SWIZZLE_0: + case PIPE_SWIZZLE_0: result |= V_038010_SQ_SEL_0 << swizzle_shift[i]; break; - case UTIL_FORMAT_SWIZZLE_1: + case PIPE_SWIZZLE_1: result |= V_038010_SQ_SEL_1 << swizzle_shift[i]; break; - default: /* UTIL_FORMAT_SWIZZLE_X */ + default: /* PIPE_SWIZZLE_X */ result |= swizzle_bit[0] << swizzle_shift[i]; } } diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 72af5344b70..4bbe04d1b79 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -1396,7 +1396,7 @@ unsigned r600_translate_colorswap(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); -#define HAS_SWIZZLE(chan,swz) (desc->swizzle[chan] == UTIL_FORMAT_SWIZZLE_##swz) +#define HAS_SWIZZLE(chan,swz) (desc->swizzle[chan] == PIPE_SWIZZLE_##swz) if (format == PIPE_FORMAT_R11G11B10_FLOAT) /* isn't plain */ return V_0280A0_SWAP_STD; @@ -1499,10 +1499,10 @@ static void vi_get_fast_clear_parameters(enum pipe_format surface_format, return; for (i = 0; i < 4; ++i) { - int index = desc->swizzle[i] - UTIL_FORMAT_SWIZZLE_X; + int index = desc->swizzle[i] - PIPE_SWIZZLE_X; - if (desc->swizzle[i] < UTIL_FORMAT_SWIZZLE_X || - desc->swizzle[i] > UTIL_FORMAT_SWIZZLE_W) + if (desc->swizzle[i] < PIPE_SWIZZLE_X || + desc->swizzle[i] > PIPE_SWIZZLE_W) continue; if (util_format_is_pure_sint(surface_format)) { @@ -1527,9 +1527,9 @@ static void vi_get_fast_clear_parameters(enum pipe_format surface_format, for (int i = 0; i < 4; ++i) if (values[i] != main_value && - desc->swizzle[i] - UTIL_FORMAT_SWIZZLE_X != extra_channel && - desc->swizzle[i] >= UTIL_FORMAT_SWIZZLE_X && - desc->swizzle[i] <= UTIL_FORMAT_SWIZZLE_W) + desc->swizzle[i] - PIPE_SWIZZLE_X != extra_channel && + desc->swizzle[i] >= PIPE_SWIZZLE_X && + desc->swizzle[i] <= PIPE_SWIZZLE_W) return; *clear_words_needed = false; diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 3f74176d041..7ae6e8aff08 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -209,17 +209,17 @@ unsigned cik_db_pipe_config(struct si_screen *sscreen, unsigned tile_mode) static unsigned si_map_swizzle(unsigned swizzle) { switch (swizzle) { - case UTIL_FORMAT_SWIZZLE_Y: + case PIPE_SWIZZLE_Y: return V_008F0C_SQ_SEL_Y; - case UTIL_FORMAT_SWIZZLE_Z: + case PIPE_SWIZZLE_Z: return V_008F0C_SQ_SEL_Z; - case UTIL_FORMAT_SWIZZLE_W: + case PIPE_SWIZZLE_W: return V_008F0C_SQ_SEL_W; - case UTIL_FORMAT_SWIZZLE_0: + case PIPE_SWIZZLE_0: return V_008F0C_SQ_SEL_0; - case UTIL_FORMAT_SWIZZLE_1: + case PIPE_SWIZZLE_1: return V_008F0C_SQ_SEL_1; - default: /* UTIL_FORMAT_SWIZZLE_X */ + default: /* PIPE_SWIZZLE_X */ return V_008F0C_SQ_SEL_X; } } @@ -2205,7 +2205,7 @@ static void si_initialize_color_surface(struct si_context *sctx, /* Intensity is implemented as Red, so treat it that way. */ color_attrib = S_028C74_TILE_MODE_INDEX(tile_mode_index) | - S_028C74_FORCE_DST_ALPHA_1(desc->swizzle[3] == UTIL_FORMAT_SWIZZLE_1 || + S_028C74_FORCE_DST_ALPHA_1(desc->swizzle[3] == PIPE_SWIZZLE_1 || util_format_is_intensity(surf->base.format)); if (rtex->resource.b.b.nr_samples > 1) { @@ -3562,10 +3562,10 @@ static void si_query_opaque_metadata(struct r600_common_screen *rscreen, struct si_screen *sscreen = (struct si_screen*)rscreen; struct pipe_resource *res = &rtex->resource.b.b; static const unsigned char swizzle[] = { - PIPE_SWIZZLE_RED, - PIPE_SWIZZLE_GREEN, - PIPE_SWIZZLE_BLUE, - PIPE_SWIZZLE_ALPHA + PIPE_SWIZZLE_X, + PIPE_SWIZZLE_Y, + PIPE_SWIZZLE_Z, + PIPE_SWIZZLE_W }; uint32_t desc[8], i; bool is_array = util_resource_is_array_texture(res); diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index 5703ca2dedb..5998681c0fc 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -1500,9 +1500,9 @@ get_gather_value(const struct sp_sampler_view *sp_sview, /* get correct result using the channel and swizzle */ switch (swizzle) { - case PIPE_SWIZZLE_ZERO: + case PIPE_SWIZZLE_0: return 0.0; - case PIPE_SWIZZLE_ONE: + case PIPE_SWIZZLE_1: return 1.0; default: return tx[chan][swizzle]; @@ -2651,7 +2651,7 @@ sample_compare(const struct sp_sampler_view *sp_sview, util_format_description(sp_sview->base.format); /* not entirely sure we couldn't end up with non-valid swizzle here */ const unsigned chan_type = - format_desc->swizzle[0] <= UTIL_FORMAT_SWIZZLE_W ? + format_desc->swizzle[0] <= PIPE_SWIZZLE_W ? format_desc->channel[format_desc->swizzle[0]].type : UTIL_FORMAT_TYPE_FLOAT; const bool is_gather = (control == TGSI_SAMPLER_GATHER); @@ -2773,11 +2773,11 @@ do_swizzling(const struct pipe_sampler_view *sview, const unsigned swizzle_a = sview->swizzle_a; switch (swizzle_r) { - case PIPE_SWIZZLE_ZERO: + case PIPE_SWIZZLE_0: for (j = 0; j < 4; j++) out[0][j] = 0.0f; break; - case PIPE_SWIZZLE_ONE: + case PIPE_SWIZZLE_1: for (j = 0; j < 4; j++) out[0][j] = 1.0f; break; @@ -2788,11 +2788,11 @@ do_swizzling(const struct pipe_sampler_view *sview, } switch (swizzle_g) { - case PIPE_SWIZZLE_ZERO: + case PIPE_SWIZZLE_0: for (j = 0; j < 4; j++) out[1][j] = 0.0f; break; - case PIPE_SWIZZLE_ONE: + case PIPE_SWIZZLE_1: for (j = 0; j < 4; j++) out[1][j] = 1.0f; break; @@ -2803,11 +2803,11 @@ do_swizzling(const struct pipe_sampler_view *sview, } switch (swizzle_b) { - case PIPE_SWIZZLE_ZERO: + case PIPE_SWIZZLE_0: for (j = 0; j < 4; j++) out[2][j] = 0.0f; break; - case PIPE_SWIZZLE_ONE: + case PIPE_SWIZZLE_1: for (j = 0; j < 4; j++) out[2][j] = 1.0f; break; @@ -2818,11 +2818,11 @@ do_swizzling(const struct pipe_sampler_view *sview, } switch (swizzle_a) { - case PIPE_SWIZZLE_ZERO: + case PIPE_SWIZZLE_0: for (j = 0; j < 4; j++) out[3][j] = 0.0f; break; - case PIPE_SWIZZLE_ONE: + case PIPE_SWIZZLE_1: for (j = 0; j < 4; j++) out[3][j] = 1.0f; break; @@ -2928,10 +2928,10 @@ get_linear_wrap(unsigned mode) static inline bool any_swizzle(const struct pipe_sampler_view *view) { - return (view->swizzle_r != PIPE_SWIZZLE_RED || - view->swizzle_g != PIPE_SWIZZLE_GREEN || - view->swizzle_b != PIPE_SWIZZLE_BLUE || - view->swizzle_a != PIPE_SWIZZLE_ALPHA); + return (view->swizzle_r != PIPE_SWIZZLE_X || + view->swizzle_g != PIPE_SWIZZLE_Y || + view->swizzle_b != PIPE_SWIZZLE_Z || + view->swizzle_a != PIPE_SWIZZLE_W); } diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index bedda2ecf71..f0ef65f3d71 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -1826,11 +1826,11 @@ emit_tex_swizzle(struct svga_shader_emitter *emit, /* build writemasks and srcSwizzle terms */ for (i = 0; i < 4; i++) { - if (swizzleIn[i] == PIPE_SWIZZLE_ZERO) { + if (swizzleIn[i] == PIPE_SWIZZLE_0) { srcSwizzle[i] = TGSI_SWIZZLE_X + i; zeroWritemask |= (1 << i); } - else if (swizzleIn[i] == PIPE_SWIZZLE_ONE) { + else if (swizzleIn[i] == PIPE_SWIZZLE_1) { srcSwizzle[i] = TGSI_SWIZZLE_X + i; oneWritemask |= (1 << i); } @@ -1897,10 +1897,10 @@ emit_tex(struct svga_shader_emitter *emit, PIPE_TEX_COMPARE_R_TO_TEXTURE); /* texture swizzle */ - boolean swizzle = (emit->key.tex[unit].swizzle_r != PIPE_SWIZZLE_RED || - emit->key.tex[unit].swizzle_g != PIPE_SWIZZLE_GREEN || - emit->key.tex[unit].swizzle_b != PIPE_SWIZZLE_BLUE || - emit->key.tex[unit].swizzle_a != PIPE_SWIZZLE_ALPHA); + boolean swizzle = (emit->key.tex[unit].swizzle_r != PIPE_SWIZZLE_X || + emit->key.tex[unit].swizzle_g != PIPE_SWIZZLE_Y || + emit->key.tex[unit].swizzle_b != PIPE_SWIZZLE_Z || + emit->key.tex[unit].swizzle_a != PIPE_SWIZZLE_W); boolean saturate = insn->Instruction.Saturate; @@ -3633,12 +3633,12 @@ needs_to_create_common_immediate(const struct svga_shader_emitter *emit) if (emit->inverted_texcoords) return TRUE; - /* look for any PIPE_SWIZZLE_ZERO/ONE terms */ + /* look for any PIPE_SWIZZLE_0/ONE terms */ for (i = 0; i < emit->key.num_textures; i++) { - if (emit->key.tex[i].swizzle_r > PIPE_SWIZZLE_ALPHA || - emit->key.tex[i].swizzle_g > PIPE_SWIZZLE_ALPHA || - emit->key.tex[i].swizzle_b > PIPE_SWIZZLE_ALPHA || - emit->key.tex[i].swizzle_a > PIPE_SWIZZLE_ALPHA) + if (emit->key.tex[i].swizzle_r > PIPE_SWIZZLE_W || + emit->key.tex[i].swizzle_g > PIPE_SWIZZLE_W || + emit->key.tex[i].swizzle_b > PIPE_SWIZZLE_W || + emit->key.tex[i].swizzle_a > PIPE_SWIZZLE_W) return TRUE; } diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index f8f615e7651..a899c47cd7f 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -5049,20 +5049,20 @@ end_tex_swizzle(struct svga_shader_emitter_v10 *emit, /* Swizzle w/out zero/one terms */ struct tgsi_full_src_register src_swizzled = swizzle_src(&swz->tmp_src, - swz_r < PIPE_SWIZZLE_ZERO ? swz_r : PIPE_SWIZZLE_RED, - swz_g < PIPE_SWIZZLE_ZERO ? swz_g : PIPE_SWIZZLE_GREEN, - swz_b < PIPE_SWIZZLE_ZERO ? swz_b : PIPE_SWIZZLE_BLUE, - swz_a < PIPE_SWIZZLE_ZERO ? swz_a : PIPE_SWIZZLE_ALPHA); + swz_r < PIPE_SWIZZLE_0 ? swz_r : PIPE_SWIZZLE_X, + swz_g < PIPE_SWIZZLE_0 ? swz_g : PIPE_SWIZZLE_Y, + swz_b < PIPE_SWIZZLE_0 ? swz_b : PIPE_SWIZZLE_Z, + swz_a < PIPE_SWIZZLE_0 ? swz_a : PIPE_SWIZZLE_W); /* MOV dst, color(tmp).<swizzle> */ emit_instruction_op1(emit, VGPU10_OPCODE_MOV, swz->inst_dst, &src_swizzled, FALSE); /* handle swizzle zero terms */ - writemask_0 = (((swz_r == PIPE_SWIZZLE_ZERO) << 0) | - ((swz_g == PIPE_SWIZZLE_ZERO) << 1) | - ((swz_b == PIPE_SWIZZLE_ZERO) << 2) | - ((swz_a == PIPE_SWIZZLE_ZERO) << 3)); + writemask_0 = (((swz_r == PIPE_SWIZZLE_0) << 0) | + ((swz_g == PIPE_SWIZZLE_0) << 1) | + ((swz_b == PIPE_SWIZZLE_0) << 2) | + ((swz_a == PIPE_SWIZZLE_0) << 3)); if (writemask_0) { struct tgsi_full_src_register zero = int_tex ? @@ -5077,10 +5077,10 @@ end_tex_swizzle(struct svga_shader_emitter_v10 *emit, } /* handle swizzle one terms */ - writemask_1 = (((swz_r == PIPE_SWIZZLE_ONE) << 0) | - ((swz_g == PIPE_SWIZZLE_ONE) << 1) | - ((swz_b == PIPE_SWIZZLE_ONE) << 2) | - ((swz_a == PIPE_SWIZZLE_ONE) << 3)); + writemask_1 = (((swz_r == PIPE_SWIZZLE_1) << 0) | + ((swz_g == PIPE_SWIZZLE_1) << 1) | + ((swz_b == PIPE_SWIZZLE_1) << 2) | + ((swz_a == PIPE_SWIZZLE_1) << 3)); if (writemask_1) { struct tgsi_full_src_register one = int_tex ? diff --git a/src/gallium/drivers/vc4/vc4_formats.c b/src/gallium/drivers/vc4/vc4_formats.c index ffce61237de..dd700cdec7d 100644 --- a/src/gallium/drivers/vc4/vc4_formats.c +++ b/src/gallium/drivers/vc4/vc4_formats.c @@ -61,10 +61,10 @@ struct vc4_format { }; #define SWIZ(x,y,z,w) { \ - UTIL_FORMAT_SWIZZLE_##x, \ - UTIL_FORMAT_SWIZZLE_##y, \ - UTIL_FORMAT_SWIZZLE_##z, \ - UTIL_FORMAT_SWIZZLE_##w \ + PIPE_SWIZZLE_##x, \ + PIPE_SWIZZLE_##y, \ + PIPE_SWIZZLE_##z, \ + PIPE_SWIZZLE_##w \ } #define FORMAT(pipe, rt, tex, swiz) \ diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_io.c b/src/gallium/drivers/vc4/vc4_nir_lower_io.c index be89bfcc937..f1e5478126e 100644 --- a/src/gallium/drivers/vc4/vc4_nir_lower_io.c +++ b/src/gallium/drivers/vc4/vc4_nir_lower_io.c @@ -98,7 +98,7 @@ vc4_nir_get_vattr_channel_vpm(struct vc4_compile *c, &desc->channel[swiz]; nir_ssa_def *temp; - if (swiz > UTIL_FORMAT_SWIZZLE_W) { + if (swiz > PIPE_SWIZZLE_W) { return vc4_nir_get_swizzled_channel(b, vpm_reads, swiz); } else if (chan->size == 32 && chan->type == UTIL_FORMAT_TYPE_FLOAT) { return vc4_nir_get_swizzled_channel(b, vpm_reads, swiz); diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 8aba8badc42..02cae2d4648 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -127,17 +127,17 @@ vc4_nir_get_swizzled_channel(nir_builder *b, nir_ssa_def **srcs, int swiz) { switch (swiz) { default: - case UTIL_FORMAT_SWIZZLE_NONE: + case PIPE_SWIZZLE_NONE: fprintf(stderr, "warning: unknown swizzle\n"); /* FALLTHROUGH */ - case UTIL_FORMAT_SWIZZLE_0: + case PIPE_SWIZZLE_0: return nir_imm_float(b, 0.0); - case UTIL_FORMAT_SWIZZLE_1: + case PIPE_SWIZZLE_1: return nir_imm_float(b, 1.0); - case UTIL_FORMAT_SWIZZLE_X: - case UTIL_FORMAT_SWIZZLE_Y: - case UTIL_FORMAT_SWIZZLE_Z: - case UTIL_FORMAT_SWIZZLE_W: + case PIPE_SWIZZLE_X: + case PIPE_SWIZZLE_Y: + case PIPE_SWIZZLE_Z: + case PIPE_SWIZZLE_W: return srcs[swiz]; } } diff --git a/src/gallium/drivers/vc4/vc4_uniforms.c b/src/gallium/drivers/vc4/vc4_uniforms.c index 262531f1bd7..4715a7fffd5 100644 --- a/src/gallium/drivers/vc4/vc4_uniforms.c +++ b/src/gallium/drivers/vc4/vc4_uniforms.c @@ -85,10 +85,10 @@ write_texture_msaa_addr(struct vc4_context *vc4, #define SWIZ(x,y,z,w) { \ - UTIL_FORMAT_SWIZZLE_##x, \ - UTIL_FORMAT_SWIZZLE_##y, \ - UTIL_FORMAT_SWIZZLE_##z, \ - UTIL_FORMAT_SWIZZLE_##w \ + PIPE_SWIZZLE_##x, \ + PIPE_SWIZZLE_##y, \ + PIPE_SWIZZLE_##z, \ + PIPE_SWIZZLE_##w \ } static void |