Add sampler support and refactor resource handling

Enhanced shader and resource systems with `Sampler` support, including updates to `ShaderPropertyType`, HLSL code, and resource management. Refactored `Result` structs for better type safety and added new enums for texture and comparison settings. Improved `MeshRenderPass` to dynamically load textures and samplers. Updated SDL compiler and token lexicon for `Sampler` handling. Embedded debug info in project files and streamlined resource state tracking.
This commit is contained in:
2025-11-29 18:27:47 +09:00
parent bd97d233cb
commit 0ec318a9ab
30 changed files with 463 additions and 166 deletions

View File

@@ -234,6 +234,12 @@ internal unsafe class D3D12CommandBuffer : ICommandBuffer
resourceRecord.state = stateAfter;
}
public void ResourceBarrier(Handle<GPUResource> resource, ResourceState stateAfter)
{
var stateBefore = _resourceDatabase.GetResourceState(resource);
ResourceBarrier(resource, stateBefore, stateAfter);
}
public void SetRenderTargets(ReadOnlySpan<Handle<Texture>> renderTargets, Handle<Texture> depthTarget)
{
ThrowIfDisposed();
@@ -511,6 +517,8 @@ internal unsafe class D3D12CommandBuffer : ICommandBuffer
var pResource = _resourceDatabase.GetResource(buffer.AsResource());
_commandList.Get()->CopyBufferRegion(pResource, 0, uploadResource, 0, sizeInBytes);
// D3D12 transition resource to COPY_DEST when copying
_resourceDatabase.SetResourceState(buffer.AsResource(), ResourceState.CopyDest);
}
public void UploadTexture(Handle<Texture> texture, ReadOnlySpan<SubResourceData> subresources)