Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[isf] WIP on having a compute shader spec #1594

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading