Fixes bad resource usage in rendering

D3D11 is quite strict about how resources are supposed to be used - read/write & CPU access.
This changes Tex2DKind and BufferKind into one uniform ResourceKind (because it's the same thing really).

And it is more strict about usage:
1) Static is not allowed to update, resource is immutable, data provided at creation
2) Dynamic allows CPU to update GPU resource occasionally via UpdateSubresource
3) Stream allows CPU to update GPU resource often via Map/Unmap (currently unused)
This commit is contained in:
Martins Mozeiko authored and Ryan Fleury committed 2024-05-24 14:04:42 -07:00
1 parent 7e0611e7f1
commit fd982d38fc
11 files changed
+80 -87

No files matched your search

+1 -1
View File
@@ -13091,7 +13091,7 @@ df_gfx_init(OS_WindowRepaintFunctionType *window_repaint_entry_point, DF_StateDe
}
// rjf: upload to gpu texture
df_gfx_state->icon_texture = r_tex2d_alloc(R_Tex2DKind_Static, image_dim, R_Tex2DFormat_RGBA8, image_data);
df_gfx_state->icon_texture = r_tex2d_alloc(R_ResourceKind_Static, image_dim, R_Tex2DFormat_RGBA8, image_data);
// rjf: release
stbi_image_free(image_data);