Commit Graph

117 Commits

Author SHA1 Message Date
Sylvain Munaut af9de650ac fosphor/gl_cmap_gen: Spacing fix in _set_rgba_from_hsv
Not sure where this came from ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 7944d0d976 fosphor/cl_compat: Fix goofs with calling convention
Doesn't matter on linux/osx because CL_API is nothing, but on Win32, it
changes things.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut f33ebdd28b fosphor/gl_cmap_gen: Add new function to generate GL colormap from a PNG
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 1780d4b43b fosphor/gl_cmap: Add a return value and void* arg to the generate func
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 773442b170 fosphor: Fix typo in headers MAXOSX vs MACOSX
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 484be3ccaa gr-fosphor: Remove shebang from wx_sink_c.py
Since this is not actually executable, don't need it and it apparently
creates some warning when making RPM packages ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 38c79bca9c fosphor/gl: Don't require a glFinish()
Since we always call swap buffer between a call to draw and
the next call to process(), we don't need it. In the future,
make this an option in case there is some usecase that require
it.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 3fdfe7cf81 gr-fopshor: Add a MANIFEST for CGRAN
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-04-02 22:59:40 +02:00
Sylvain Munaut 985c78ffa7 fosphor/cl: Handle invalid (infinite/nan) data better so it recovers
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-20 21:54:52 +01:00
Sylvain Munaut 1603497411 fosphor/gl: Use the right cmap when drawing the histogram intensity scale
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-20 21:54:52 +01:00
Sylvain Munaut 7e195eea1b fosphor/cl: Allow to use APIs deprecated in 2.0 without warnings
This app is CL 1.1 compatible and so we're forced to use some API
that were deprecated in 2.0, no need to be constantly reminded of
it

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-20 21:54:52 +01:00
Sylvain Munaut 5aa7c2f7bd build: Fix CMake 3.x.x warnings
Corresponding commit in the cmake git tree :
2509c7678feb2efab79a384fd0b0b35cee8d02b0

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-20 21:54:52 +01:00
Sylvain Munaut 8c9d6a2152 gr-fosphor: Disable the color scale for the main view when zoomed
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 11f27973a9 fosphor: Add a color intensity scale on the right side
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 720e702ee9 fosphor/shaders: Use GLSL 1.3 instead of "1.5 compatibility"
I originally used 1.5 compatibility because it still allows immediate
mode / fixed pipeline without warning. But Intel Cards on linux and
OSX in general don't implement it.

Using 1.3 works fine since I don't need anything more recent, but
if you display the compilation results, it will for a deprecation
warning.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 95bb75593a fosphor/gl_font: Make sure to set GL_TEXTURE_ENV_MODE properly
GL_MODULATE is required and since it might be used in other mode for
other function, we need to set it explicitely.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 6da6cfe262 fosphor/gl: Allow fallback to GL_LUMINANCE32F_ARB internal format
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 64cf8a305b fosphor/gl: Use glTexSubImage2D for texture update
Much faster than glTexImage2D since it only updates the data
and doesn't delete/create a new storage space for the data.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 1169b7efec fosphor/cl: Fix warning due to unused var
This should have been removed with a previous commit ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 00:23:58 +01:00
Sylvain Munaut 5510404207 fosphor/cl: Balance the score of local_mem size a bit more
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-18 23:35:51 +01:00
Sylvain Munaut 95f603cc51 fosphor/cl: Fix overflow when querying local_mem size
CL_DEVICE_LOCAL_MEM_SIZE is an unsigned long and can be quite large.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-18 23:35:51 +01:00
Sylvain Munaut b1ec76c2f4 fosphor/cl_compat: Blacklist POCL
POCL pretends to be OpenCL 1.2 but it doesn't implement some of the
required functions yet ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-18 23:35:51 +01:00
Sylvain Munaut f2ed7b07a3 fosphor: Acquire the GL objects before cleaning buffers in cl_finish
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-18 23:35:51 +01:00
Sylvain Munaut 36ce5e7843 gr-fosphor/qt: Explicitely set a size policy on the QGLSurface
Without it, some layout don't work and the widget ends up being zero sized

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-11-23 15:34:12 +01:00
Sylvain Munaut f16d0ffafb fosphor/cl: Make sure that all init is done before first render
If no data was processed, finished would return 0 and then the gl_refresh
would not be called which would lead to the GL deferred init to not be
executed which can crash the OpenGL driver.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-09-25 23:46:25 +02:00
Sylvain Munaut e1348d52aa gr-fosphor: Fix missing import in wx_sink error processing
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-09-25 23:46:25 +02:00
Sylvain Munaut 648937eda7 gr-fosphor: Remove useless .bak file
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-09-25 23:46:25 +02:00
Sylvain Munaut b7fc92ef58 gr-fosphor: CMake updates
- Update the GrXXX modules from the GNURadio counter parts
 - Remove the included FindGnuradio and rely on the installed one
   (force 3.7.3 since previous ones are broken)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 23:06:59 +02:00
Sylvain Munaut e2ce8e9a5c gr-fosphor: Prevent multiple thread from initializing fosphor in parallell
Although in theory there is nothing wrong with this and fosphor itself
should support it. However it seems some OpenCL implementation don't
really like having multiple context created in parallell, so we prevent
this manually here.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 21:20:32 +02:00
Sylvain Munaut a77d1950e3 gr-fosphor: Remove an old workaround for a swig bug
This has been removed of Gnuradio iteself in 2012 and this seems to
be causing issues for some OOT on some platforms ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 21:20:32 +02:00
Sylvain Munaut af2c08b571 fosphor/cl: Add missing stdlib.h include to cl_compat.c
Thanks to roox in IRC for pointing this out

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 21:20:31 +02:00
Sylvain Munaut dc1104a523 fosphor/cl: Properly set the 'err' variable when cl_load_program fails
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 21:20:31 +02:00
Sylvain Munaut 9aea19ae1b fosphor: Allow operation without CL/GL sharing extension
The basic idea is that we just create normal CL buffers, then whenever
we need to draw, we wait for CL completion, read the buffers into the
main memory and upload them as textures using plain GL.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:07 +02:00
Sylvain Munaut 566820e8b9 fosphor/cl: Pre-clears the various buffers before use
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut b717480e6e fosphor/cl: Track the current CL state to avoid doing useless stuff
When calling the process method several time without drawing, we don't
need to release the GL objects or even calling clFinish. So here we
internally keep track and only do the 'finishing up' of the CL process
when doing a drawing call.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 35ec2209e4 fosphor/cl: Separate the buffer creation into separate helper
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut b94ca23981 fosphor/gl: Minor comment typo fix
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 7e7387978c fosphor/cl: Add compatibility wrappers for more CL 1.2 functions
In particular clCreateImage, clEnqueueFillBuffer and clEnqueueFillImage

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut be1defecc4 gr-fosphor: Adapt the build to cope with the new CL compat system
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 9433e60478 fosphor/cl: Handle CL 1.1 vs 1.2 differently
The OpenCL 1.2 is nicer but we can't always use it and on linux,
even if the CL_VERSION_1_2 exists, we can't trust it because distrib
sometimes have CL 1.2 headers with a CL 1.1 dispatcher.

So instead, we only assume we have 1.1 header and lib at compile time.
Then at run-time we do a dynamic lookup of the 1.2 symbols from the lib.
We also check if the actual selected platform does support 1.2 (you
could have a 1.2 dispatcher with a 1.1 platform implementation).

If both conditions are satisfied, then we dispatch the call to the 1.2
implementation and if not, then we dispatch them to a local fallback
implementation of the functions (but limited to the functions we need)

It's not pretty but it should work and it isolates all the hack magic
inside cl_compat.{c,h} and you just use the CL1.2 API normally outside
of it.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut cc9f988a20 fosphor/cl: Increase the length of the 'vendor' field
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 4cc7461c09 fosphor/cl: Use the _WIN32 conditional instead of __WIN32__
cl_platform.h will convert any sign of windows to this symbol and this
is also the one use for the include at the top, so use it everywhere.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 02e0db8fdb fosphor/main: Fix the render option initialization sequence
Since the width/height will be set as part of the initial reshape
callback and this is done in glfw_init, we need to make sure we
do the first init of the render option _before_ that, or we'll
undo what glfw_init did.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 65a19326d4 fosphor: Minor doc fix in fosphor.h
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:05 +02:00
Sylvain Munaut 5ca19a2667 gr-fosphor: Update year in copyright notice
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:05 +02:00
Sylvain Munaut 0af84185f5 fosphor: Update year in copyright notice
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:05 +02:00
Sylvain Munaut 30dbdbde79 gr-fosphor/cmake: Fix FindFreetype2 to properly cache the include dir var
Without caching, this would cause a problem with headers not being found
if you did the cmake step twice because the FREETYPE2_FOUND var is cached
and so it wouldn't run through that script again and wouldn't set
FREETYPE2_INCLUDE_DIRS.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut b24ba23784 fosphor: Fix layout routing to avoid half pixel offset
'over' variable needs to be an integer or we'll end up shifting stuff
by half a pixel which causes weird render, especially for fonts.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 5d9665c000 fosphor/gl_cmap_gen: Introduce a helper to set RGBA values from float R,G,B
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 4c08178d89 fosphor/cl: Fix wrong length param when fetching CL_PROGRAM_BINARIES
This would cause a crash when using AMD's CPU OpenCL implementation

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00