mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
bridge: fix more possible command skips
gpu: show window after os launch
This commit is contained in:
parent
d3b9ff4292
commit
5830d66c4b
4 changed files with 20 additions and 17 deletions
|
|
@ -243,7 +243,7 @@ private:
|
||||||
|
|
||||||
void sendCommand(CommandId id, std::initializer_list<std::uint64_t> args) {
|
void sendCommand(CommandId id, std::initializer_list<std::uint64_t> args) {
|
||||||
std::uint64_t exp = 0;
|
std::uint64_t exp = 0;
|
||||||
while (!header->lock.compare_exchange_weak(
|
while (!header->lock.compare_exchange_strong(
|
||||||
exp, 1, std::memory_order::acquire, std::memory_order::relaxed)) {
|
exp, 1, std::memory_order::acquire, std::memory_order::relaxed)) {
|
||||||
exp = 0;
|
exp = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -263,6 +263,8 @@ private:
|
||||||
std::uint64_t position = header->push;
|
std::uint64_t position = header->push;
|
||||||
|
|
||||||
if (position + cmdSize > header->size) {
|
if (position + cmdSize > header->size) {
|
||||||
|
waitPuller(position);
|
||||||
|
|
||||||
if (position < header->size) {
|
if (position < header->size) {
|
||||||
header->commands[position] =
|
header->commands[position] =
|
||||||
static_cast<std::uint64_t>(CommandId::Nop) |
|
static_cast<std::uint64_t>(CommandId::Nop) |
|
||||||
|
|
@ -271,7 +273,6 @@ private:
|
||||||
|
|
||||||
position = 0;
|
position = 0;
|
||||||
header->push = position;
|
header->push = position;
|
||||||
waitPuller(position);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return position;
|
return position;
|
||||||
|
|
@ -298,6 +299,12 @@ struct BridgePuller {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pos = header->pull;
|
auto pos = header->pull;
|
||||||
|
|
||||||
|
if (pos >= header->size) {
|
||||||
|
header->pull = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto cmd = header->commands[pos];
|
auto cmd = header->commands[pos];
|
||||||
CommandId cmdId = static_cast<CommandId>(cmd);
|
CommandId cmdId = static_cast<CommandId>(cmd);
|
||||||
std::uint32_t argsCount = cmd >> 32;
|
std::uint32_t argsCount = cmd >> 32;
|
||||||
|
|
@ -307,13 +314,7 @@ struct BridgePuller {
|
||||||
unpackCommand(cmdId, header->commands + pos + 1, argsCount);
|
unpackCommand(cmdId, header->commands + pos + 1, argsCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto newPull = pos + argsCount + 1;
|
header->pull = pos + argsCount + 1;
|
||||||
|
|
||||||
if (newPull >= header->size) {
|
|
||||||
newPull = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
header->pull = newPull;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return processed;
|
return processed;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,8 @@ amdgpu::bridge::createShmCommandBuffer(const char *name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
gShmFd = fd;
|
gShmFd = fd;
|
||||||
auto result = new (memory) amdgpu::bridge::BridgeHeader();
|
auto result = new (memory) amdgpu::bridge::BridgeHeader;
|
||||||
|
std::memset(result, 0, sizeof(*result));
|
||||||
result->size =
|
result->size =
|
||||||
(kShmSize - sizeof(amdgpu::bridge::BridgeHeader)) / sizeof(std::uint64_t);
|
(kShmSize - sizeof(amdgpu::bridge::BridgeHeader)) / sizeof(std::uint64_t);
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
|
|
@ -1790,13 +1790,13 @@ static void printSpirv(const std::vector<uint32_t> &bin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
spirv_cross::CompilerGLSL glsl(bin);
|
// spirv_cross::CompilerGLSL glsl(bin);
|
||||||
spirv_cross::CompilerGLSL::Options options;
|
// spirv_cross::CompilerGLSL::Options options;
|
||||||
options.version = 460;
|
// options.version = 460;
|
||||||
options.es = false;
|
// options.es = false;
|
||||||
options.vulkan_semantics = true;
|
// options.vulkan_semantics = true;
|
||||||
glsl.set_common_options(options);
|
// glsl.set_common_options(options);
|
||||||
std::printf("%s\n", glsl.compile().c_str());
|
// std::printf("%s\n", glsl.compile().c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1821,6 +1821,7 @@ int main(int argc, const char *argv[]) {
|
||||||
mainThread->tid = initProcess->pid + baseId;
|
mainThread->tid = initProcess->pid + baseId;
|
||||||
mainThread->state = orbis::ThreadState::RUNNING;
|
mainThread->state = orbis::ThreadState::RUNNING;
|
||||||
mainThread->hostTid = ::gettid();
|
mainThread->hostTid = ::gettid();
|
||||||
|
orbis::g_currentThread = mainThread;
|
||||||
|
|
||||||
auto executableModule =
|
auto executableModule =
|
||||||
rx::linker::loadModuleFile(argv[argIndex], mainThread);
|
rx::linker::loadModuleFile(argv[argIndex], mainThread);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue