-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Expose GPU device name and driver version #12579
Closed
MrOnlineCoder
wants to merge
6
commits into
libsdl-org:main
from
MrOnlineCoder:feature/gpu-driver-name-details
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6c2cad9
Expose GPU driver and device name
MrOnlineCoder 74e476e
Fix D3D12 device name fetching
MrOnlineCoder 6ee7766
Rename property name
MrOnlineCoder 96bb43e
Fix prop value naming
MrOnlineCoder 3dd0c76
Move properties declaration
MrOnlineCoder 10c2d4d
Address some fixes from PR
MrOnlineCoder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -888,92 +888,95 @@ struct SDL_GPUDevice | |
|
||
// Store this for SDL_gpu.c's debug layer | ||
bool debug_mode; | ||
|
||
// Various readonly properties for the device | ||
SDL_PropertiesID props; | ||
}; | ||
|
||
#define ASSIGN_DRIVER_FUNC(func, name) \ | ||
result->func = name##_##func; | ||
#define ASSIGN_DRIVER(name) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These whitespace changes here serve no purpose and make the diff less readable |
||
ASSIGN_DRIVER_FUNC(DestroyDevice, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateComputePipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateGraphicsPipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateSampler, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateShader, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateTexture, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateTransferBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(SetBufferName, name) \ | ||
ASSIGN_DRIVER_FUNC(SetTextureName, name) \ | ||
ASSIGN_DRIVER_FUNC(InsertDebugLabel, name) \ | ||
ASSIGN_DRIVER_FUNC(PushDebugGroup, name) \ | ||
ASSIGN_DRIVER_FUNC(PopDebugGroup, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseTexture, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseSampler, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseTransferBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseShader, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseComputePipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseGraphicsPipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(BeginRenderPass, name) \ | ||
ASSIGN_DRIVER_FUNC(BindGraphicsPipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(SetViewport, name) \ | ||
ASSIGN_DRIVER_FUNC(SetScissor, name) \ | ||
ASSIGN_DRIVER_FUNC(SetBlendConstants, name) \ | ||
ASSIGN_DRIVER_FUNC(SetStencilReference, name) \ | ||
ASSIGN_DRIVER_FUNC(BindVertexBuffers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindIndexBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(BindVertexSamplers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindVertexStorageTextures, name) \ | ||
ASSIGN_DRIVER_FUNC(BindVertexStorageBuffers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindFragmentSamplers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindFragmentStorageTextures, name) \ | ||
ASSIGN_DRIVER_FUNC(BindFragmentStorageBuffers, name) \ | ||
ASSIGN_DRIVER_FUNC(PushVertexUniformData, name) \ | ||
ASSIGN_DRIVER_FUNC(PushFragmentUniformData, name) \ | ||
ASSIGN_DRIVER_FUNC(DrawIndexedPrimitives, name) \ | ||
ASSIGN_DRIVER_FUNC(DrawPrimitives, name) \ | ||
ASSIGN_DRIVER_FUNC(DrawPrimitivesIndirect, name) \ | ||
ASSIGN_DRIVER_FUNC(DrawIndexedPrimitivesIndirect, name) \ | ||
ASSIGN_DRIVER_FUNC(EndRenderPass, name) \ | ||
ASSIGN_DRIVER_FUNC(BeginComputePass, name) \ | ||
ASSIGN_DRIVER_FUNC(BindComputePipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(BindComputeSamplers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindComputeStorageTextures, name) \ | ||
ASSIGN_DRIVER_FUNC(BindComputeStorageBuffers, name) \ | ||
ASSIGN_DRIVER_FUNC(PushComputeUniformData, name) \ | ||
ASSIGN_DRIVER_FUNC(DispatchCompute, name) \ | ||
ASSIGN_DRIVER_FUNC(DispatchComputeIndirect, name) \ | ||
ASSIGN_DRIVER_FUNC(EndComputePass, name) \ | ||
ASSIGN_DRIVER_FUNC(MapTransferBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(UnmapTransferBuffer, 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(Blit, name) \ | ||
ASSIGN_DRIVER_FUNC(SupportsSwapchainComposition, name) \ | ||
ASSIGN_DRIVER_FUNC(SupportsPresentMode, name) \ | ||
ASSIGN_DRIVER_FUNC(ClaimWindow, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseWindow, name) \ | ||
ASSIGN_DRIVER_FUNC(SetSwapchainParameters, name) \ | ||
ASSIGN_DRIVER_FUNC(SetAllowedFramesInFlight, name) \ | ||
ASSIGN_DRIVER_FUNC(GetSwapchainTextureFormat, name) \ | ||
ASSIGN_DRIVER_FUNC(AcquireCommandBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(AcquireSwapchainTexture, name) \ | ||
ASSIGN_DRIVER_FUNC(WaitForSwapchain, name) \ | ||
ASSIGN_DRIVER_FUNC(WaitAndAcquireSwapchainTexture, name)\ | ||
ASSIGN_DRIVER_FUNC(Submit, name) \ | ||
ASSIGN_DRIVER_FUNC(SubmitAndAcquireFence, name) \ | ||
ASSIGN_DRIVER_FUNC(Cancel, name) \ | ||
ASSIGN_DRIVER_FUNC(Wait, name) \ | ||
ASSIGN_DRIVER_FUNC(WaitForFences, name) \ | ||
ASSIGN_DRIVER_FUNC(QueryFence, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseFence, name) \ | ||
ASSIGN_DRIVER_FUNC(SupportsTextureFormat, name) \ | ||
#define ASSIGN_DRIVER(name) \ | ||
ASSIGN_DRIVER_FUNC(DestroyDevice, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateComputePipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateGraphicsPipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateSampler, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateShader, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateTexture, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(CreateTransferBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(SetBufferName, name) \ | ||
ASSIGN_DRIVER_FUNC(SetTextureName, name) \ | ||
ASSIGN_DRIVER_FUNC(InsertDebugLabel, name) \ | ||
ASSIGN_DRIVER_FUNC(PushDebugGroup, name) \ | ||
ASSIGN_DRIVER_FUNC(PopDebugGroup, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseTexture, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseSampler, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseTransferBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseShader, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseComputePipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseGraphicsPipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(BeginRenderPass, name) \ | ||
ASSIGN_DRIVER_FUNC(BindGraphicsPipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(SetViewport, name) \ | ||
ASSIGN_DRIVER_FUNC(SetScissor, name) \ | ||
ASSIGN_DRIVER_FUNC(SetBlendConstants, name) \ | ||
ASSIGN_DRIVER_FUNC(SetStencilReference, name) \ | ||
ASSIGN_DRIVER_FUNC(BindVertexBuffers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindIndexBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(BindVertexSamplers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindVertexStorageTextures, name) \ | ||
ASSIGN_DRIVER_FUNC(BindVertexStorageBuffers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindFragmentSamplers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindFragmentStorageTextures, name) \ | ||
ASSIGN_DRIVER_FUNC(BindFragmentStorageBuffers, name) \ | ||
ASSIGN_DRIVER_FUNC(PushVertexUniformData, name) \ | ||
ASSIGN_DRIVER_FUNC(PushFragmentUniformData, name) \ | ||
ASSIGN_DRIVER_FUNC(DrawIndexedPrimitives, name) \ | ||
ASSIGN_DRIVER_FUNC(DrawPrimitives, name) \ | ||
ASSIGN_DRIVER_FUNC(DrawPrimitivesIndirect, name) \ | ||
ASSIGN_DRIVER_FUNC(DrawIndexedPrimitivesIndirect, name) \ | ||
ASSIGN_DRIVER_FUNC(EndRenderPass, name) \ | ||
ASSIGN_DRIVER_FUNC(BeginComputePass, name) \ | ||
ASSIGN_DRIVER_FUNC(BindComputePipeline, name) \ | ||
ASSIGN_DRIVER_FUNC(BindComputeSamplers, name) \ | ||
ASSIGN_DRIVER_FUNC(BindComputeStorageTextures, name) \ | ||
ASSIGN_DRIVER_FUNC(BindComputeStorageBuffers, name) \ | ||
ASSIGN_DRIVER_FUNC(PushComputeUniformData, name) \ | ||
ASSIGN_DRIVER_FUNC(DispatchCompute, name) \ | ||
ASSIGN_DRIVER_FUNC(DispatchComputeIndirect, name) \ | ||
ASSIGN_DRIVER_FUNC(EndComputePass, name) \ | ||
ASSIGN_DRIVER_FUNC(MapTransferBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(UnmapTransferBuffer, 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(Blit, name) \ | ||
ASSIGN_DRIVER_FUNC(SupportsSwapchainComposition, name) \ | ||
ASSIGN_DRIVER_FUNC(SupportsPresentMode, name) \ | ||
ASSIGN_DRIVER_FUNC(ClaimWindow, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseWindow, name) \ | ||
ASSIGN_DRIVER_FUNC(SetSwapchainParameters, name) \ | ||
ASSIGN_DRIVER_FUNC(SetAllowedFramesInFlight, name) \ | ||
ASSIGN_DRIVER_FUNC(GetSwapchainTextureFormat, name) \ | ||
ASSIGN_DRIVER_FUNC(AcquireCommandBuffer, name) \ | ||
ASSIGN_DRIVER_FUNC(AcquireSwapchainTexture, name) \ | ||
ASSIGN_DRIVER_FUNC(WaitForSwapchain, name) \ | ||
ASSIGN_DRIVER_FUNC(WaitAndAcquireSwapchainTexture, name) \ | ||
ASSIGN_DRIVER_FUNC(Submit, name) \ | ||
ASSIGN_DRIVER_FUNC(SubmitAndAcquireFence, name) \ | ||
ASSIGN_DRIVER_FUNC(Cancel, name) \ | ||
ASSIGN_DRIVER_FUNC(Wait, name) \ | ||
ASSIGN_DRIVER_FUNC(WaitForFences, name) \ | ||
ASSIGN_DRIVER_FUNC(QueryFence, name) \ | ||
ASSIGN_DRIVER_FUNC(ReleaseFence, name) \ | ||
ASSIGN_DRIVER_FUNC(SupportsTextureFormat, name) \ | ||
ASSIGN_DRIVER_FUNC(SupportsSampleCount, name) | ||
|
||
typedef struct SDL_GPUBootstrap | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the
PHYSICAL
part redundant? What other device name could it be referring to? MaybeADAPTER
instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I borrowed it from Vulkan properties name:
physicalDeviceProperties.properties.deviceName
.I am just afraid to make it very general as
SDL_PROP_GPU_DEVICE_NAME_STRING
, but if you are fine - I can change that.Adapter seems to me to be mostly D3D-specific thing, but maybe I am mistaken.