From 09472006ff15316900fb2bb23fb639066f148fb5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 23 Jan 2019 11:54:48 -0800 Subject: v3d: Use the symbolic names for wrap modes from the XML. --- src/broadcom/cle/v3d_packet_v33.xml | 10 +++++----- src/gallium/drivers/v3d/v3dx_state.c | 15 +++++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/broadcom/cle/v3d_packet_v33.xml b/src/broadcom/cle/v3d_packet_v33.xml index 31395450153..4f605e7a4d0 100644 --- a/src/broadcom/cle/v3d_packet_v33.xml +++ b/src/broadcom/cle/v3d_packet_v33.xml @@ -100,11 +100,11 @@ - - - - - + + + + + diff --git a/src/gallium/drivers/v3d/v3dx_state.c b/src/gallium/drivers/v3d/v3dx_state.c index 9560d3f293b..eafa8853cb9 100644 --- a/src/gallium/drivers/v3d/v3dx_state.c +++ b/src/gallium/drivers/v3d/v3dx_state.c @@ -503,19 +503,22 @@ v3d_set_framebuffer_state(struct pipe_context *pctx, v3d->dirty |= VC5_DIRTY_FRAMEBUFFER; } -static uint32_t translate_wrap(uint32_t pipe_wrap, bool using_nearest) +static enum V3DX(Wrap_Mode) +translate_wrap(uint32_t pipe_wrap, bool using_nearest) { switch (pipe_wrap) { case PIPE_TEX_WRAP_REPEAT: - return 0; + return V3D_WRAP_MODE_REPEAT; case PIPE_TEX_WRAP_CLAMP_TO_EDGE: - return 1; + return V3D_WRAP_MODE_CLAMP; case PIPE_TEX_WRAP_MIRROR_REPEAT: - return 2; + return V3D_WRAP_MODE_MIRROR; case PIPE_TEX_WRAP_CLAMP_TO_BORDER: - return 3; + return V3D_WRAP_MODE_BORDER; case PIPE_TEX_WRAP_CLAMP: - return (using_nearest ? 1 : 3); + return (using_nearest ? + V3D_WRAP_MODE_CLAMP : + V3D_WRAP_MODE_BORDER); default: unreachable("Unknown wrap mode"); } -- cgit v1.2.3