formatting
This commit is contained in:
parent
7a4554ba99
commit
ccf47c03f6
@ -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 */
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
cbuffer cb : register(b0) { struct sh_material_constants g_constants; };
|
||||
StructuredBuffer<struct sh_material_instance> g_instances : register(t0);
|
||||
Texture2D g_nuri_textures[] : register(t1);
|
||||
|
||||
SamplerState g_sampler : register(s0);
|
||||
|
||||
/* ========================== *
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user