some fixes

This commit is contained in:
Asuka 2022-06-30 21:54:18 +08:00
parent e168de68b0
commit c515291943
6 changed files with 24 additions and 24 deletions

View file

@ -48,17 +48,22 @@ namespace sce::Gnm
void GnmCommandBuffer::writeDataInline(void* dstGpuAddr, const void* data, uint32_t sizeInDwords, WriteDataConfirmMode writeConfirm)
{
auto label = m_labelManager->getLabel(dstGpuAddr);
auto label = m_labelManager->getLabel(dstGpuAddr);
uint64_t value = 0;
EventWriteSource selector = kEventWriteSource32BitsImmediate;
if (sizeInDwords == 1)
{
label->set(*reinterpret_cast<const uint32_t*>(data));
selector = kEventWriteSource32BitsImmediate;
value = *reinterpret_cast<const uint32_t*>(data);
}
else if (sizeInDwords == 2)
{
label->set(*reinterpret_cast<const uint64_t*>(data));
selector = kEventWriteSource64BitsImmediate;
value = *reinterpret_cast<const uint64_t*>(data);
}
std::memcpy(dstGpuAddr, data, sizeInDwords * sizeof(uint32_t));
//std::memcpy(dstGpuAddr, data, sizeInDwords * sizeof(uint32_t));
label->write(m_context.ptr(), VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, selector, value);
}
const uint32_t* GnmCommandBuffer::findUserData(

View file

@ -359,7 +359,7 @@ namespace sce::Gnm
void* GnmCommandBufferDispatch::allocateFromCommandBuffer(uint32_t sizeInBytes, EmbeddedDataAlignment alignment)
{
throw std::logic_error("The method or operation is not implemented.");
return nullptr;
}
void GnmCommandBufferDispatch::setStencilSeparate(StencilControl front, StencilControl back)

View file

@ -291,7 +291,6 @@ namespace sce::Gnm
void GnmCommandBufferDraw::setRenderTarget(uint32_t rtSlot, RenderTarget const* target)
{
return;
auto resource = m_tracker->find(target->getBaseAddress());
do
{
@ -553,7 +552,7 @@ namespace sce::Gnm
{
// If the index size is currently 32 bits, this command will partially set it to 16 bits
m_state.ia.indexType = VK_INDEX_TYPE_UINT16;
// m_state.ia.indexBuffer = generateIndexBufferAuto(indexCount);
m_state.ia.indexBuffer = generateIndexBufferAuto(indexCount);
commitGraphicsState();

View file

@ -720,7 +720,7 @@ namespace sce::Gnm
case OP_HINT_SET_CLIP_CONTROL:
{
ClipControl clipControl;
clipControl.m_reg = static_cast<uint8_t>(itBody[1]);
clipControl.m_reg = itBody[1];
LOG_SCE_GRAPHIC("Gnm: setClipControl");
m_cb->setClipControl(clipControl);
}

View file

@ -15,6 +15,7 @@ namespace sce::Gnm
m_device(device),
m_label(label)
{
createSemaphore();
}
GnmGpuLabel::~GnmGpuLabel()
@ -32,14 +33,6 @@ namespace sce::Gnm
EventWriteSource srcSelector,
uint64_t immValue)
{
if (m_semaphore == nullptr)
{
VltSemaphoreCreateInfo info;
info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE;
info.initialValue = 0;
m_semaphore = m_device->createSemaphore(info);
}
m_value = immValue == 0 ? 1 : immValue;
VltSemaphoreSubmission submission;
@ -91,14 +84,6 @@ namespace sce::Gnm
// Only support equal compare now.
LOG_ASSERT(compareFunc == kWaitCompareFuncEqual, "Only equal compareFunc is supported yet.");
if (m_semaphore == nullptr)
{
VltSemaphoreCreateInfo info;
info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE;
info.initialValue = 0;
m_semaphore = m_device->createSemaphore(info);
}
m_value = refValue == 0 ? 1 : refValue;
VltSemaphoreSubmission submission;
@ -108,4 +93,12 @@ namespace sce::Gnm
context->waitSemaphore(submission);
}
void GnmGpuLabel::createSemaphore()
{
VltSemaphoreCreateInfo info;
info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE;
info.initialValue = 0;
m_semaphore = m_device->createSemaphore(info);
}
} // namespace sce::Gnm

View file

@ -43,6 +43,9 @@ namespace sce::Gnm
uint32_t mask,
WaitCompareFunc compareFunc,
uint32_t refValue);
private:
void createSemaphore();
private:
vlt::VltDevice* m_device;