fix render layer guid linking w/out font provider layer; eliminate generation number on render handles; sketch out tester scratch program for text drawing performance

This commit is contained in:
Ryan Fleury
2024-11-08 14:25:11 -08:00
parent 8e6a0ae4db
commit 65ada18d1d
13 changed files with 113 additions and 20 deletions
+3 -6
View File
@@ -39,7 +39,7 @@ internal R_D3D11_Window *
r_d3d11_window_from_handle(R_Handle handle)
{
R_D3D11_Window *window = (R_D3D11_Window *)handle.u64[0];
if(window->generation != handle.u64[1])
if(window == 0)
{
window = &r_d3d11_window_nil;
}
@@ -51,7 +51,6 @@ r_d3d11_handle_from_window(R_D3D11_Window *window)
{
R_Handle handle = {0};
handle.u64[0] = (U64)window;
handle.u64[1] = window->generation;
return handle;
}
@@ -59,7 +58,7 @@ internal R_D3D11_Tex2D *
r_d3d11_tex2d_from_handle(R_Handle handle)
{
R_D3D11_Tex2D *texture = (R_D3D11_Tex2D *)handle.u64[0];
if(texture == 0 || texture->generation != handle.u64[1])
if(texture == 0)
{
texture = &r_d3d11_tex2d_nil;
}
@@ -71,7 +70,6 @@ r_d3d11_handle_from_tex2d(R_D3D11_Tex2D *texture)
{
R_Handle handle = {0};
handle.u64[0] = (U64)texture;
handle.u64[1] = texture->generation;
return handle;
}
@@ -79,7 +77,7 @@ internal R_D3D11_Buffer *
r_d3d11_buffer_from_handle(R_Handle handle)
{
R_D3D11_Buffer *buffer = (R_D3D11_Buffer *)handle.u64[0];
if(buffer == 0 || buffer->generation != handle.u64[1])
if(buffer == 0)
{
buffer = &r_d3d11_buffer_nil;
}
@@ -91,7 +89,6 @@ r_d3d11_handle_from_buffer(R_D3D11_Buffer *buffer)
{
R_Handle handle = {0};
handle.u64[0] = (U64)buffer;
handle.u64[1] = buffer->generation;
return handle;
}
+3
View File
@@ -4,6 +4,9 @@
#ifndef RENDER_D3D11_H
#define RENDER_D3D11_H
#include <combaseapi.h>
#include <dcommon.h>
#include <initguid.h>
#include <windows.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
+3 -3
View File
@@ -29,9 +29,9 @@ enum
typedef union R_Handle R_Handle;
union R_Handle
{
U64 u64[2];
U32 u32[4];
U16 u16[8];
U64 u64[1];
U32 u32[2];
U16 u16[4];
};
////////////////////////////////