Sync editor rendering and UI workspace updates
This commit is contained in:
@@ -79,6 +79,7 @@ bool CompileD3D12Shader(const ShaderCompileDesc& desc, D3D12Shader& shader) {
|
||||
return shader.Compile(
|
||||
desc.source.data(),
|
||||
desc.source.size(),
|
||||
desc.fileName.empty() ? nullptr : desc.fileName.c_str(),
|
||||
macroPtr,
|
||||
entryPointPtr,
|
||||
profilePtr);
|
||||
@@ -771,6 +772,7 @@ const RHIDeviceInfo& D3D12Device::GetDeviceInfo() const {
|
||||
RHIBuffer* D3D12Device::CreateBuffer(const BufferDesc& desc) {
|
||||
auto* buffer = new D3D12Buffer();
|
||||
const BufferType bufferType = static_cast<BufferType>(desc.bufferType);
|
||||
const BufferFlags bufferFlags = static_cast<BufferFlags>(desc.flags);
|
||||
D3D12_HEAP_TYPE heapType = D3D12_HEAP_TYPE_DEFAULT;
|
||||
D3D12_RESOURCE_STATES initialState = D3D12_RESOURCE_STATE_COMMON;
|
||||
D3D12_RESOURCE_FLAGS resourceFlags = D3D12_RESOURCE_FLAG_NONE;
|
||||
@@ -784,7 +786,14 @@ RHIBuffer* D3D12Device::CreateBuffer(const BufferDesc& desc) {
|
||||
heapType = D3D12_HEAP_TYPE_UPLOAD;
|
||||
initialState = D3D12_RESOURCE_STATE_GENERIC_READ;
|
||||
} else if (bufferType == BufferType::Storage) {
|
||||
resourceFlags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
|
||||
const bool allowUnorderedAccess =
|
||||
(bufferFlags & BufferFlags::AllowUnorderedAccess) == BufferFlags::AllowUnorderedAccess;
|
||||
if (allowUnorderedAccess) {
|
||||
resourceFlags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
|
||||
} else {
|
||||
heapType = D3D12_HEAP_TYPE_UPLOAD;
|
||||
initialState = D3D12_RESOURCE_STATE_GENERIC_READ;
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer->Initialize(m_device.Get(), desc.size, initialState, heapType, resourceFlags)) {
|
||||
@@ -930,7 +939,13 @@ RHIShader* D3D12Device::CreateShader(const ShaderCompileDesc& desc) {
|
||||
|
||||
bool success = false;
|
||||
if (!desc.source.empty()) {
|
||||
success = shader->Compile(desc.source.data(), desc.source.size(), entryPointPtr, profilePtr);
|
||||
success = shader->Compile(
|
||||
desc.source.data(),
|
||||
desc.source.size(),
|
||||
desc.fileName.empty() ? nullptr : desc.fileName.c_str(),
|
||||
nullptr,
|
||||
entryPointPtr,
|
||||
profilePtr);
|
||||
} else if (!desc.fileName.empty()) {
|
||||
success = shader->CompileFromFile(desc.fileName.c_str(), entryPointPtr, profilePtr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user