DX11 removal, Surfel GI
version 0.57.0: - DX11 removed, DX12 is default now on Windows - graphics interfaces improved: - Bindless descriptor support is now assumed - GPU Buffers with USAGE_UPLOAD and USAGE_READBACK will be persistently mapped after creation - Removed Map/Unmap - added BindDynamicConstantBuffer helper function - improved AllocateGPU helper function - GPU Queries resolving can be done directly into GPUBuffer - UpdateBuffer now doesn't synchronize internally, this allows batching updates - removed support for bindless constant buffers (uniform buffers) - BindConstantBuffer will accept offset - RESOURCE_STATES refactor, they can be combined now in the barriers - many other refactors - gbuffer normals removed, implemented visibility buffer - bindless decals, bindless lightmaps, bindless hair particles, bindless software path tracing - hair particles path tracing support - path tracing eye adaption supported - Surfel GI (experimental)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Editor.h"
|
||||
#include "PaintToolWindow.h"
|
||||
#include "shaders/ShaderInterop_Paint.h"
|
||||
#include "shaders/ShaderInterop_Renderer.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <cmath>
|
||||
@@ -305,22 +305,11 @@ void PaintToolWindow::Update(float dt)
|
||||
// Need to requery this because RecordHistory might swap textures on material:
|
||||
editTexture = GetEditTextureSlot(*material, &uvset);
|
||||
|
||||
static GPUBuffer cbuf;
|
||||
if (!cbuf.IsValid())
|
||||
{
|
||||
GPUBufferDesc desc;
|
||||
desc.BindFlags = BIND_CONSTANT_BUFFER;
|
||||
desc.Usage = USAGE_DYNAMIC;
|
||||
desc.CPUAccessFlags = CPU_ACCESS_WRITE;
|
||||
desc.ByteWidth = sizeof(PaintTextureCB);
|
||||
device->CreateBuffer(&desc, nullptr, &cbuf);
|
||||
}
|
||||
|
||||
device->BindComputeShader(wiRenderer::GetShader(CSTYPE_PAINT_TEXTURE), cmd);
|
||||
|
||||
wiRenderer::BindCommonResources(cmd);
|
||||
device->BindResource(CS, wiTextureHelper::getWhite(), TEXSLOT_ONDEMAND0, cmd);
|
||||
device->BindUAV(CS, &editTexture, 0, cmd);
|
||||
device->BindResource(wiTextureHelper::getWhite(), TEXSLOT_ONDEMAND0, cmd);
|
||||
device->BindUAV(&editTexture, 0, cmd);
|
||||
|
||||
PaintTextureCB cb;
|
||||
cb.xPaintBrushCenter = center;
|
||||
@@ -328,8 +317,7 @@ void PaintToolWindow::Update(float dt)
|
||||
cb.xPaintBrushAmount = amount;
|
||||
cb.xPaintBrushFalloff = falloff;
|
||||
cb.xPaintBrushColor = color.rgba;
|
||||
device->UpdateBuffer(&cbuf, &cb, cmd);
|
||||
device->BindConstantBuffer(CS, &cbuf, CB_GETBINDSLOT(PaintTextureCB), cmd);
|
||||
device->PushConstants(&cb, sizeof(cb), cmd);
|
||||
|
||||
const uint diameter = cb.xPaintBrushRadius * 2;
|
||||
const uint dispatch_dim = (diameter + PAINT_TEXTURE_BLOCKSIZE - 1) / PAINT_TEXTURE_BLOCKSIZE;
|
||||
@@ -340,7 +328,6 @@ void PaintToolWindow::Update(float dt)
|
||||
};
|
||||
device->Barrier(barriers, arraysize(barriers), cmd);
|
||||
|
||||
device->UnbindUAVs(0, 1, cmd);
|
||||
|
||||
wiRenderer::GenerateMipChain(editTexture, wiRenderer::MIPGENFILTER::MIPGENFILTER_LINEAR, cmd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user