Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/LOSTexture.cpp
Show First 20 Lines • Show All 275 Lines • ▼ Show 20 Lines | const uint32_t usage = | ||||
Renderer::Backend::ITexture::Usage::TRANSFER_DST | | Renderer::Backend::ITexture::Usage::TRANSFER_DST | | ||||
Renderer::Backend::ITexture::Usage::SAMPLED | | Renderer::Backend::ITexture::Usage::SAMPLED | | ||||
Renderer::Backend::ITexture::Usage::COLOR_ATTACHMENT; | Renderer::Backend::ITexture::Usage::COLOR_ATTACHMENT; | ||||
m_SmoothTextures[0] = backendDevice->CreateTexture2D("LOSSmoothTexture0", | m_SmoothTextures[0] = backendDevice->CreateTexture2D("LOSSmoothTexture0", | ||||
usage, m_TextureFormat, textureSize, textureSize, defaultSamplerDesc); | usage, m_TextureFormat, textureSize, textureSize, defaultSamplerDesc); | ||||
m_SmoothTextures[1] = backendDevice->CreateTexture2D("LOSSmoothTexture1", | m_SmoothTextures[1] = backendDevice->CreateTexture2D("LOSSmoothTexture1", | ||||
usage, m_TextureFormat, textureSize, textureSize, defaultSamplerDesc); | usage, m_TextureFormat, textureSize, textureSize, defaultSamplerDesc); | ||||
Renderer::Backend::SColorAttachment colorAttachment{}; | |||||
colorAttachment.texture = m_SmoothTextures[0].get(); | |||||
colorAttachment.loadOp = Renderer::Backend::AttachmentLoadOp::DONT_CARE; | |||||
colorAttachment.storeOp = Renderer::Backend::AttachmentStoreOp::STORE; | |||||
colorAttachment.clearColor = CColor{0.0f, 0.0f, 0.0f, 0.0f}; | |||||
m_SmoothFramebuffers[0] = backendDevice->CreateFramebuffer( | m_SmoothFramebuffers[0] = backendDevice->CreateFramebuffer( | ||||
"LOSSmoothFramebuffer0", m_SmoothTextures[0].get(), nullptr); | "LOSSmoothFramebuffer0", &colorAttachment, nullptr); | ||||
colorAttachment.texture = m_SmoothTextures[1].get(); | |||||
m_SmoothFramebuffers[1] = backendDevice->CreateFramebuffer( | m_SmoothFramebuffers[1] = backendDevice->CreateFramebuffer( | ||||
"LOSSmoothFramebuffer1", m_SmoothTextures[1].get(), nullptr); | "LOSSmoothFramebuffer1", &colorAttachment, nullptr); | ||||
if (!m_SmoothFramebuffers[0] || !m_SmoothFramebuffers[1]) | if (!m_SmoothFramebuffers[0] || !m_SmoothFramebuffers[1]) | ||||
{ | { | ||||
LOGERROR("Failed to create LOS framebuffers"); | LOGERROR("Failed to create LOS framebuffers"); | ||||
g_RenderingOptions.SetSmoothLOS(false); | g_RenderingOptions.SetSmoothLOS(false); | ||||
} | } | ||||
deviceCommandContext->UploadTexture( | deviceCommandContext->UploadTexture( | ||||
m_SmoothTextures[0].get(), m_TextureFormat, texData.get(), textureDataSize); | m_SmoothTextures[0].get(), m_TextureFormat, texData.get(), textureDataSize); | ||||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator