diff --git a/res/sh/common.hlsl b/res/sh/common.hlsl index 7a008d1e..4bbfe07b 100644 --- a/res/sh/common.hlsl +++ b/res/sh/common.hlsl @@ -6,8 +6,8 @@ #define DECL(t, n) t n : n #define NURI(i) NonUniformResourceIndex(i) -#if !SH_CPU -# define INLINE /* For intellisense */ +#ifdef INTELLISENSE +# define INLINE #endif /* Linear color from normalized sRGB */ diff --git a/res/sh/material.hlsl b/res/sh/material.hlsl index 1129a1e7..86b506e4 100644 --- a/res/sh/material.hlsl +++ b/res/sh/material.hlsl @@ -18,6 +18,7 @@ cbuffer cb : register(b0) { struct sh_material_constants g_constants; }; StructuredBuffer g_instances : register(t0); Texture2D g_nuri_textures[] : register(t1); + SamplerState g_sampler : register(s0); /* ========================== * diff --git a/src/gp_dx12.c b/src/gp_dx12.c index 36f9d6f4..9bb5b80f 100644 --- a/src/gp_dx12.c +++ b/src/gp_dx12.c @@ -2195,9 +2195,17 @@ INTERNAL struct dx12_resource *update_swapchain(struct sys_window *window, struc return G.swapchain_resources[G.swapchain_frame_index]; } + + + + + /* FIXME: Remove this */ #include "draw.h" + + + INTERNAL void present_blit(struct dx12_resource *dst, struct dx12_resource *src, struct xform src_xf) { /* FIXME: Remove this */ @@ -2227,6 +2235,12 @@ INTERNAL void present_blit(struct dx12_resource *dst, struct dx12_resource *src, gp_dispatch(params); } + + + + + + void gp_present(struct sys_window *window, struct v2i32 backbuffer_resolution, struct gp_handle texture, struct xform texture_xf, i32 vsync) { query_memory_info(); diff --git a/src/thread_local.c b/src/thread_local.c index 8e60cf3e..3c001441 100644 --- a/src/thread_local.c +++ b/src/thread_local.c @@ -4,10 +4,9 @@ #include "atomic.h" #include "intrinsics.h" -#define THREAD_LOCAL_STORE_RESERVE (MEGABYTE(64)) - -/* Arbitrary. Increase if needed. */ +/* Arbitrary limits. Increase if needed. */ #define MAX_THREAD_LOCAL_VARS 256 +#define THREAD_LOCAL_STORE_RESERVE (MEGABYTE(64)) GLOBAL struct { struct atomic_i32 metas_lock_flag; @@ -17,8 +16,8 @@ GLOBAL struct { INTERNAL void metas_lock(void) { + /* Spinlock */ while (atomic_i32_eval_compare_exchange(&G.metas_lock_flag, 0, 1) == 0) { - /* Spinlock */ ix_pause(); } } @@ -54,7 +53,6 @@ void thread_local_store_release(struct thread_local_store *t) } } metas_unlock(); - arena_release(t->arena); } @@ -68,7 +66,7 @@ void *_thread_local_var_eval(struct thread_local_var_meta *meta) __profscope(_thread_local_var_eval__REGISTER); metas_lock(); { - id_plus_one = atomic_u64_eval(&meta->id_plus_one); /* Re-check now that locked */ + id_plus_one = atomic_u64_eval(&meta->id_plus_one); /* Reevaluate now that we've locked */ if (id_plus_one == 0) { id = G.metas_count++; if (id >= MAX_THREAD_LOCAL_VARS) {