Giter Club home page Giter Club logo

px's People

Contributors

krant avatar nukebird avatar pplux avatar sssyt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

px's Issues

Backend resource cleanup bug

Hi,
I found a little yet annoying bug which causes severe issues after calling destroy() with px_render::Pipeline and subsequent call of createPipeline. There's one line missing in DestroyBackEndResource(), right after you call glDeleteProgram:
GLCHECK(glDeleteProgram(b->pipelines[pos].program));
b->pipelines[pos].program = 0; // <---- this one is required

Without this you'll get a lot of OpenGL errors by using deleted and reused Pipeline (since createPipeline reuses previously deleted Pipeline), because this check in ChangePipeline will always fail to execute the inner code in the if() block:
if (pi.second->program == 0) {

Compile error

I cant compile with the .bat. I am using 2014 VS with C++14 support
'px_sched::ObjectPool<px_sched::Scheduler::Task>::D::state': is not a type name, static, or enumerator

[OT] Possible use of Tinythreadpp to replace C++11

[I'm closing this soon because it's not a real issue]

I remember that some years ago I liked this library a lot: [tinythreadpp] [API reference here].

From your docs, it seems that px_sched.h is:

  • Portable, written in C++11 with no dependency
  • C++11 only used for thread, mutex, and condition variable no STL container is used

whereas px_render.h is more complex (needs C++11/C++14).

I'm wondering if px_sched.h can be compiled without C++11, just using tinythreadpp.

AFAIR, the API is very similar (except a few missing constructor overloads in the thread class).

However, this post is just a useless experiment: nowadays most compilers support C++11.
Maybe this is just something for people trying to minimize file size (I don't think tinythreadpp uses STL, but I have to check).

So basically I'm going to close this now, leaving this post just as a suggestion for the few users that can be interested in removing the C++11 dependency from px_sched.h.

Sorry for polluting the Issue Section.

Question: Get the texture buffer id

Hi,
how can I get the texture ID from a framebuffer?
frame_buffer.color_texture().id has invalid value...
ItΒ΄s to use in the Imgui image

Allow for waiting threads to do jobs

Pseudo code:

        px_sched::Sync sync;
        for(int i = 0; i < 100; ++i) {
            scheduler.runTask([&](){
                // Heavy task
                }, &sync);
        }
        scheduler.waitFor(sync);

Here the calling thread that creates the task will suspend waiting for the tasks to be finished before carrying on. This requires the pool of threads to be bigger than the actual core count to allow some threads wait for others and still have enough threads to keep using all cpus. One possible solution could be for the thread that waits on a sync object to start doing tasks from the list of tasks related to that sync object.

The idea is that if the thread needs to wait for a task to be finished it can go on and start working on that lists of tasks itself instead of waiting.

Entry point is not defined in the examples

Entry point is not defined in the examples, how can I execute it?
I added the default "main" entry, and then call to sokol_main(int argc, char **argv) with the default parameters.
Is there a preprocesor or something to determine the entry in your API?
Thanks, I am waiting for a reasonable documentation to how to start or something

set_uniforms usage example

Can someone show me how to set custom uniforms?
I didn't find any example for the set_uniforms function

Possible Makefile error on Linux (and fix)

Hi. I've cloned the repository and tried compiling it with:

.../.../px/examples$ make
g++ -std=c++11 -pedantic -g -O2 -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wdouble-promotion -Werror -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs -Wno-unused -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef  -o px_sched_example1 -lpthread -lpthread px_sched_example1.cpp
/tmp/cce6YjPP.o: In function `std::thread::thread<void (&)(px_sched::Scheduler*, px_sched::Scheduler::Worker*), px_sched::Scheduler*, px_sched::Scheduler::Worker*>(void (&)(px_sched::Scheduler*, px_sched::Scheduler::Worker*), px_sched::Scheduler*&&, px_sched::Scheduler::Worker*&&)':
/usr/include/c++/5/thread:137: undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
Makefile:42: recipe for target 'px_sched_example1' failed
make: *** [px_sched_example1] Error 1

Then, based on these links link1 link2 (that seem to contradict each other πŸ˜ƒ ), I thought that -lpthread must be put after the source files, whereas -pthread only can be used before the source files.

I've tried the latter and simply replaced -lpthread with -pthread in the Makefile.
I don't know if this is the right solution, but it worked:

.../.../px/examples$ make clean
rm -f px_sched_example1 px_sched_example2 px_sched_example3 px_sched_example4 px_sched_example5 px_sched_example6 px_sched_example7
.../...//px/examples$ make
g++ -std=c++11 -pedantic -g -O2 -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wdouble-promotion -Werror -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs -Wno-unused -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef  -o px_sched_example1 -pthread px_sched_example1.cpp
g++ -std=c++11 -pedantic -g -O2 -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wdouble-promotion -Werror -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs -Wno-unused -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef  -o px_sched_example2 -pthread px_sched_example2.cpp
g++ -std=c++11 -pedantic -g -O2 -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wdouble-promotion -Werror -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs -Wno-unused -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef  -o px_sched_example3 -pthread px_sched_example3.cpp
g++ -std=c++11 -pedantic -g -O2 -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wdouble-promotion -Werror -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs -Wno-unused -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef  -o px_sched_example4 -pthread px_sched_example4.cpp
g++ -std=c++11 -pedantic -g -O2 -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wdouble-promotion -Werror -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs -Wno-unused -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef  -o px_sched_example5 -pthread px_sched_example5.cpp
g++ -std=c++11 -pedantic -g -O2 -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wdouble-promotion -Werror -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs -Wno-unused -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef  -o px_sched_example6 -pthread px_sched_example6.cpp
g++ -std=c++11 -pedantic -g -O2 -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wdouble-promotion -Werror -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs -Wno-unused -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef  -o px_sched_example7 -pthread px_sched_example7.cpp

Hope it helps other Linux users having the same problems πŸ˜„ .

px_render_gltf. Out of bounds error because of sampler

Test model: test_model.zip

For myself I just hardcoded

	new_texture.info.magnification_filter = SamplerFiltering::Linear;
        new_texture.info.minification_filter  = SamplerFiltering::LinearMipmapLinear;
        new_texture.info.wrapping[0] = SamplerWrapping::Repeat;
        new_texture.info.wrapping[1] = SamplerWrapping::Repeat;
        new_texture.info.wrapping[2] = SamplerWrapping::Repeat;

...and everything works. I have an assumption that the model has no legal samplers

So problem line is

const tinygltf::Sampler &sampler = model.samplers[sampler_idx];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.