[Mesa-dev] [PATCH] r600g: switch SNORM conversion to DX and GLES behavior

Marek Olšák maraeo at gmail.com
Thu Jul 24 10:25:52 PDT 2014


From: Marek Olšák <marek.olsak at amd.com>

it also matches GL 4.2

further discussion:
http://lists.freedesktop.org/archives/mesa-dev/2013-August/042680.html
---
 src/gallium/drivers/r600/evergreen_state.c | 2 --
 src/gallium/drivers/r600/r600_asm.c        | 1 -
 src/gallium/drivers/r600/r600_shader.c     | 2 --
 src/gallium/drivers/r600/r600_state.c      | 2 --
 4 files changed, 7 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 9688b5e..005184d 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -635,7 +635,6 @@ texture_buffer_sampler_view(struct r600_pipe_sampler_view *view,
 		S_030008_DATA_FORMAT(format) |
 		S_030008_NUM_FORMAT_ALL(num_format) |
 		S_030008_FORMAT_COMP_ALL(format_comp) |
-		S_030008_SRF_MODE_ALL(1) |
 		S_030008_ENDIAN_SWAP(endian);
 	view->tex_resource_words[3] = swizzle_res;
 	/*
@@ -814,7 +813,6 @@ evergreen_create_sampler_view_custom(struct pipe_context *ctx,
 	}
 
 	view->tex_resource_words[4] = (word4 |
-				       S_030010_SRF_MODE_ALL(V_030010_SRF_MODE_ZERO_CLAMP_MINUS_ONE) |
 				       S_030010_ENDIAN_SWAP(endian));
 	view->tex_resource_words[5] = S_030014_BASE_ARRAY(state->u.tex.first_layer) |
 				      S_030014_LAST_ARRAY(state->u.tex.last_layer);
diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index e75f7d6..4da918c 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -2375,7 +2375,6 @@ void *r600_create_vertex_fetch_shader(struct pipe_context *ctx,
 		vtx.data_format = format;
 		vtx.num_format_all = num_format;
 		vtx.format_comp_all = format_comp;
-		vtx.srf_mode_all = 1;
 		vtx.offset = elements[i].src_offset;
 		vtx.endian = endian;
 
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index db928f3..0dfb58d 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -854,7 +854,6 @@ static int tgsi_fetch_rel_const(struct r600_shader_ctx *ctx,
 	vtx.data_format = FMT_32_32_32_32_FLOAT;
 	vtx.num_format_all = 2;		/* NUM_FORMAT_SCALED */
 	vtx.format_comp_all = 1;	/* FORMAT_COMP_SIGNED */
-	vtx.srf_mode_all = 1;		/* SRF_MODE_NO_ZERO */
 	vtx.endian = r600_endian_swap(32);
 
 	if ((r = r600_bytecode_add_vtx(ctx->bc, &vtx)))
@@ -4354,7 +4353,6 @@ static int do_vtx_fetch_inst(struct r600_shader_ctx *ctx, boolean src_requires_l
 	vtx.dst_sel_z = (inst->Dst[0].Register.WriteMask & 4) ? 2 : 7;		/* SEL_Z */
 	vtx.dst_sel_w = (inst->Dst[0].Register.WriteMask & 8) ? 3 : 7;		/* SEL_W */
 	vtx.use_const_fields = 1;
-	vtx.srf_mode_all = 1;		/* SRF_MODE_NO_ZERO */
 
 	if ((r = r600_bytecode_add_vtx(ctx->bc, &vtx)))
 		return r;
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 9e7a8e9..70bb370 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -618,7 +618,6 @@ texture_buffer_sampler_view(struct r600_pipe_sampler_view *view,
 		S_038008_DATA_FORMAT(format) |
 		S_038008_NUM_FORMAT_ALL(num_format) |
 		S_038008_FORMAT_COMP_ALL(format_comp) |
-		S_038008_SRF_MODE_ALL(1) |
 		S_038008_ENDIAN_SWAP(endian);
 	view->tex_resource_words[3] = 0;
 	/*
@@ -729,7 +728,6 @@ r600_create_sampler_view_custom(struct pipe_context *ctx,
 		view->tex_resource_words[3] = tmp->surface.level[offset_level + 1].offset >> 8;
 	}
 	view->tex_resource_words[4] = (word4 |
-				       S_038010_SRF_MODE_ALL(V_038010_SRF_MODE_ZERO_CLAMP_MINUS_ONE) |
 				       S_038010_REQUEST_SIZE(1) |
 				       S_038010_ENDIAN_SWAP(endian) |
 				       S_038010_BASE_LEVEL(0));
-- 
1.9.1



More information about the mesa-dev mailing list