early-access version 1415
This commit is contained in:
parent
67cf315423
commit
ba262f74d0
8 changed files with 46 additions and 16 deletions
|
@ -1,7 +1,7 @@
|
||||||
yuzu emulator early access
|
yuzu emulator early access
|
||||||
=============
|
=============
|
||||||
|
|
||||||
This is the source code for early-access 1414.
|
This is the source code for early-access 1415.
|
||||||
|
|
||||||
## Legal Notice
|
## Legal Notice
|
||||||
|
|
||||||
|
|
|
@ -104,14 +104,6 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Evaluates a boolean expression, and returns a result unless that expression is true.
|
|
||||||
#define R_UNLESS_NOLOG(expr, res) \
|
|
||||||
{ \
|
|
||||||
if (!(expr)) { \
|
|
||||||
return res; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define R_SUCCEEDED(res) (res.IsSuccess())
|
#define R_SUCCEEDED(res) (res.IsSuccess())
|
||||||
|
|
||||||
/// Evaluates an expression that returns a result, and returns the result if it would fail.
|
/// Evaluates an expression that returns a result, and returns the result if it would fail.
|
||||||
|
|
|
@ -31,8 +31,6 @@ ScopeExitHelper<Func> ScopeExit(Func&& func) {
|
||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
#define SCOPE_GUARD(body) detail::ScopeExit([&]() body)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This macro allows you to conveniently specify a block of code that will run on scope exit. Handy
|
* This macro allows you to conveniently specify a block of code that will run on scope exit. Handy
|
||||||
* for doing ad-hoc clean-up tasks in a function with multiple returns.
|
* for doing ad-hoc clean-up tasks in a function with multiple returns.
|
||||||
|
@ -51,3 +49,9 @@ ScopeExitHelper<Func> ScopeExit(Func&& func) {
|
||||||
* \endcode
|
* \endcode
|
||||||
*/
|
*/
|
||||||
#define SCOPE_EXIT(body) auto CONCAT2(scope_exit_helper_, __LINE__) = detail::ScopeExit([&]() body)
|
#define SCOPE_EXIT(body) auto CONCAT2(scope_exit_helper_, __LINE__) = detail::ScopeExit([&]() body)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This macro is similar to SCOPE_EXIT, except the object is caller managed. This is intended to be
|
||||||
|
* used when the caller might want to cancel the ScopeExit.
|
||||||
|
*/
|
||||||
|
#define SCOPE_GUARD(body) detail::ScopeExit([&]() body)
|
||||||
|
|
|
@ -120,7 +120,10 @@ ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32
|
||||||
s32 user_value{};
|
s32 user_value{};
|
||||||
R_UNLESS(UpdateIfEqual(system, std::addressof(user_value), addr, value, value + 1),
|
R_UNLESS(UpdateIfEqual(system, std::addressof(user_value), addr, value, value + 1),
|
||||||
Svc::ResultInvalidCurrentMemory);
|
Svc::ResultInvalidCurrentMemory);
|
||||||
R_UNLESS_NOLOG(user_value == value, Svc::ResultInvalidState);
|
|
||||||
|
if (user_value != value) {
|
||||||
|
return Svc::ResultInvalidState;
|
||||||
|
}
|
||||||
|
|
||||||
auto it = thread_tree.nfind_light({addr, -1});
|
auto it = thread_tree.nfind_light({addr, -1});
|
||||||
while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
|
while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
|
||||||
|
@ -211,7 +214,10 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32
|
||||||
}
|
}
|
||||||
|
|
||||||
R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory);
|
R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory);
|
||||||
R_UNLESS_NOLOG(user_value == value, Svc::ResultInvalidState);
|
|
||||||
|
if (user_value != value) {
|
||||||
|
return Svc::ResultInvalidState;
|
||||||
|
}
|
||||||
|
|
||||||
while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
|
while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
|
||||||
(it->GetAddressArbiterKey() == addr)) {
|
(it->GetAddressArbiterKey() == addr)) {
|
||||||
|
|
|
@ -40,6 +40,14 @@ public:
|
||||||
return writable_event;
|
return writable_event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::shared_ptr<KReadableEvent>& GetReadableEvent() const {
|
||||||
|
return readable_event;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::shared_ptr<KWritableEvent>& GetWritableEvent() const {
|
||||||
|
return writable_event;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<KReadableEvent> readable_event;
|
std::shared_ptr<KReadableEvent> readable_event;
|
||||||
std::shared_ptr<KWritableEvent> writable_event;
|
std::shared_ptr<KWritableEvent> writable_event;
|
||||||
|
|
|
@ -46,7 +46,9 @@ ResultCode KReadableEvent::Clear() {
|
||||||
ResultCode KReadableEvent::Reset() {
|
ResultCode KReadableEvent::Reset() {
|
||||||
KScopedSchedulerLock lk{kernel};
|
KScopedSchedulerLock lk{kernel};
|
||||||
|
|
||||||
R_UNLESS_NOLOG(is_signaled, Svc::ResultInvalidState);
|
if (!is_signaled) {
|
||||||
|
return Svc::ResultInvalidState;
|
||||||
|
}
|
||||||
|
|
||||||
is_signaled = false;
|
is_signaled = false;
|
||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
|
|
|
@ -19,6 +19,7 @@ set(SHADER_FILES
|
||||||
find_program(GLSLANGVALIDATOR "glslangValidator" REQUIRED)
|
find_program(GLSLANGVALIDATOR "glslangValidator" REQUIRED)
|
||||||
|
|
||||||
set(GLSL_FLAGS "")
|
set(GLSL_FLAGS "")
|
||||||
|
set(QUIET_FLAG "--quiet")
|
||||||
|
|
||||||
set(SHADER_INCLUDE ${CMAKE_CURRENT_BINARY_DIR}/include)
|
set(SHADER_INCLUDE ${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||||
set(SHADER_DIR ${SHADER_INCLUDE}/video_core/host_shaders)
|
set(SHADER_DIR ${SHADER_INCLUDE}/video_core/host_shaders)
|
||||||
|
@ -27,6 +28,23 @@ set(HOST_SHADERS_INCLUDE ${SHADER_INCLUDE} PARENT_SCOPE)
|
||||||
set(INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/source_shader.h.in)
|
set(INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/source_shader.h.in)
|
||||||
set(HEADER_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/StringShaderHeader.cmake)
|
set(HEADER_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/StringShaderHeader.cmake)
|
||||||
|
|
||||||
|
# Check if `--quiet` is available on host's glslangValidator version
|
||||||
|
# glslangValidator prints to STDERR iff an unrecognized flag is passed to it
|
||||||
|
execute_process(
|
||||||
|
COMMAND
|
||||||
|
${GLSLANGVALIDATOR} ${QUIET_FLAG}
|
||||||
|
ERROR_VARIABLE
|
||||||
|
GLSLANG_ERROR
|
||||||
|
# STDOUT variable defined to silence unnecessary output during CMake configuration
|
||||||
|
OUTPUT_VARIABLE
|
||||||
|
GLSLANG_OUTPUT
|
||||||
|
)
|
||||||
|
|
||||||
|
if (NOT GLSLANG_ERROR STREQUAL "")
|
||||||
|
message(WARNING "Refusing to use unavailable flag `${QUIET_FLAG}` on `${GLSLANGVALIDATOR}`")
|
||||||
|
set(QUIET_FLAG "")
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(FILENAME IN ITEMS ${SHADER_FILES})
|
foreach(FILENAME IN ITEMS ${SHADER_FILES})
|
||||||
string(REPLACE "." "_" SHADER_NAME ${FILENAME})
|
string(REPLACE "." "_" SHADER_NAME ${FILENAME})
|
||||||
set(SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME})
|
set(SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME})
|
||||||
|
@ -54,7 +72,7 @@ foreach(FILENAME IN ITEMS ${SHADER_FILES})
|
||||||
OUTPUT
|
OUTPUT
|
||||||
${SPIRV_HEADER_FILE}
|
${SPIRV_HEADER_FILE}
|
||||||
COMMAND
|
COMMAND
|
||||||
${GLSLANGVALIDATOR} -V --quiet ${GLSL_FLAGS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE}
|
${GLSLANGVALIDATOR} -V ${QUIET_FLAG} ${GLSL_FLAGS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE}
|
||||||
MAIN_DEPENDENCY
|
MAIN_DEPENDENCY
|
||||||
${SOURCE_FILE}
|
${SOURCE_FILE}
|
||||||
)
|
)
|
||||||
|
|
|
@ -18,8 +18,8 @@ class EmuThread;
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
class HandleTable;
|
class HandleTable;
|
||||||
class KSynchronizationObject;
|
|
||||||
class KReadableEvent;
|
class KReadableEvent;
|
||||||
|
class KSynchronizationObject;
|
||||||
class KThread;
|
class KThread;
|
||||||
} // namespace Kernel
|
} // namespace Kernel
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue