diff options
author | Kenneth Graunke <[email protected]> | 2016-03-01 16:26:09 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2016-03-01 17:11:29 -0800 |
commit | 89e421369c54a8edc4930352e062f03b5c66b886 (patch) | |
tree | 54ec1f2d99454da125abe0ed49164b1c47fd9d36 /src/gallium/state_trackers | |
parent | e941fd84707d4ed04a683f8862d184956a60f9ad (diff) | |
parent | 1be953797ea4ae31193ab40bd35133eef38ae0ce (diff) |
Merge remote-tracking branch 'origin/master' into vulkan
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/clover/Makefile.am | 1 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/Makefile.sources | 1 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/buffer9.c | 26 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_shader.c | 38 |
4 files changed, 42 insertions, 24 deletions
diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am index 3c9421692fc..4c9d7d9b7be 100644 --- a/src/gallium/state_trackers/clover/Makefile.am +++ b/src/gallium/state_trackers/clover/Makefile.am @@ -41,6 +41,7 @@ libclllvm_la_CXXFLAGS = \ $(VISIBILITY_CXXFLAGS) \ $(LLVM_CXXFLAGS) \ $(DEFINES) \ + $(LIBELF_CFLAGS) \ -DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \ -DLIBCLC_LIBEXECDIR=\"$(LIBCLC_LIBEXECDIR)/\" \ -DCLANG_RESOURCE_DIR=\"$(CLANG_RESOURCE_DIR)\" diff --git a/src/gallium/state_trackers/nine/Makefile.sources b/src/gallium/state_trackers/nine/Makefile.sources index 05eb1655376..af80532ce37 100644 --- a/src/gallium/state_trackers/nine/Makefile.sources +++ b/src/gallium/state_trackers/nine/Makefile.sources @@ -35,6 +35,7 @@ C_SOURCES := \ nine_flags.h \ nine_helpers.c \ nine_helpers.h \ + nine_limits.h \ nine_lock.c \ nine_lock.h \ nine_pdata.h \ diff --git a/src/gallium/state_trackers/nine/buffer9.c b/src/gallium/state_trackers/nine/buffer9.c index e066fc59f45..1103741f7ee 100644 --- a/src/gallium/state_trackers/nine/buffer9.c +++ b/src/gallium/state_trackers/nine/buffer9.c @@ -174,13 +174,18 @@ NineBuffer9_Lock( struct NineBuffer9 *This, u_box_1d(OffsetToLock, SizeToLock, &box); if (This->base.pool == D3DPOOL_MANAGED) { - if (!This->managed.dirty) { - assert(LIST_IS_EMPTY(&This->managed.list)); - list_add(&This->managed.list, &This->base.base.device->update_buffers); - This->managed.dirty = TRUE; - This->managed.dirty_box = box; - } else { - u_box_union_2d(&This->managed.dirty_box, &This->managed.dirty_box, &box); + /* READONLY doesn't dirty the buffer */ + if (!(Flags & D3DLOCK_READONLY)) { + if (!This->managed.dirty) { + assert(LIST_IS_EMPTY(&This->managed.list)); + This->managed.dirty = TRUE; + This->managed.dirty_box = box; + } else { + u_box_union_2d(&This->managed.dirty_box, &This->managed.dirty_box, &box); + /* Do not upload while we are locking, we'll add it back later */ + if (!LIST_IS_EMPTY(&This->managed.list)) + list_delinit(&This->managed.list); + } } *ppbData = (char *)This->managed.data + OffsetToLock; DBG("returning pointer %p\n", *ppbData); @@ -229,8 +234,13 @@ NineBuffer9_Unlock( struct NineBuffer9 *This ) user_assert(This->nmaps > 0, D3DERR_INVALIDCALL); if (This->base.pool != D3DPOOL_MANAGED) This->pipe->transfer_unmap(This->pipe, This->maps[--(This->nmaps)]); - else + else { This->nmaps--; + /* TODO: Fix this to upload at the first draw call needing the data, + * instead of at the next draw call */ + if (!This->nmaps && This->managed.dirty && LIST_IS_EMPTY(&This->managed.list)) + list_add(&This->managed.list, &This->base.base.device->update_buffers); + } return D3D_OK; } diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index a7a7da27903..eb6479bb4d9 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -830,6 +830,18 @@ nine_ureg_dst_register(unsigned file, int index) return ureg_dst(ureg_src_register(file, index)); } +static inline struct ureg_src +nine_get_position_input(struct shader_translator *tx) +{ + struct ureg_program *ureg = tx->ureg; + + if (tx->wpos_is_sysval) + return ureg_DECL_system_value(ureg, TGSI_SEMANTIC_POSITION, 0); + else + return ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, + 0, TGSI_INTERPOLATE_LINEAR); +} + static struct ureg_src tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) { @@ -955,16 +967,8 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) case D3DSPR_MISCTYPE: switch (param->idx) { case D3DSMO_POSITION: - if (ureg_src_is_undef(tx->regs.vPos)) { - if (tx->wpos_is_sysval) { - tx->regs.vPos = - ureg_DECL_system_value(ureg, TGSI_SEMANTIC_POSITION, 0); - } else { - tx->regs.vPos = - ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, 0, - TGSI_INTERPOLATE_LINEAR); - } - } + if (ureg_src_is_undef(tx->regs.vPos)) + tx->regs.vPos = nine_get_position_input(tx); if (tx->shift_wpos) { /* TODO: do this only once */ struct ureg_dst wpos = tx_scratch(tx); @@ -2048,9 +2052,16 @@ DECL_SPECIAL(DCL) unsigned interp_location = 0; /* SM3 only, SM2 input semantic determined by file */ assert(sem.reg.idx < Elements(tx->regs.v)); + + if (tgsi.Name == TGSI_SEMANTIC_POSITION) { + tx->regs.v[sem.reg.idx] = nine_get_position_input(tx); + return D3D_OK; + } + if (sem.reg.mod & NINED3DSPDM_CENTROID || (tgsi.Name == TGSI_SEMANTIC_COLOR && tx->info->force_color_in_centroid)) interp_location = TGSI_INTERPOLATE_LOC_CENTROID; + tx->regs.v[sem.reg.idx] = ureg_DECL_fs_input_cyl_centroid( ureg, tgsi.Name, tgsi.Index, nine_tgsi_to_interp_mode(&tgsi), @@ -3269,12 +3280,7 @@ shader_add_ps_fog_stage(struct shader_translator *tx, struct ureg_src src_col) } if (tx->info->fog_mode != D3DFOG_NONE) { - if (tx->wpos_is_sysval) { - depth = ureg_DECL_system_value(ureg, TGSI_SEMANTIC_POSITION, 0); - } else { - depth = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, 0, - TGSI_INTERPOLATE_LINEAR); - } + depth = nine_get_position_input(tx); depth = ureg_scalar(depth, TGSI_SWIZZLE_Z); } |