r600g: switch SNORM conversion to DX and GLES behavior
authorMarek Olšák <marek.olsak@amd.com>
Wed, 23 Jul 2014 17:22:30 +0000 (19:22 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 28 Jul 2014 21:57:08 +0000 (23:57 +0200)
it also matches GL 4.2

further discussion:
http://lists.freedesktop.org/archives/mesa-dev/2013-August/042680.html

Cc: mesa-stable@lists.freedesktop.org
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_asm.c
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/r600_state.c

index 8f5ba5f0a313dbb32bf695cd32c446d6a491fea6..45c611e5cc24ba11197d3a17be5926e30e5d9a64 100644 (file)
@@ -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);
index e75f7d622c6f810bbf1f5df43ed1e48ca99760b1..4da918c9f312b1d5d0b2f2bacdb6750c1d18c510 100644 (file)
@@ -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;
 
index 907547d66f40e5f76ab2ec879a407426c2c4368f..9f4c3019aa838c88b353e9771fb33cb886b2e572 100644 (file)
@@ -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;
index 9e7a8e95289267fe973c002837e0e4877cf3d869..70bb370608fb227bf8a20b7a13bc4873557b30e8 100644 (file)
@@ -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));