mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
feat(shader): impl ir descriptor structures primitives
This commit is contained in:
@@ -15,7 +15,7 @@ Reaches the `main` function with render loop (deep call chain, ~64KB stack frame
|
||||
A standalone [SPIR-V triangle test](core/libs/prx/libSceAgcDriver/tests/Visual.cpp) passes GPU readback checks and presents a frame through the [libSceAgcDriver](core/libs/prx/libSceAgcDriver). The first application draw passes driver state validation and reaches shader recompilation.
|
||||
Application shader execution remains unverified without completed [recompiler](core/shader/recompiler/Recompiler.cpp).
|
||||
|
||||
Now: `ShaderRecompiler::Recompile: SsaBuilder::Rewrite not implemented`.
|
||||
Now: `ShaderRecompiler::Recompile: SpirvEmitter::Emit not implemented`.
|
||||
|
||||
## Build
|
||||
|
||||
|
||||
+7
-6
@@ -4,7 +4,6 @@
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
namespace ShaderRecompiler {
|
||||
@@ -32,10 +31,10 @@ struct PushData {
|
||||
std::array<std::uint32_t, DwordCount> dwords {};
|
||||
|
||||
[[nodiscard]] static bool CanFit(std::uint32_t start, std::uint32_t size) {
|
||||
throw std::runtime_error("CanFit not implemented");
|
||||
return size != 0u && start <= DwordCount && size <= DwordCount - start;
|
||||
}
|
||||
[[nodiscard]] static std::uint32_t StartFor(std::uint32_t cursor, std::uint32_t size) {
|
||||
throw std::runtime_error("StartFor not implemented");
|
||||
return CanFit(cursor, size) ? cursor : NoStart;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -54,13 +53,15 @@ struct IrBindingLayout {
|
||||
std::vector<IrDescriptorBinding> descriptors;
|
||||
|
||||
[[nodiscard]] std::uint32_t ShaderDataDwords() const {
|
||||
throw std::runtime_error("ShaderDataDwords not implemented");
|
||||
return memoryOffsetDword + (memoryOffsetCount + 3u) / 4u;
|
||||
}
|
||||
[[nodiscard]] bool UsesPushData() const {
|
||||
throw std::runtime_error("UsesPushData not implemented");
|
||||
return pushDataStartDword != PushData::NoStart;
|
||||
}
|
||||
void AdvancePushData(std::uint32_t& cursor) const {
|
||||
throw std::runtime_error("AdvancePushData not implemented");
|
||||
if (UsesPushData()) {
|
||||
cursor = pushDataStartDword + ShaderDataDwords();
|
||||
}
|
||||
}
|
||||
|
||||
bool operator==(const IrBindingLayout& other) const = default;
|
||||
|
||||
Reference in New Issue
Block a user