Skip to content

Commit

Permalink
[isf] WIP on having a compute shader spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Dec 26, 2024
1 parent dc29b2f commit 516b2d4
Show file tree
Hide file tree
Showing 9 changed files with 1,347 additions and 73 deletions.
7 changes: 7 additions & 0 deletions src/plugins/score-plugin-avnd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,13 @@ avnd_make_score(
NAMESPACE examples
)

avnd_make_score(
SOURCES "${AVND_FOLDER}/examples/Gpu/FilterGeometryGpu.hpp"
TARGET jiggle_positions
MAIN_CLASS JigglePositions
NAMESPACE examples::helpers
)

avnd_make_score(
SOURCES "${AVND_FOLDER}/examples/Raw/ProcessLauncher.hpp"
TARGET avnd_process
Expand Down
7 changes: 7 additions & 0 deletions src/plugins/score-plugin-gfx/3rdparty/libisf/src/isf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,13 @@ static const std::unordered_map<std::string, root_fun>& root_parse{[] {
}
}
}});
p.insert({"MODE", [](descriptor& d, const sajson::value& v) {
if(v.get_type() == sajson::TYPE_STRING)
{
if(v.as_string() == "COMPUTE")
d.compute = true;
}
}});

static const std::unordered_map<std::string, input_fun>& input_parse{[] {
static std::unordered_map<std::string, input_fun> i;
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/score-plugin-gfx/3rdparty/libisf/src/isf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ struct pass
bool float_storage{};
std::string width_expression{};
std::string height_expression{};

std::vector<std::string> workgroup;
};

struct descriptor
Expand All @@ -114,6 +116,7 @@ struct descriptor
std::vector<pass> passes;
std::vector<std::string> pass_targets;
bool default_vertex_shader{};
bool compute{};
};

class parser
Expand Down
48 changes: 35 additions & 13 deletions src/plugins/score-plugin-gfx/Gfx/Graph/ISFNode.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <Gfx/Graph/ISFNode.hpp>
#include <Gfx/Graph/ISFVisitors.hpp>
#include <Gfx/Graph/RenderedComputeNode.hpp>
#include <Gfx/Graph/RenderedISFNode.hpp>

#include <score/tools/Debug.hpp>
Expand Down Expand Up @@ -257,23 +258,44 @@ QSize ISFNode::computeTextureSize(const isf::pass& pass, QSize origSize)

score::gfx::NodeRenderer* ISFNode::createRenderer(RenderList& r) const noexcept
{
switch(this->m_descriptor.passes.size())
#if 0
if(this->m_descriptor.compute)
{
case 0:
return nullptr;
case 1:
if(!this->m_descriptor.passes[0].persistent)
{
return new SimpleRenderedISFNode{*this};
[[unlikely]];
switch(this->m_descriptor.passes.size())
{
case 0:
return nullptr;
case 1:
return new SimpleRenderedComputeNode{*this};
break;
default: {
return new RenderedComputeNode{*this};
break;
}
else
{
}
}
else
#endif
{
switch(this->m_descriptor.passes.size())
{
case 0:
return nullptr;
case 1:
if(!this->m_descriptor.passes[0].persistent)
{
return new SimpleRenderedISFNode{*this};
}
else
{
return new RenderedISFNode{*this};
}
break;
default: {
return new RenderedISFNode{*this};
break;
}
break;
default: {
return new RenderedISFNode{*this};
break;
}
}
}
Expand Down
Loading

0 comments on commit 516b2d4

Please sign in to comment.