Compare commits

...

124 Commits
main ... d3d11

Author SHA1 Message Date
cosmonaut 856a7004ae DiscardView is broken on cubemap faces so whatever
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2024-03-07 00:16:11 -08:00
cosmonaut a80f3f40dd more d3d11 constant buffer fixes
continuous-integration/drone/push Build is failing Details
2024-03-06 23:55:37 -08:00
cosmonaut 397e84fe4a workaround for broken d3d11 constant buffer updates
continuous-integration/drone/push Build is failing Details
2024-03-06 22:42:01 -08:00
cosmonaut d3d5a5a525 don't re-track transfer buffers on same command buffer
continuous-integration/drone/push Build is failing Details
2024-03-06 14:29:53 -08:00
cosmonaut 1dcf29eed4 fix texture 2d array SRV
continuous-integration/drone/push Build is failing Details
2024-03-06 14:17:55 -08:00
cosmonaut bb57528242 reduce transfer buffer alloc count + fix use after free 2024-03-06 14:17:43 -08:00
cosmonaut efd26f474a D3D11 discard in BeginRenderPass
continuous-integration/drone/push Build is failing Details
2024-03-06 11:32:23 -08:00
cosmonaut 5db754719a set msaaTargetView to NULL
continuous-integration/drone/push Build is failing Details
2024-03-06 00:03:55 -08:00
cosmonaut 75927137d6 implement D3D11 MSAA targets
continuous-integration/drone/push Build is failing Details
2024-03-05 23:55:04 -08:00
cosmonaut ded5dac60a 3d copy TODO
continuous-integration/drone/push Build is failing Details
2024-03-05 22:48:04 -08:00
cosmonaut 548c468cc9 release swapchain SRV on resize
continuous-integration/drone/push Build is failing Details
2024-03-05 22:45:47 -08:00
cosmonaut 45e7dde067 fix d3d11 transfer buffer allocation
continuous-integration/drone/push Build is failing Details
2024-03-05 22:41:07 -08:00
cosmonaut 23aed89ad9 more download fixes
continuous-integration/drone/push Build is failing Details
2024-03-05 22:24:33 -08:00
cosmonaut 953be4225c d3d11 swapchain texture handle + misc fixes
continuous-integration/drone/push Build is failing Details
2024-03-05 20:58:34 -08:00
cosmonaut 65c30350a7 fix Vulkan fence leak on download 2024-03-05 20:58:02 -08:00
cosmonaut 838b5df27b fix texture upload depth
continuous-integration/drone/push Build is failing Details
2024-03-05 17:54:50 -08:00
cosmonaut 52d4c934f3 modify readback API
continuous-integration/drone/push Build is failing Details
2024-03-05 17:30:20 -08:00
cosmonaut 6ebfabcecf fix compute uniform access 2024-03-05 16:31:41 -08:00
cosmonaut 01e805c800 fix render target view creation
continuous-integration/drone/push Build is failing Details
2024-03-05 16:18:31 -08:00
cosmonaut 6c2eef669e add correct defaults for buffer stride and buffer image height
continuous-integration/drone/push Build is failing Details
2024-03-05 16:06:39 -08:00
cosmonaut 3c74ddf8fa misc d3d11 fixes
continuous-integration/drone/push Build is failing Details
2024-03-05 15:45:41 -08:00
cosmonaut 5ed41a7de2 fill in a bit more d3d11 behavior
continuous-integration/drone/push Build is failing Details
2024-03-05 14:55:53 -08:00
cosmonaut 5c84debb50 implement d3d11 subresource tracking
continuous-integration/drone/push Build is failing Details
2024-03-05 12:27:38 -08:00
cosmonaut 128bd1f5f0 d3d11 copy pass implementation + filling in more APIs
continuous-integration/drone/push Build is failing Details
2024-03-04 18:01:37 -08:00
cosmonaut 52ac3e1980 implementing some transfer structure
continuous-integration/drone/push Build is failing Details
2024-03-04 11:29:23 -08:00
cosmonaut e01cab47ec D3D11 transfer buffer refcount and discard
continuous-integration/drone/push Build is failing Details
2024-03-03 11:27:48 -08:00
cosmonaut 16699e7ee3 implement D3D11 upload functions
continuous-integration/drone/push Build is failing Details
2024-03-03 10:58:44 -08:00
cosmonaut f61938011b draw and uniform push API change
continuous-integration/drone/push Build is failing Details
2024-03-02 23:33:36 -08:00
cosmonaut 172348e65f fix stencil API
continuous-integration/drone/push Build is failing Details
2024-03-02 23:11:37 -08:00
Caleb Cornett 8f2e70948d Fix infinite while loop in D3D11_INTERNAL_WaitForFence 2024-03-02 23:11:37 -08:00
Caleb Cornett e7d258dd36 Compute buffer creation fixes 2024-03-02 23:11:37 -08:00
Caleb Cornett 27b166dfde Move uav FIXME's to API FIXME's 2024-03-02 23:11:37 -08:00
Caleb Cornett 7274173b44 Add shader type to the .refresh shader bytecode format 2024-03-02 23:11:37 -08:00
Caleb Cornett c497402f1d Fix a few more FIXME's 2024-03-02 23:11:37 -08:00
Caleb Cornett 56f292f987 Note which FIXME's require a Refresh API update 2024-03-02 23:11:37 -08:00
Caleb Cornett 0a520f7a66 Combine swapchain and window data structs + actually allocate claimedWindows... 2024-03-02 23:11:37 -08:00
Caleb Cornett 4fe02e8571 FIXME fixups, mostly for contextLock 2024-03-02 23:11:37 -08:00
Caleb Cornett 539ee66d41 PresentMode fixes 2024-03-02 23:11:37 -08:00
Caleb Cornett 17f9322698 SetSwapchainPresentMode + other swapchain-y features from FNA3D D3D11 2024-03-02 23:11:37 -08:00
Caleb Cornett a5284ba0cd Fix non-MSAA cube RTs 2024-03-02 23:11:37 -08:00
Caleb Cornett 644763f004 MSAA for color and depth targets 2024-03-02 23:11:37 -08:00
Caleb Cornett b3addd6e0b SetTextureDataYUV 2024-03-02 23:11:37 -08:00
Caleb Cornett 95781e3378 Two typos in the same malloc... + cube RT fixes 2024-03-02 23:11:37 -08:00
Caleb Cornett 02aaf582d4 Fix copy-paste error from last commit 2024-03-02 23:11:37 -08:00
Caleb Cornett e3d112a971 Do some type shenanigans to allow depth textures to be sampled + fix viewport sizing logic 2024-03-02 23:11:37 -08:00
Caleb Cornett 9f78f83322 DepthStencilView creation + DS state fixes 2024-03-02 23:11:37 -08:00
Caleb Cornett 92f344d2f6 RTV overhaul to fix binding an RT with a specific depth/mip level 2024-03-02 23:11:37 -08:00
Caleb Cornett 0f2aacbae9 First rough pass at color RTs 2024-03-02 23:11:37 -08:00
Caleb Cornett dcac27b5d8 Use NO_OVERWRITE on uniform buffers after the initial WRITE_DISCARD + SetBufferData cleanup 2024-03-02 23:11:37 -08:00
Caleb Cornett c9b98c6e2b Fix repeated buffer writes by using USAGE_DEFAULT/UpdateSubresource instead of DYNAMIC/Map for non-uniform buffers 2024-03-02 23:11:37 -08:00
Caleb Cornett 557ce50737 PushComputeShaderUniforms + CreateComputePipeline fix 2024-03-02 23:11:37 -08:00
Caleb Cornett 11cbfca702 Actually compile compute shaders 2024-03-02 23:11:37 -08:00
Caleb Cornett f7fae4d314 GetBufferData 2024-03-02 23:11:36 -08:00
Caleb Cornett 508d077c26 QueueDestroyComputePipeline + style cleanup for QueueDestroyGraphicsPipeline 2024-03-02 23:11:36 -08:00
Caleb Cornett d76d223f68 Fence API 2024-03-02 23:11:36 -08:00
Caleb Cornett 105ef1aebb Clean up fence logic 2024-03-02 23:11:36 -08:00
Caleb Cornett 155d01ed92 Uniform buffer binding rework for clarity + minor cleanup 2024-03-02 23:11:36 -08:00
Caleb Cornett 06f00c77a0 First pass at fence infrastructure 2024-03-02 23:11:36 -08:00
Caleb Cornett 297b8b2cd2 First rough draft of Compute functions (untested!) 2024-03-02 23:11:36 -08:00
Caleb Cornett f598b65be5 DrawPrimitivesIndirect 2024-03-02 23:11:36 -08:00
Caleb Cornett 60a0ecab92 BindVertexSamplers 2024-03-02 23:11:36 -08:00
Caleb Cornett 4d11afa422 Fix 3D texture SRV creation, use UpdateSubresource1 to avoid bug with non-zero offsets on deferred contexts 2024-03-02 23:11:36 -08:00
Caleb Cornett 5d069f006d Fix fragment uniform buffer block calculation 2024-03-02 23:11:36 -08:00
Caleb Cornett e7be43e835 Fix device level check, fix ID3D11Device memory leak 2024-03-02 23:11:36 -08:00
Caleb Cornett b712bda8a3 Set up the DXGI Info Queue so we can filter messages without using DirectX Control Panel 2024-03-02 23:11:36 -08:00
Caleb Cornett 5f3dd6ba8a Add DXGIDebug logic to help track memory leaks, fix SRV leak it discovered 2024-03-02 23:11:36 -08:00
Caleb Cornett db6ad7fb6a Minor style cleanup 2024-03-02 23:11:36 -08:00
Caleb Cornett 0108b26d31 Fix a couple minor memory leaks 2024-03-02 23:11:36 -08:00
Caleb Cornett ca29f3b7da Release DLLs after releasing D3D11/DXGI objects (and release dxgi.dll!) 2024-03-02 23:11:36 -08:00
Caleb Cornett c9f23dd73b Fix degenerate InputLayout creation when creating graphics pipeline with no vertex attributes 2024-03-02 23:11:36 -08:00
Caleb Cornett a3c8ab6a55 Fixed uniform offsets, removed a bunch of code from cdefines.h 2024-03-02 23:11:36 -08:00
Caleb Cornett eb956a2f8b Uniform buffer infrastructure, still missing offset support 2024-03-02 23:11:36 -08:00
Caleb Cornett cdad57d1dd Fix texture conversion array 2024-03-02 23:11:36 -08:00
Caleb Cornett ce3b222529 Fix command buffer memory leak 2024-03-02 23:11:36 -08:00
Caleb Cornett 6a1c4ba80f CreateTexture, SetTextureData, BindIndexBuffer, BindFragmentSamplers, QueueDestroyTexture, DrawIndexedPrimitives, DrawInstancedPrimitives 2024-03-02 23:11:36 -08:00
Caleb Cornett a7bbc51653 Fix redundant error code printing 2024-03-02 23:11:36 -08:00
Caleb Cornett ba842d855e QueueDestroySampler 2024-03-02 23:11:36 -08:00
Caleb Cornett b906ec9c69 Add a border color conversion function 2024-03-02 23:11:36 -08:00
Caleb Cornett 7f4ddde607 CreateSampler 2024-03-02 23:11:36 -08:00
Caleb Cornett 15a73854b6 CreateBuffer, QueueDestroyBuffer, SetBufferData, BindVertexBuffers 2024-03-02 23:11:36 -08:00
Caleb Cornett abfdb2c7d9 Initial work on DestroyDevice 2024-03-02 23:11:36 -08:00
Caleb Cornett d7290c5e2b Implement SetViewport and SetScissor 2024-03-02 23:11:36 -08:00
Caleb Cornett 740fb56aa1 Style cleanups + added FIXME note for shader compilation 2024-03-02 23:11:36 -08:00
Caleb Cornett afeb7ebd16 shaderc now flips Y values in the vertex shader 2024-03-02 23:11:36 -08:00
Caleb Cornett 01cd001b07 DrawPrimitives, BindGraphicsPipeline, misc cleanup 2024-03-02 23:11:36 -08:00
Caleb Cornett dda7db1d92 Implement CreateShaderModule 2024-03-02 23:11:36 -08:00
Caleb Cornett f008408965 Pipeline creation copied over from old work + shaderc update 2024-03-02 23:11:36 -08:00
Caleb Cornett b74666a6d7 Fix for command pool crash, fix for hanging on Wait 2024-03-02 23:11:36 -08:00
Caleb Cornett acf64d51f0 Reworked Wait and Submit logic to use D3D11 Query objects as fences 2024-03-02 23:11:36 -08:00
Caleb Cornett acae35ebfa Stub out D3D11_Wait, fix crash when unclaiming windows, fix backend order 2024-03-02 23:11:36 -08:00
Caleb Cornett 0948537fe0 UnclaimWindow, swapchain destruction, fixed template signature 2024-03-02 23:11:36 -08:00
Caleb Cornett cbd8f4aee0 Implemented BeginRenderPass and Submit, ClearScreen works now! 2024-03-02 23:11:36 -08:00
Caleb Cornett dd9ae93696 More swapchain setup 2024-03-02 23:11:36 -08:00
Caleb Cornett 08ba467551 Apply swapchainDesc fix from FNA3D, add cdefines.h to CMakeLists 2024-03-02 23:11:36 -08:00
Caleb Cornett dd1060373d Implemented AcquireCommandBuffer (from old D3D11 work) 2024-03-02 23:11:36 -08:00
Caleb Cornett b9d7cec252 Implement ClaimWindow, mostly copied from Vulkan and FNA3D D3D11 2024-03-02 23:11:36 -08:00
Caleb Cornett 5385f02bbd Remove old stuff, flesh out PrepareDriver 2024-03-02 23:11:36 -08:00
Caleb Cornett d6378aba74 Groundwork for D3D11. Yoinked most of this from the prior work, but updated the ABI 2024-03-02 23:11:36 -08:00
cosmonaut 9d1059ed0e fix stencil state
continuous-integration/drone/push Build is passing Details
2024-03-02 23:11:07 -08:00
cosmonaut 7b0ed4278d correct stencil API change
continuous-integration/drone/push Build is failing Details
2024-03-02 23:00:44 -08:00
cosmonaut 02c0d85885 Resource containers, new bindings API, WriteOptions (#51)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #51
2024-03-02 09:09:49 +00:00
cosmonaut 695abd4139 alter vulkan defrag strategy
continuous-integration/drone/push Build is passing Details
2024-02-27 00:16:06 -08:00
cosmonaut 2361cec274 actually assign len in Refresh_Image_Info
continuous-integration/drone/push Build is passing Details
2024-02-25 01:44:19 -08:00
cosmonaut 899f961461 prefer host-local instead of require host-local
continuous-integration/drone/push Build is passing Details
2024-02-24 23:07:22 -08:00
cosmonaut 9d36ddaac1 Refresh2 Vulkan Implementation (#50)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #50
2024-02-23 23:46:02 +00:00
cosmonaut 4e1705d1bd specify buffer type in param name
continuous-integration/drone/push Build is failing Details
2024-02-23 09:50:48 -08:00
cosmonaut 2f57a05c85 rename CpuBuffer to TransferBuffer
continuous-integration/drone/push Build is failing Details
2024-02-23 09:42:31 -08:00
cosmonaut 2798067d54 add Refresh_Image_Info
continuous-integration/drone/push Build is failing Details
2024-02-23 00:03:17 -08:00
cosmonaut d34310a7df fix Refresh_CreateCpuBuffer in Refresh.c
continuous-integration/drone/push Build is failing Details
2024-02-22 10:34:48 -08:00
cosmonaut 73d927791a rename DISCARD to SAFEDISCARD
continuous-integration/drone/push Build is failing Details
2024-02-22 10:32:24 -08:00
cosmonaut 72ff9407c4 update CreateCpuBuffer in Refresh_Driver
continuous-integration/drone/push Build is failing Details
2024-02-21 10:59:31 -08:00
cosmonaut 52b99ea49a fix tabbing
continuous-integration/drone/push Build is failing Details
2024-02-17 20:23:09 -08:00
cosmonaut 94f181787b CpuBuffer Set/Get API
continuous-integration/drone/push Build is failing Details
2024-02-17 20:21:52 -08:00
cosmonaut c44a095bca CreateCpuBuffer writes a data pointer
continuous-integration/drone/push Build is failing Details
2024-02-16 18:53:52 -08:00
cosmonaut fdb29ade82 remove map/unmap calls
continuous-integration/drone/push Build is failing Details
2024-02-16 18:44:16 -08:00
cosmonaut 61386a27ba update Refresh_Driver.h and Refresh.c
continuous-integration/drone/push Build is failing Details
2024-02-16 17:54:58 -08:00
cosmonaut ce4d294a31 rework Push_Uniforms and Draw calls
continuous-integration/drone/push Build is failing Details
2024-02-16 17:51:18 -08:00
cosmonaut c779718967 buffer bindings should actually use uint64_t
continuous-integration/drone/push Build is failing Details
2024-02-15 20:05:18 -08:00
cosmonaut 218587bb6a rearrange copy params order
continuous-integration/drone/push Build is failing Details
2024-02-15 17:27:40 -08:00
cosmonaut 80914e9c38 add command buffer to Pass functions
continuous-integration/drone/push Build is failing Details
2024-02-15 16:48:26 -08:00
cosmonaut 342a7f9ef6 update ASSIGN_DRIVER_FUNC calls
continuous-integration/drone/push Build is failing Details
2024-02-15 16:34:52 -08:00
cosmonaut 5b82609565 some comment clarifications
continuous-integration/drone/push Build is failing Details
2024-02-13 12:25:53 -08:00
cosmonaut 10c0b5ae37 a few more API revisions
continuous-integration/drone/push Build is failing Details
2024-02-12 11:00:06 -08:00
cosmonaut 6f31f17be1 proposed API revision
continuous-integration/drone/push Build is failing Details
2024-02-12 00:04:02 -08:00
14 changed files with 8358 additions and 3777 deletions

View File

@ -41,6 +41,12 @@ add_definitions(
-DREFRESH_DRIVER_VULKAN
)
if (WIN32)
add_definitions(
-DREFRESH_DRIVER_D3D11
)
endif()
# Source lists
add_library(Refresh
# Public Headers
@ -49,8 +55,10 @@ add_library(Refresh
# Internal Headers
src/Refresh_Driver.h
src/Refresh_Driver_Vulkan_vkfuncs.h
src/Refresh_Driver_D3D11_cdefines.h
# Source Files
src/Refresh.c
src/Refresh_Driver_D3D11.c
src/Refresh_Driver_Vulkan.c
src/Refresh_Image.c
)

File diff suppressed because it is too large Load Diff

View File

@ -63,6 +63,20 @@ REFRESHAPI uint8_t* Refresh_Image_Load(
int32_t *len
);
/* Get image dimensions without fully decoding the image.
*
* w: Filled with the width of the image.
* h: Filled with the height of the image.
* len: Filled with the length of pixel data in bytes.
*/
REFRESHAPI uint8_t Refresh_Image_Info(
uint8_t *bufferPtr,
int32_t bufferLength,
int32_t *w,
int32_t *h,
int32_t *len
);
/* Frees memory returned by Refresh_Image_Load. Do NOT free the memory yourself!
*
* mem: A pointer previously returned by Refresh_Image_LoadPNG.

View File

@ -194,26 +194,37 @@ partial class Program
// Magic
writer.Write(new char[] { 'R', 'F', 'S', 'H'});
// Type
uint shaderTypeIndex;
switch (shaderType)
{
default:
case ".vert": shaderTypeIndex = 0; break;
case ".frag": shaderTypeIndex = 1; break;
case ".comp": shaderTypeIndex = 2; break;
}
writer.Write(shaderTypeIndex);
if (data.vulkan)
{
string inputPath = Path.Combine(tempDir, $"{shaderName}.spv");
WriteShaderBlob(writer, inputPath, 1);
}
if (data.d3d11)
{
string inputPath = Path.Combine(tempDir, $"{shaderName}.hlsl");
WriteShaderBlob(writer, inputPath, 2);
}
#if PS5
if (data.ps5)
{
string ext = GetPS5ShaderFileExtension();
string inputPath = Path.Combine(tempDir, $"{shaderName}{ext}");
WriteShaderBlob(writer, inputPath, 2);
}
#endif
if (data.d3d11)
{
string inputPath = Path.Combine(tempDir, $"{shaderName}.hlsl");
WriteShaderBlob(writer, inputPath, 3);
}
#endif
}
}
@ -254,7 +265,7 @@ partial class Program
{
Process spirvcross = Process.Start(
"spirv-cross",
$"\"{spirvPath}\" --hlsl --shader-model 50 --output \"{outputPath}\""
$"\"{spirvPath}\" --hlsl --flip-vert-y --shader-model 50 --output \"{outputPath}\""
);
spirvcross.WaitForExit();
if (spirvcross.ExitCode != 0)

View File

@ -2,9 +2,9 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TargetName>refreshc</TargetName>
<PublishAot>true</PublishAot>
<PublishAot>true</PublishAot>
</PropertyGroup>
</Project>

View File

@ -39,6 +39,12 @@
#define VULKAN_DRIVER NULL
#endif
#ifdef REFRESH_DRIVER_D3D11
#define D3D11_DRIVER &D3D11Driver
#else
#define D3D11_DRIVER NULL
#endif
#ifdef REFRESH_DRIVER_PS5
#define PS5_DRIVER &PS5Driver
#else
@ -48,6 +54,7 @@
static const Refresh_Driver *backends[] = {
NULL,
VULKAN_DRIVER,
D3D11_DRIVER,
PS5_DRIVER
};
@ -196,110 +203,7 @@ void Refresh_DestroyDevice(Refresh_Device *device)
device->DestroyDevice(device);
}
void Refresh_DrawIndexedPrimitives(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t baseVertex,
uint32_t startIndex,
uint32_t primitiveCount,
uint32_t vertexParamOffset,
uint32_t fragmentParamOffset
) {
NULL_RETURN(device);
device->DrawIndexedPrimitives(
device->driverData,
commandBuffer,
baseVertex,
startIndex,
primitiveCount,
vertexParamOffset,
fragmentParamOffset
);
}
void Refresh_DrawInstancedPrimitives(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t baseVertex,
uint32_t startIndex,
uint32_t primitiveCount,
uint32_t instanceCount,
uint32_t vertexParamOffset,
uint32_t fragmentParamOffset
) {
NULL_RETURN(device);
device->DrawInstancedPrimitives(
device->driverData,
commandBuffer,
baseVertex,
startIndex,
primitiveCount,
instanceCount,
vertexParamOffset,
fragmentParamOffset
);
}
void Refresh_DrawPrimitives(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t vertexStart,
uint32_t primitiveCount,
uint32_t vertexParamOffset,
uint32_t fragmentParamOffset
) {
NULL_RETURN(device);
device->DrawPrimitives(
device->driverData,
commandBuffer,
vertexStart,
primitiveCount,
vertexParamOffset,
fragmentParamOffset
);
}
void Refresh_DrawPrimitivesIndirect(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_Buffer *buffer,
uint32_t offsetInBytes,
uint32_t drawCount,
uint32_t stride,
uint32_t vertexParamOffset,
uint32_t fragmentParamOffset
) {
NULL_RETURN(device);
device->DrawPrimitivesIndirect(
device->driverData,
commandBuffer,
buffer,
offsetInBytes,
drawCount,
stride,
vertexParamOffset,
fragmentParamOffset
);
}
void Refresh_DispatchCompute(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t groupCountX,
uint32_t groupCountY,
uint32_t groupCountZ,
uint32_t computeParamOffset
) {
NULL_RETURN(device);
device->DispatchCompute(
device->driverData,
commandBuffer,
groupCountX,
groupCountY,
groupCountZ,
computeParamOffset
);
}
/* State Creation */
Refresh_ComputePipeline* Refresh_CreateComputePipeline(
Refresh_Device *device,
@ -338,7 +242,7 @@ Refresh_ShaderModule* Refresh_CreateShaderModule(
Refresh_Device *device,
Refresh_ShaderModuleCreateInfo *shaderModuleCreateInfo
) {
Refresh_ShaderModuleCreateInfo driverSpecificCreateInfo = { 0, NULL };
Refresh_Driver_ShaderModuleCreateInfo driverSpecificCreateInfo = { 0, NULL, 0 };
uint8_t *bytes;
uint32_t i, size;
@ -348,12 +252,24 @@ Refresh_ShaderModule* Refresh_CreateShaderModule(
bytes = (uint8_t*) shaderModuleCreateInfo->byteCode;
if (bytes[0] != 'R' || bytes[1] != 'F' || bytes[2] != 'S' || bytes[3] != 'H')
{
Refresh_LogError("Cannot parse malformed Refresh shader blob!");
Refresh_LogError("Cannot parse malformed Refresh shader blob: Incorrect magic number");
return NULL;
}
/* get the type of shader */
driverSpecificCreateInfo.type = (Refresh_Driver_ShaderType) *((uint32_t*) &bytes[4]);
if ( driverSpecificCreateInfo.type < 0 ||
driverSpecificCreateInfo.type > REFRESH_DRIVER_SHADERTYPE_COMPUTE )
{
Refresh_LogError(
"Cannot parse malformed Refresh shader blob: Unknown shader type (%d)",
driverSpecificCreateInfo.type
);
return NULL;
}
/* find the code for the selected backend */
i = 4;
i = 8;
while (i < shaderModuleCreateInfo->codeSize)
{
size = *((uint32_t*) &bytes[i + 1]);
@ -398,215 +314,31 @@ Refresh_Texture* Refresh_CreateTexture(
);
}
Refresh_Buffer* Refresh_CreateBuffer(
Refresh_GpuBuffer* Refresh_CreateGpuBuffer(
Refresh_Device *device,
Refresh_BufferUsageFlags usageFlags,
uint32_t sizeInBytes
) {
NULL_RETURN_NULL(device);
return device->CreateBuffer(
return device->CreateGpuBuffer(
device->driverData,
usageFlags,
sizeInBytes
);
}
void Refresh_SetTextureData(
Refresh_TransferBuffer* Refresh_CreateTransferBuffer(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice,
void *data,
uint32_t dataLengthInBytes
uint32_t sizeInBytes
) {
NULL_RETURN(device);
device->SetTextureData(
NULL_RETURN_NULL(device);
return device->CreateTransferBuffer(
device->driverData,
commandBuffer,
textureSlice,
data,
dataLengthInBytes
sizeInBytes
);
}
void Refresh_SetTextureDataYUV(
Refresh_Device *device,
Refresh_CommandBuffer* commandBuffer,
Refresh_Texture *y,
Refresh_Texture *u,
Refresh_Texture *v,
uint32_t yWidth,
uint32_t yHeight,
uint32_t uvWidth,
uint32_t uvHeight,
void *yDataPtr,
void *uDataPtr,
void *vDataPtr,
uint32_t yDataLength,
uint32_t uvDataLength,
uint32_t yStride,
uint32_t uvStride
) {
NULL_RETURN(device);
device->SetTextureDataYUV(
device->driverData,
commandBuffer,
y,
u,
v,
yWidth,
yHeight,
uvWidth,
uvHeight,
yDataPtr,
uDataPtr,
vDataPtr,
yDataLength,
uvDataLength,
yStride,
uvStride
);
}
void Refresh_CopyTextureToTexture(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *sourceTextureSlice,
Refresh_TextureSlice *destinationTextureSlice,
Refresh_Filter filter
) {
NULL_RETURN(device);
device->CopyTextureToTexture(
device->driverData,
commandBuffer,
sourceTextureSlice,
destinationTextureSlice,
filter
);
}
void Refresh_CopyTextureToBuffer(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice,
Refresh_Buffer *buffer
) {
NULL_RETURN(device);
device->CopyTextureToBuffer(
device->driverData,
commandBuffer,
textureSlice,
buffer
);
}
void Refresh_SetBufferData(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_Buffer *buffer,
uint32_t offsetInBytes,
void* data,
uint32_t dataLength
) {
NULL_RETURN(device);
device->SetBufferData(
device->driverData,
commandBuffer,
buffer,
offsetInBytes,
data,
dataLength
);
}
uint32_t Refresh_PushVertexShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
) {
if (device == NULL) { return 0; }
return device->PushVertexShaderUniforms(
device->driverData,
commandBuffer,
data,
dataLengthInBytes
);
}
uint32_t Refresh_PushFragmentShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
) {
if (device == NULL) { return 0; }
return device->PushFragmentShaderUniforms(
device->driverData,
commandBuffer,
data,
dataLengthInBytes
);
}
uint32_t Refresh_PushComputeShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
) {
if (device == NULL) { return 0; }
return device->PushComputeShaderUniforms(
device->driverData,
commandBuffer,
data,
dataLengthInBytes
);
}
void Refresh_BindVertexSamplers(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_Texture **pTextures,
Refresh_Sampler **pSamplers
) {
NULL_RETURN(device);
device->BindVertexSamplers(
device->driverData,
commandBuffer,
pTextures,
pSamplers
);
}
void Refresh_BindFragmentSamplers(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_Texture **pTextures,
Refresh_Sampler **pSamplers
) {
NULL_RETURN(device);
device->BindFragmentSamplers(
device->driverData,
commandBuffer,
pTextures,
pSamplers
);
}
void Refresh_GetBufferData(
Refresh_Device *device,
Refresh_Buffer *buffer,
void *data,
uint32_t dataLengthInBytes
) {
NULL_RETURN(device);
device->GetBufferData(
device->driverData,
buffer,
data,
dataLengthInBytes
);
}
/* Disposal */
void Refresh_QueueDestroyTexture(
Refresh_Device *device,
@ -630,14 +362,25 @@ void Refresh_QueueDestroySampler(
);
}
void Refresh_QueueDestroyBuffer(
void Refresh_QueueDestroyGpuBuffer(
Refresh_Device *device,
Refresh_Buffer *buffer
Refresh_GpuBuffer *gpuBuffer
) {
NULL_RETURN(device);
device->QueueDestroyBuffer(
device->QueueDestroyGpuBuffer(
device->driverData,
buffer
gpuBuffer
);
}
void Refresh_QueueDestroyTransferBuffer(
Refresh_Device *device,
Refresh_TransferBuffer *transferBuffer
) {
NULL_RETURN(device);
device->QueueDestroyTransferBuffer(
device->driverData,
transferBuffer
);
}
@ -674,6 +417,8 @@ void Refresh_QueueDestroyGraphicsPipeline(
);
}
/* Render Pass */
void Refresh_BeginRenderPass(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
@ -691,14 +436,16 @@ void Refresh_BeginRenderPass(
);
}
void Refresh_EndRenderPass(
void Refresh_BindGraphicsPipeline(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer
Refresh_CommandBuffer *commandBuffer,
Refresh_GraphicsPipeline *graphicsPipeline
) {
NULL_RETURN(device);
device->EndRenderPass(
device->BindGraphicsPipeline(
device->driverData,
commandBuffer
commandBuffer,
graphicsPipeline
);
}
@ -728,26 +475,12 @@ void Refresh_SetScissor(
);
}
void Refresh_BindGraphicsPipeline(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_GraphicsPipeline *graphicsPipeline
) {
NULL_RETURN(device);
device->BindGraphicsPipeline(
device->driverData,
commandBuffer,
graphicsPipeline
);
}
void Refresh_BindVertexBuffers(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t firstBinding,
uint32_t bindingCount,
Refresh_Buffer **pBuffers,
uint64_t *pOffsets
Refresh_BufferBinding *pBindings
) {
NULL_RETURN(device);
device->BindVertexBuffers(
@ -755,28 +488,175 @@ void Refresh_BindVertexBuffers(
commandBuffer,
firstBinding,
bindingCount,
pBuffers,
pOffsets
pBindings
);
}
void Refresh_BindIndexBuffer(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_Buffer *buffer,
uint64_t offset,
Refresh_BufferBinding *pBinding,
Refresh_IndexElementSize indexElementSize
) {
NULL_RETURN(device);
device->BindIndexBuffer(
device->driverData,
commandBuffer,
buffer,
offset,
pBinding,
indexElementSize
);
}
void Refresh_BindVertexSamplers(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSamplerBinding *pBindings
) {
NULL_RETURN(device);
device->BindVertexSamplers(
device->driverData,
commandBuffer,
pBindings
);
}
void Refresh_BindFragmentSamplers(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSamplerBinding *pBindings
) {
NULL_RETURN(device);
device->BindFragmentSamplers(
device->driverData,
commandBuffer,
pBindings
);
}
void Refresh_PushVertexShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
) {
NULL_RETURN(device);
device->PushVertexShaderUniforms(
device->driverData,
commandBuffer,
data,
dataLengthInBytes
);
}
void Refresh_PushFragmentShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
) {
NULL_RETURN(device);
device->PushFragmentShaderUniforms(
device->driverData,
commandBuffer,
data,
dataLengthInBytes
);
}
void Refresh_DrawInstancedPrimitives(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t baseVertex,
uint32_t startIndex,
uint32_t primitiveCount,
uint32_t instanceCount
) {
NULL_RETURN(device);
device->DrawInstancedPrimitives(
device->driverData,
commandBuffer,
baseVertex,
startIndex,
primitiveCount,
instanceCount
);
}
void Refresh_DrawIndexedPrimitives(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t baseVertex,
uint32_t startIndex,
uint32_t primitiveCount
) {
NULL_RETURN(device);
device->DrawIndexedPrimitives(
device->driverData,
commandBuffer,
baseVertex,
startIndex,
primitiveCount
);
}
void Refresh_DrawPrimitives(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t vertexStart,
uint32_t primitiveCount
) {
NULL_RETURN(device);
device->DrawPrimitives(
device->driverData,
commandBuffer,
vertexStart,
primitiveCount
);
}
void Refresh_DrawPrimitivesIndirect(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *gpuBuffer,
uint32_t offsetInBytes,
uint32_t drawCount,
uint32_t stride
) {
NULL_RETURN(device);
device->DrawPrimitivesIndirect(
device->driverData,
commandBuffer,
gpuBuffer,
offsetInBytes,
drawCount,
stride
);
}
void Refresh_EndRenderPass(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer
) {
NULL_RETURN(device);
device->EndRenderPass(
device->driverData,
commandBuffer
);
}
/* Compute Pass */
void Refresh_BeginComputePass(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer
) {
NULL_RETURN(device);
device->BeginComputePass(
device->driverData,
commandBuffer
);
}
void Refresh_BindComputePipeline(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
@ -793,29 +673,219 @@ void Refresh_BindComputePipeline(
void Refresh_BindComputeBuffers(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_Buffer **pBuffers
Refresh_ComputeBufferBinding *pBindings
) {
NULL_RETURN(device);
device->BindComputeBuffers(
device->driverData,
commandBuffer,
pBuffers
pBindings
);
}
void Refresh_BindComputeTextures(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_Texture **pTextures
Refresh_ComputeTextureBinding *pBindings
) {
NULL_RETURN(device);
device->BindComputeTextures(
device->driverData,
commandBuffer,
pTextures
pBindings
);
}
void Refresh_PushComputeShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
) {
NULL_RETURN(device);
device->PushComputeShaderUniforms(
device->driverData,
commandBuffer,
data,
dataLengthInBytes
);
}
void Refresh_DispatchCompute(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t groupCountX,
uint32_t groupCountY,
uint32_t groupCountZ
) {
NULL_RETURN(device);
device->DispatchCompute(
device->driverData,
commandBuffer,
groupCountX,
groupCountY,
groupCountZ
);
}
void Refresh_EndComputePass(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer
) {
NULL_RETURN(device);
device->EndComputePass(
device->driverData,
commandBuffer
);
}
/* TransferBuffer Set/Get */
void Refresh_SetTransferData(
Refresh_Device *device,
void* data,
Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams,
Refresh_TransferOptions transferOption
) {
NULL_RETURN(device);
device->SetTransferData(
device->driverData,
data,
transferBuffer,
copyParams,
transferOption
);
}
void Refresh_GetTransferData(
Refresh_Device *device,
Refresh_TransferBuffer *transferBuffer,
void* data,
Refresh_BufferCopy *copyParams
) {
NULL_RETURN(device);
device->GetTransferData(
device->driverData,
transferBuffer,
data,
copyParams
);
}
/* Copy Pass */
void Refresh_BeginCopyPass(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer
) {
NULL_RETURN(device);
device->BeginCopyPass(
device->driverData,
commandBuffer
);
}
void Refresh_UploadToTexture(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_TransferBuffer *transferBuffer,
Refresh_TextureRegion *textureRegion,
Refresh_BufferImageCopy *copyParams,
Refresh_WriteOptions writeOption
) {
NULL_RETURN(device);
device->UploadToTexture(
device->driverData,
commandBuffer,
transferBuffer,
textureRegion,
copyParams,
writeOption
);
}
void Refresh_UploadToBuffer(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_TransferBuffer *transferBuffer,
Refresh_GpuBuffer *gpuBuffer,
Refresh_BufferCopy *copyParams,
Refresh_WriteOptions writeOption
) {
NULL_RETURN(device);
device->UploadToBuffer(
device->driverData,
commandBuffer,
transferBuffer,
gpuBuffer,
copyParams,
writeOption
);
}
void Refresh_CopyTextureToTexture(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureRegion *source,
Refresh_TextureRegion *destination,
Refresh_WriteOptions writeOption
) {
NULL_RETURN(device);
device->CopyTextureToTexture(
device->driverData,
commandBuffer,
source,
destination,
writeOption
);
}
void Refresh_CopyBufferToBuffer(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *source,
Refresh_GpuBuffer *destination,
Refresh_BufferCopy *copyParams,
Refresh_WriteOptions writeOption
) {
NULL_RETURN(device);
device->CopyBufferToBuffer(
device->driverData,
commandBuffer,
source,
destination,
copyParams,
writeOption
);
}
void Refresh_GenerateMipmaps(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_Texture *texture
) {
NULL_RETURN(device);
device->GenerateMipmaps(
device->driverData,
commandBuffer,
texture
);
}
void Refresh_EndCopyPass(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer
) {
NULL_RETURN(device);
device->EndCopyPass(
device->driverData,
commandBuffer
);
}
/* Submission/Presentation */
uint8_t Refresh_ClaimWindow(
Refresh_Device *device,
void *windowHandle,
@ -840,6 +910,30 @@ void Refresh_UnclaimWindow(
);
}
void Refresh_SetSwapchainPresentMode(
Refresh_Device *device,
void *windowHandle,
Refresh_PresentMode presentMode
) {
NULL_RETURN(device);
device->SetSwapchainPresentMode(
device->driverData,
windowHandle,
presentMode
);
}
Refresh_TextureFormat Refresh_GetSwapchainFormat(
Refresh_Device *device,
void *windowHandle
) {
if (device == NULL) { return 0; }
return device->GetSwapchainFormat(
device->driverData,
windowHandle
);
}
Refresh_CommandBuffer* Refresh_AcquireCommandBuffer(
Refresh_Device *device
) {
@ -866,30 +960,6 @@ Refresh_Texture* Refresh_AcquireSwapchainTexture(
);
}
Refresh_TextureFormat Refresh_GetSwapchainFormat(
Refresh_Device *device,
void *windowHandle
) {
if (device == NULL) { return 0; }
return device->GetSwapchainFormat(
device->driverData,
windowHandle
);
}
void Refresh_SetSwapchainPresentMode(
Refresh_Device *device,
void *windowHandle,
Refresh_PresentMode presentMode
) {
NULL_RETURN(device);
device->SetSwapchainPresentMode(
device->driverData,
windowHandle,
presentMode
);
}
void Refresh_Submit(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer
@ -940,9 +1010,7 @@ int Refresh_QueryFence(
Refresh_Device *device,
Refresh_Fence *fence
) {
if (device == NULL) {
return 0;
}
if (device == NULL) { return 0; }
return device->QueryFence(
device->driverData,
@ -961,4 +1029,38 @@ void Refresh_ReleaseFence(
);
}
void Refresh_DownloadFromTexture(
Refresh_Device *device,
Refresh_TextureRegion *textureRegion,
Refresh_TransferBuffer *transferBuffer,
Refresh_BufferImageCopy *copyParams,
Refresh_TransferOptions transferOption
) {
NULL_RETURN(device);
device->DownloadFromTexture(
device->driverData,
textureRegion,
transferBuffer,
copyParams,
transferOption
);
}
void Refresh_DownloadFromBuffer(
Refresh_Device *device,
Refresh_GpuBuffer *gpuBuffer,
Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams,
Refresh_TransferOptions transferOption
) {
NULL_RETURN(device);
device->DownloadFromBuffer(
device->driverData,
gpuBuffer,
transferBuffer,
copyParams,
transferOption
);
}
/* vim: set noexpandtab shiftwidth=8 tabstop=8: */

View File

@ -48,6 +48,46 @@ void Refresh_LogError(const char *fmt, ...);
/* Internal Helper Utilities */
static inline int32_t Texture_GetBlockSize(
Refresh_TextureFormat format
) {
switch (format)
{
case REFRESH_TEXTUREFORMAT_BC1:
case REFRESH_TEXTUREFORMAT_BC2:
case REFRESH_TEXTUREFORMAT_BC3:
case REFRESH_TEXTUREFORMAT_BC7:
return 4;
case REFRESH_TEXTUREFORMAT_R8:
case REFRESH_TEXTUREFORMAT_R8_UINT:
case REFRESH_TEXTUREFORMAT_R5G6B5:
case REFRESH_TEXTUREFORMAT_B4G4R4A4:
case REFRESH_TEXTUREFORMAT_A1R5G5B5:
case REFRESH_TEXTUREFORMAT_R16_SFLOAT:
case REFRESH_TEXTUREFORMAT_R8G8_SNORM:
case REFRESH_TEXTUREFORMAT_R8G8_UINT:
case REFRESH_TEXTUREFORMAT_R16_UINT:
case REFRESH_TEXTUREFORMAT_R8G8B8A8:
case REFRESH_TEXTUREFORMAT_R32_SFLOAT:
case REFRESH_TEXTUREFORMAT_R16G16_SFLOAT:
case REFRESH_TEXTUREFORMAT_R8G8B8A8_SNORM:
case REFRESH_TEXTUREFORMAT_A2R10G10B10:
case REFRESH_TEXTUREFORMAT_R8G8B8A8_UINT:
case REFRESH_TEXTUREFORMAT_R16G16_UINT:
case REFRESH_TEXTUREFORMAT_R16G16B16A16_SFLOAT:
case REFRESH_TEXTUREFORMAT_R16G16B16A16:
case REFRESH_TEXTUREFORMAT_R32G32_SFLOAT:
case REFRESH_TEXTUREFORMAT_R16G16B16A16_UINT:
case REFRESH_TEXTUREFORMAT_R32G32B32A32_SFLOAT:
return 1;
default:
Refresh_LogError(
"Unrecognized TextureFormat!"
);
return 0;
}
}
static inline uint32_t Texture_GetFormatSize(
Refresh_TextureFormat format
) {
@ -87,7 +127,7 @@ static inline uint32_t Texture_GetFormatSize(
return 16;
default:
Refresh_LogError(
"Unrecognized SurfaceFormat!"
"Unrecognized TextureFormat!"
);
return 0;
}
@ -171,6 +211,22 @@ static inline int32_t BytesPerImage(
#define MAX_COLOR_TARGET_BINDINGS 4
#define MAX_PRESENT_COUNT 16
/* Internal Shader Module Create Info */
typedef enum Refresh_Driver_ShaderType
{
REFRESH_DRIVER_SHADERTYPE_VERTEX,
REFRESH_DRIVER_SHADERTYPE_FRAGMENT,
REFRESH_DRIVER_SHADERTYPE_COMPUTE
} Refresh_Driver_ShaderType;
typedef struct Refresh_Driver_ShaderModuleCreateInfo
{
size_t codeSize;
const uint32_t* byteCode;
Refresh_Driver_ShaderType type;
} Refresh_Driver_ShaderModuleCreateInfo;
/* Refresh_Device Definition */
typedef struct Refresh_Renderer Refresh_Renderer;
@ -181,58 +237,6 @@ struct Refresh_Device
void (*DestroyDevice)(Refresh_Device *device);
/* Drawing */
void (*DrawInstancedPrimitives)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
uint32_t baseVertex,
uint32_t startIndex,
uint32_t primitiveCount,
uint32_t instanceCount,
uint32_t vertexParamOffset,
uint32_t fragmentParamOffset
);
void (*DrawIndexedPrimitives)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
uint32_t baseVertex,
uint32_t startIndex,
uint32_t primitiveCount,
uint32_t vertexParamOffset,
uint32_t fragmentParamOffset
);
void (*DrawPrimitives)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
uint32_t vertexStart,
uint32_t primitiveCount,
uint32_t vertexParamOffset,
uint32_t fragmentParamOffset
);
void (*DrawPrimitivesIndirect)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_Buffer *buffer,
uint32_t offsetInBytes,
uint32_t drawCount,
uint32_t stride,
uint32_t vertexParamOffset,
uint32_t fragmentParamOffset
);
void (*DispatchCompute)(
Refresh_Renderer *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t groupCountX,
uint32_t groupCountY,
uint32_t groupCountZ,
uint32_t computeParamOffset
);
/* State Creation */
Refresh_ComputePipeline* (*CreateComputePipeline)(
@ -252,7 +256,7 @@ struct Refresh_Device
Refresh_ShaderModule* (*CreateShaderModule)(
Refresh_Renderer *driverData,
Refresh_ShaderModuleCreateInfo *shaderModuleCreateInfo
Refresh_Driver_ShaderModuleCreateInfo *shaderModuleCreateInfo
);
Refresh_Texture* (*CreateTexture)(
@ -260,107 +264,15 @@ struct Refresh_Device
Refresh_TextureCreateInfo *textureCreateInfo
);
Refresh_Buffer* (*CreateBuffer)(
Refresh_GpuBuffer* (*CreateGpuBuffer)(
Refresh_Renderer *driverData,
Refresh_BufferUsageFlags usageFlags,
uint32_t sizeInBytes
);
/* Setters */
void (*SetTextureData)(
Refresh_TransferBuffer* (*CreateTransferBuffer)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice,
void *data,
uint32_t dataLengthInBytes
);
void (*SetTextureDataYUV)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer* commandBuffer,
Refresh_Texture *y,
Refresh_Texture *u,
Refresh_Texture *v,
uint32_t yWidth,
uint32_t yHeight,
uint32_t uvWidth,
uint32_t uvHeight,
void *yDataPtr,
void *uDataPtr,
void *vDataPtr,
uint32_t yDataLength,
uint32_t uvDataLength,
uint32_t yStride,
uint32_t uvStride
);
void (*CopyTextureToTexture)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *sourceTextureSlice,
Refresh_TextureSlice *destinationTextureSlice,
Refresh_Filter filter
);
void (*CopyTextureToBuffer)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice,
Refresh_Buffer *buffer
);
void (*SetBufferData)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_Buffer *buffer,
uint32_t offsetInBytes,
void* data,
uint32_t dataLength
);
uint32_t (*PushVertexShaderUniforms)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
);
uint32_t (*PushFragmentShaderUniforms)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
);
uint32_t (*PushComputeShaderUniforms)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
);
void (*BindVertexSamplers)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_Texture **pTextures,
Refresh_Sampler **pSamplers
);
void (*BindFragmentSamplers)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_Texture **pTextures,
Refresh_Sampler **pSamplers
);
/* Getters */
void (*GetBufferData)(
Refresh_Renderer *driverData,
Refresh_Buffer *buffer,
void *data,
uint32_t dataLengthInBytes
uint32_t sizeInBytes
);
/* Disposal */
@ -375,9 +287,14 @@ struct Refresh_Device
Refresh_Sampler *sampler
);
void (*QueueDestroyBuffer)(
void (*QueueDestroyGpuBuffer)(
Refresh_Renderer *driverData,
Refresh_Buffer *buffer
Refresh_GpuBuffer *gpuBuffer
);
void (*QueueDestroyTransferBuffer)(
Refresh_Renderer *driverData,
Refresh_TransferBuffer *transferBuffer
);
void (*QueueDestroyShaderModule)(
@ -395,7 +312,7 @@ struct Refresh_Device
Refresh_GraphicsPipeline *graphicsPipeline
);
/* Graphics State */
/* Render Pass */
void (*BeginRenderPass)(
Refresh_Renderer *driverData,
@ -405,9 +322,10 @@ struct Refresh_Device
Refresh_DepthStencilAttachmentInfo *depthStencilAttachmentInfo
);
void (*EndRenderPass)(
void (*BindGraphicsPipeline)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer
Refresh_CommandBuffer *commandBuffer,
Refresh_GraphicsPipeline *graphicsPipeline
);
void (*SetViewport)(
@ -422,29 +340,92 @@ struct Refresh_Device
Refresh_Rect *scissor
);
void (*BindGraphicsPipeline)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_GraphicsPipeline *graphicsPipeline
);
void (*BindVertexBuffers)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
uint32_t firstBinding,
uint32_t bindingCount,
Refresh_Buffer **pBuffers,
uint64_t *pOffsets
Refresh_BufferBinding *pBindings
);
void (*BindIndexBuffer)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_Buffer *buffer,
uint64_t offset,
Refresh_BufferBinding *pBinding,
Refresh_IndexElementSize indexElementSize
);
void (*BindVertexSamplers)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSamplerBinding *pBindings
);
void (*BindFragmentSamplers)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSamplerBinding *pBindings
);
void (*PushVertexShaderUniforms)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
);
void (*PushFragmentShaderUniforms)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
);
void (*DrawInstancedPrimitives)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
uint32_t baseVertex,
uint32_t startIndex,
uint32_t primitiveCount,
uint32_t instanceCount
);
void (*DrawIndexedPrimitives)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
uint32_t baseVertex,
uint32_t startIndex,
uint32_t primitiveCount
);
void (*DrawPrimitives)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
uint32_t vertexStart,
uint32_t primitiveCount
);
void (*DrawPrimitivesIndirect)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *gpuBuffer,
uint32_t offsetInBytes,
uint32_t drawCount,
uint32_t stride
);
void (*EndRenderPass)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer
);
/* Compute Pass */
void (*BeginComputePass)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer
);
void (*BindComputePipeline)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
@ -454,15 +435,107 @@ struct Refresh_Device
void (*BindComputeBuffers)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_Buffer **pBuffers
Refresh_ComputeBufferBinding *pBindings
);
void (*BindComputeTextures)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_Texture **pTextures
Refresh_ComputeTextureBinding *pBindings
);
void (*PushComputeShaderUniforms)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t dataLengthInBytes
);
void (*DispatchCompute)(
Refresh_Renderer *device,
Refresh_CommandBuffer *commandBuffer,
uint32_t groupCountX,
uint32_t groupCountY,
uint32_t groupCountZ
);
void (*EndComputePass)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer
);
/* TransferBuffer Set/Get */
void (*SetTransferData)(
Refresh_Renderer *driverData,
void* data,
Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams,
Refresh_TransferOptions transferOption
);
void (*GetTransferData)(
Refresh_Renderer *driverData,
Refresh_TransferBuffer *transferBuffer,
void* data,
Refresh_BufferCopy *copyParams
);
/* Copy Pass */
void (*BeginCopyPass)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer
);
void (*UploadToTexture)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_TransferBuffer *transferBuffer,
Refresh_TextureRegion *textureSlice,
Refresh_BufferImageCopy *copyParams,
Refresh_WriteOptions writeOption
);
void (*UploadToBuffer)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_TransferBuffer *transferBuffer,
Refresh_GpuBuffer *gpuBuffer,
Refresh_BufferCopy *copyParams,
Refresh_WriteOptions writeOption
);
void (*CopyTextureToTexture)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureRegion *source,
Refresh_TextureRegion *destination,
Refresh_WriteOptions writeOption
);
void (*CopyBufferToBuffer)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *source,
Refresh_GpuBuffer *destination,
Refresh_BufferCopy *copyParams,
Refresh_WriteOptions writeOption
);
void (*GenerateMipmaps)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
Refresh_Texture *texture
);
void (*EndCopyPass)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer
);
/* Submission/Presentation */
uint8_t (*ClaimWindow)(
Refresh_Renderer *driverData,
void *windowHandle,
@ -474,6 +547,17 @@ struct Refresh_Device
void *windowHandle
);
void (*SetSwapchainPresentMode)(
Refresh_Renderer *driverData,
void *windowHandle,
Refresh_PresentMode presentMode
);
Refresh_TextureFormat (*GetSwapchainFormat)(
Refresh_Renderer *driverData,
void *windowHandle
);
Refresh_CommandBuffer* (*AcquireCommandBuffer)(
Refresh_Renderer *driverData
);
@ -486,17 +570,6 @@ struct Refresh_Device
uint32_t *pHeight
);
Refresh_TextureFormat (*GetSwapchainFormat)(
Refresh_Renderer *driverData,
void *windowHandle
);
void (*SetSwapchainPresentMode)(
Refresh_Renderer *driverData,
void *windowHandle,
Refresh_PresentMode presentMode
);
void (*Submit)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer
@ -528,6 +601,22 @@ struct Refresh_Device
Refresh_Fence *fence
);
void (*DownloadFromTexture)(
Refresh_Renderer *driverData,
Refresh_TextureRegion *textureSlice,
Refresh_TransferBuffer *transferBuffer,
Refresh_BufferImageCopy *copyParams,
Refresh_TransferOptions transferOption
);
void (*DownloadFromBuffer)(
Refresh_Renderer *driverData,
Refresh_GpuBuffer *gpuBuffer,
Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams,
Refresh_TransferOptions transferOption
);
/* Opaque pointer for the Driver */
Refresh_Renderer *driverData;
};
@ -536,50 +625,59 @@ struct Refresh_Device
result->func = name##_##func;
#define ASSIGN_DRIVER(name) \
ASSIGN_DRIVER_FUNC(DestroyDevice, name) \
ASSIGN_DRIVER_FUNC(DrawIndexedPrimitives, name) \
ASSIGN_DRIVER_FUNC(DrawInstancedPrimitives, name) \
ASSIGN_DRIVER_FUNC(DrawPrimitives, name) \
ASSIGN_DRIVER_FUNC(DrawPrimitivesIndirect, name) \
ASSIGN_DRIVER_FUNC(DispatchCompute, name) \
ASSIGN_DRIVER_FUNC(CreateComputePipeline, name) \
ASSIGN_DRIVER_FUNC(CreateGraphicsPipeline, name) \
ASSIGN_DRIVER_FUNC(CreateSampler, name) \
ASSIGN_DRIVER_FUNC(CreateShaderModule, name) \
ASSIGN_DRIVER_FUNC(CreateTexture, name) \
ASSIGN_DRIVER_FUNC(CreateBuffer, name) \
ASSIGN_DRIVER_FUNC(SetTextureData, name) \
ASSIGN_DRIVER_FUNC(SetTextureDataYUV, name) \
ASSIGN_DRIVER_FUNC(CopyTextureToTexture, name) \
ASSIGN_DRIVER_FUNC(CopyTextureToBuffer, name) \
ASSIGN_DRIVER_FUNC(SetBufferData, name) \
ASSIGN_DRIVER_FUNC(PushVertexShaderUniforms, name) \
ASSIGN_DRIVER_FUNC(PushFragmentShaderUniforms, name) \
ASSIGN_DRIVER_FUNC(PushComputeShaderUniforms, name) \
ASSIGN_DRIVER_FUNC(BindVertexSamplers, name) \
ASSIGN_DRIVER_FUNC(BindFragmentSamplers, name) \
ASSIGN_DRIVER_FUNC(GetBufferData, name) \
ASSIGN_DRIVER_FUNC(CreateGpuBuffer, name) \
ASSIGN_DRIVER_FUNC(CreateTransferBuffer, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyTexture, name) \
ASSIGN_DRIVER_FUNC(QueueDestroySampler, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyBuffer, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyGpuBuffer, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyTransferBuffer, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyShaderModule, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyComputePipeline, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyGraphicsPipeline, name) \
ASSIGN_DRIVER_FUNC(BeginRenderPass, name) \
ASSIGN_DRIVER_FUNC(EndRenderPass, name) \
ASSIGN_DRIVER_FUNC(BindGraphicsPipeline, name) \
ASSIGN_DRIVER_FUNC(SetViewport, name) \
ASSIGN_DRIVER_FUNC(SetScissor, name) \
ASSIGN_DRIVER_FUNC(BindGraphicsPipeline, name) \
ASSIGN_DRIVER_FUNC(BindVertexBuffers, name) \
ASSIGN_DRIVER_FUNC(BindIndexBuffer, name) \
ASSIGN_DRIVER_FUNC(BindVertexSamplers, name) \
ASSIGN_DRIVER_FUNC(BindFragmentSamplers, name) \
ASSIGN_DRIVER_FUNC(PushVertexShaderUniforms, name) \
ASSIGN_DRIVER_FUNC(PushFragmentShaderUniforms, name) \
ASSIGN_DRIVER_FUNC(DrawInstancedPrimitives, name) \
ASSIGN_DRIVER_FUNC(DrawIndexedPrimitives, name) \
ASSIGN_DRIVER_FUNC(DrawPrimitives, name) \
ASSIGN_DRIVER_FUNC(DrawPrimitivesIndirect, name) \
ASSIGN_DRIVER_FUNC(EndRenderPass, name) \
ASSIGN_DRIVER_FUNC(BeginComputePass, name) \
ASSIGN_DRIVER_FUNC(BindComputePipeline, name) \
ASSIGN_DRIVER_FUNC(BindComputeBuffers, name) \
ASSIGN_DRIVER_FUNC(BindComputeTextures, name) \
ASSIGN_DRIVER_FUNC(PushComputeShaderUniforms, name) \
ASSIGN_DRIVER_FUNC(DispatchCompute, name) \
ASSIGN_DRIVER_FUNC(EndComputePass, name) \
ASSIGN_DRIVER_FUNC(SetTransferData, name) \
ASSIGN_DRIVER_FUNC(GetTransferData, name) \
ASSIGN_DRIVER_FUNC(BeginCopyPass, name) \
ASSIGN_DRIVER_FUNC(UploadToTexture, name) \
ASSIGN_DRIVER_FUNC(UploadToBuffer, name) \
ASSIGN_DRIVER_FUNC(DownloadFromTexture, name) \
ASSIGN_DRIVER_FUNC(DownloadFromBuffer, name) \
ASSIGN_DRIVER_FUNC(CopyTextureToTexture, name) \
ASSIGN_DRIVER_FUNC(CopyBufferToBuffer, name) \
ASSIGN_DRIVER_FUNC(GenerateMipmaps, name) \
ASSIGN_DRIVER_FUNC(EndCopyPass, name) \
ASSIGN_DRIVER_FUNC(ClaimWindow, name) \
ASSIGN_DRIVER_FUNC(UnclaimWindow, name) \
ASSIGN_DRIVER_FUNC(SetSwapchainPresentMode, name) \
ASSIGN_DRIVER_FUNC(GetSwapchainFormat, name) \
ASSIGN_DRIVER_FUNC(AcquireCommandBuffer, name) \
ASSIGN_DRIVER_FUNC(AcquireSwapchainTexture, name) \
ASSIGN_DRIVER_FUNC(GetSwapchainFormat, name) \
ASSIGN_DRIVER_FUNC(SetSwapchainPresentMode, name) \
ASSIGN_DRIVER_FUNC(Submit, name) \
ASSIGN_DRIVER_FUNC(SubmitAndAcquireFence, name) \
ASSIGN_DRIVER_FUNC(Wait, name) \
@ -597,6 +695,7 @@ typedef struct Refresh_Driver
} Refresh_Driver;
extern Refresh_Driver VulkanDriver;
extern Refresh_Driver D3D11Driver;
extern Refresh_Driver PS5Driver;
#endif /* REFRESH_DRIVER_H */

4678
src/Refresh_Driver_D3D11.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
/* Refresh - XNA-inspired 3D Graphics Library with modern capabilities
*
* Copyright (c) 2020 Evan Hemsley
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from
* the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software in a
* product, an acknowledgment in the product documentation would be
* appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*
* Evan "cosmonaut" Hemsley <evan@moonside.games>
*
*/
/* Function Pointer Signatures */
typedef HRESULT(WINAPI* PFN_CREATE_DXGI_FACTORY1)(const GUID* riid, void** ppFactory);
typedef HRESULT(WINAPI* PFN_DXGI_GET_DEBUG_INTERFACE)(const GUID* riid, void** ppDebug);
/* IIDs (from https://magnumdb.com) */
static const IID D3D_IID_IDXGIFactory1 = { 0x770aae78,0xf26f,0x4dba,{0xa8,0x29,0x25,0x3c,0x83,0xd1,0xb3,0x87} };
static const IID D3D_IID_IDXGIFactory4 = { 0x1bc6ea02,0xef36,0x464f,{0xbf,0x0c,0x21,0xca,0x39,0xe5,0x16,0x8a} };
static const IID D3D_IID_IDXGIFactory5 = { 0x7632e1f5,0xee65,0x4dca,{0x87,0xfd,0x84,0xcd,0x75,0xf8,0x83,0x8d} };
static const IID D3D_IID_IDXGIFactory6 = { 0xc1b6694f,0xff09,0x44a9,{0xb0,0x3c,0x77,0x90,0x0a,0x0a,0x1d,0x17} };
static const IID D3D_IID_IDXGIAdapter1 = { 0x29038f61,0x3839,0x4626,{0x91,0xfd,0x08,0x68,0x79,0x01,0x1a,0x05} };
static const IID D3D_IID_ID3D11Texture2D = { 0x6f15aaf2,0xd208,0x4e89,{0x9a,0xb4,0x48,0x95,0x35,0xd3,0x4f,0x9c} };
static const IID D3D_IID_ID3D11Device1 = { 0xa04bfb29,0x08ef,0x43d6,{0xa4,0x9c,0xa9,0xbd,0xbd,0xcb,0xe6,0x86} };
static const IID D3D_IID_IDXGIDebug = { 0x119e7452,0xde9e,0x40fe,{0x88,0x06,0x88,0xf9,0x0c,0x12,0xb4,0x41} };
static const IID D3D_IID_IDXGIInfoQueue = { 0xd67441c7,0x672a,0x476f,{0x9e,0x82,0xcd,0x55,0xb4,0x49,0x49,0xce} };
static const GUID D3D_IID_DXGI_DEBUG_ALL = { 0xe48ae283,0xda80,0x490b,{0x87,0xe6,0x43,0xe9,0xa9,0xcf,0xda,0x08} };

View File

@ -318,7 +318,7 @@ static Refresh_Sampler* TEMPLATE_CreateSampler(
static Refresh_ShaderModule* TEMPLATE_CreateShaderModule(
Refresh_Renderer *driverData,
Refresh_ShaderModuleCreateInfo *shaderModuleCreateInfo
Refresh_Driver_ShaderModuleCreateInfo *shaderModuleCreateInfo
) {
NOT_IMPLEMENTED
}

File diff suppressed because it is too large Load Diff

View File

@ -218,7 +218,7 @@ uint8_t* Refresh_Image_Load(
* -flibit
*/
pixels = result;
*len = (*w) * (*h) *4;
*len = (*w) * (*h) * 4;
for (i = 0; i < *len; i += 4, pixels += 4)
{
if (pixels[3] == 0)
@ -232,6 +232,34 @@ uint8_t* Refresh_Image_Load(
return result;
}
uint8_t Refresh_Image_Info(
uint8_t *bufferPtr,
int32_t bufferLength,
int32_t *w,
int32_t *h,
int32_t *len
) {
int32_t format;
int32_t result;
result = stbi_info_from_memory(
bufferPtr,
bufferLength,
w,
h,
&format
);
if (result == 0)
{
SDL_LogWarn(SDL_LOG_CATEGORY_ERROR, "Image info failed: %s", stbi_failure_reason());
}
*len = (*w) * (*h) * 4;
return (uint8_t) result;
}
void Refresh_Image_Free(uint8_t *mem)
{
SDL_SIMDFree(mem);

View File

@ -61,7 +61,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>REFRESH_DRIVER_VULKAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>REFRESH_DRIVER_VULKAN;REFRESH_DRIVER_D3D11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
@ -72,7 +72,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>REFRESH_DRIVER_VULKAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>REFRESH_DRIVER_VULKAN;REFRESH_DRIVER_D3D11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
@ -84,6 +84,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\Refresh.c" />
<ClCompile Include="..\src\Refresh_Driver_D3D11.c" />
<ClCompile Include="..\src\Refresh_Driver_Vulkan.c" />
<ClCompile Include="..\src\Refresh_Image.c" />
</ItemGroup>
@ -91,6 +92,7 @@
<ClInclude Include="..\include\Refresh.h" />
<ClInclude Include="..\include\Refresh_Image.h" />
<ClInclude Include="..\src\Refresh_Driver.h" />
<ClInclude Include="..\src\Refresh_Driver_D3D11_cdefines.h" />
<ClInclude Include="..\src\Refresh_Driver_Vulkan_vkfuncs.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -10,6 +10,9 @@
<ClCompile Include="..\src\Refresh_Image.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Refresh_Driver_D3D11.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\Refresh.h">
@ -24,6 +27,9 @@
<ClInclude Include="..\include\Refresh_Image.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\Refresh_Driver_D3D11_cdefines.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Header Files">