Module: Mesa
Branch: master
Commit: 302bec24bd67cb21c39e9db872afe946994547a7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=302bec24bd67cb21c39e9db872afe946994547a7

Author: Marek Olšák <marek.ol...@amd.com>
Date:   Tue Apr 19 01:53:03 2016 +0200

radeonsi: move sample positions constant buffer to RW buffers

Reviewed-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haeh...@amd.com>

---

 src/gallium/drivers/radeonsi/si_shader.c | 4 ++--
 src/gallium/drivers/radeonsi/si_state.c  | 4 ++--
 src/gallium/drivers/radeonsi/si_state.h  | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
b/src/gallium/drivers/radeonsi/si_shader.c
index fc3e5c0..57bc7d3 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1135,8 +1135,8 @@ static LLVMValueRef load_sample_position(struct 
radeon_llvm_context *radeon_bld,
        struct lp_build_context *uint_bld = &radeon_bld->soa.bld_base.uint_bld;
        struct gallivm_state *gallivm = &radeon_bld->gallivm;
        LLVMBuilderRef builder = gallivm->builder;
-       LLVMValueRef desc = LLVMGetParam(ctx->radeon_bld.main_fn, 
SI_PARAM_CONST_BUFFERS);
-       LLVMValueRef buf_index = lp_build_const_int32(gallivm, 
SI_DRIVER_STATE_CONST_BUF);
+       LLVMValueRef desc = LLVMGetParam(ctx->radeon_bld.main_fn, 
SI_PARAM_RW_BUFFERS);
+       LLVMValueRef buf_index = lp_build_const_int32(gallivm, 
SI_PS_CONST_SAMPLE_POSITIONS);
        LLVMValueRef resource = build_indexed_load_const(ctx, desc, buf_index);
 
        /* offset = sample_id * 8  (8 = 2 floats containing samplepos.xy) */
diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index 74af14c..2e488fe 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2544,8 +2544,8 @@ static void si_set_framebuffer_state(struct pipe_context 
*ctx,
                        assert(0);
                }
                constbuf.buffer_size = sctx->framebuffer.nr_samples * 2 * 4;
-               ctx->set_constant_buffer(ctx, PIPE_SHADER_FRAGMENT,
-                                        SI_DRIVER_STATE_CONST_BUF, &constbuf);
+               si_set_constant_buffer(sctx, &sctx->rw_buffers,
+                                      SI_PS_CONST_SAMPLE_POSITIONS, &constbuf);
 
                /* Smoothing (only possible with nr_samples == 1) uses the same
                 * sample locations as the MSAA it simulates.
diff --git a/src/gallium/drivers/radeonsi/si_state.h 
b/src/gallium/drivers/radeonsi/si_state.h
index b7b00f0..2b566bf 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -180,6 +180,7 @@ enum {
 
        SI_VS_CONST_CLIP_PLANES,
        SI_PS_CONST_POLY_STIPPLE,
+       SI_PS_CONST_SAMPLE_POSITIONS,
 
        SI_NUM_RW_BUFFERS,
 };

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to