summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gsk: Tweak GskGLShader long descmatthiasc/glshader-nodeMatthias Clasen2020-09-281-9/+7
| | | | Reformulate one paragraph, as suggested by Benjamin.
* gsk: Use guint for array indicesMatthias Clasen2020-09-282-4/+4
| | | | Avoids some trivialities and static analyis complaints.
* gsk: Cosmetic docs tweakMatthias Clasen2020-09-281-1/+1
|
* gsk: Small doc tweaksMatthias Clasen2020-09-281-10/+12
| | | | | Add an annotation, and tweak the docs for gsk_gl_shader_node_new slightly.
* gsk: Improve gsk_gl_shader_node_new preconditionsMatthias Clasen2020-09-281-4/+5
| | | | Check all that we can.
* gsk: Tweak shader node deserializationMatthias Clasen2020-09-281-93/+71
| | | | | Use a GskShaderArgsBuilder and make the parser more precise about commas vs semicolons.
* gsk: Reuse css printing functionMatthias Clasen2020-09-281-46/+1
| | | | Don't copy _gtk_css_print_string, just use it.
* css: Move the last parser api to the new headerMatthias Clasen2020-09-282-9/+3
| | | | | This lets us use it from the render node parser in gsk.
* rendernodeparser: Tweak the shader node serializationMatthias Clasen2020-09-281-2/+2
| | | | | We call it args now in the api. Follow suit for the serialization.
* gsk: Beef up GskShaderArgsBuilder docsMatthias Clasen2020-09-281-11/+26
| | | | Mention that args are zero-initialized.
* gtk-demo: Simplify transitions demoMatthias Clasen2020-09-281-12/+7
| | | | | We are not using the frame clock anymore, so don't pass it around.
* gtk-demo: Tweak the transition demo textMatthias Clasen2020-09-281-3/+7
| | | | Fix some types, and say a bit more here.
* gsk: Fix the shader exampleMatthias Clasen2020-09-281-1/+1
| | | | I mixed up my variable names.
* GskShaderArgBuilder: Use standard builder-like APIAlexander Larsson2020-09-285-35/+85
| | | | | Primarily this is ref/unref vs copy, and ne wfree_to_args() method. But also some minor renames.
* gsk_gl_shader_format_args: Pass arguments by valueAlexander Larsson2020-09-284-25/+25
| | | | | | Primitive values are now passed by values (although vectors still by pointer). Also since we can now no longer handle missing definitions that is an error.
* gtk-demo: Only use one GskGLShader in fishbowlAlexander Larsson2020-09-282-6/+4
| | | | | | We don't want to use a new shader per paintable, because then we will need to recompile each one. Also remove some leftover unused vars from the cogs glsl.
* snapshot: Drop n_children from push_gl_shader and use custom popAlexander Larsson2020-09-285-63/+136
| | | | | | | | | | We now always assume you pass the right amount of children for the shader, and each such child is followed by gtk_snapshot_gl_shader_pop_texture() and then a final gtk_snapshot_pop(). This means we handle the 0 child case ok, and that we can validate that the number of pops of various types are correct.
* Add some more docsglshader-paintableMatthias Clasen2020-09-251-1/+19
| | | | Add an example to the GskGLShader docs.
* Add another shader testMatthias Clasen2020-09-251-0/+45
| | | | | This one tests the convenience api for creating uniform data.
* gtk-demo: Add a shader paintable to the fishbowlMatthias Clasen2020-09-251-0/+32
| | | | This gets around 500 instances at 60fps on my system.
* gtk-demo: Add a shader paintable demoMatthias Clasen2020-09-253-7/+266
| | | | | | | Add a shader paintable to the OpenGL transitions demo. This is reusing one of the shadertoy examples, tweaked slightly to work as a standalone fragment shader.
* gtk-demo: Add a shader paintableMatthias Clasen2020-09-255-0/+405
| | | | | | | | | This is a GdkPaintable implementation wrapped around a GskGLShader. It can optionally be hooked up to a frame clock to update a time uniform. The code is set up for this to live as public api in GSK, if we find it useful enough.
* snapshot: Drop the varargs versions of push_gl_shader()Alexander Larsson2020-09-255-86/+14
| | | | | We can now just use gsk_gl_shader_format_args() directly, relying on the transfer-full of the shader args argument.
* gtk_snapshot_push_gl_shader: Make @args transfer-fullAlexander Larsson2020-09-252-5/+10
| | | | This makes the common case of this just being created a lot easier.
* Rename uniform_data to shader args, or just argsAlexander Larsson2020-09-2511-281/+308
| | | | | This makes a lot of types and function names shorter. Also, we add a "..." version of gsk_gl_shader_format_args_va().
* Finish remaining renames from GLSHADER to GL_SHADER (etc)Alexander Larsson2020-09-259-116/+116
| | | | This fixes all remaining cases in public headers.
* GskGLShader: Drop fallback node and add try_compile function to replace itAlexander Larsson2020-09-2514-192/+262
| | | | | | | | This removes the fallback node from GskGLShaderNode and adds a new function gsk_gl_shader_try_compile_for() which tries to compile a shader against a renderer. Then you can use the return value of this both as a way to implement the fallback, and as a way to get at the error report in a saner way.
* Add some shader testsMatthias Clasen2020-09-232-0/+171
| | | | | These are just basic api usage tests, no rendering. They found the issues fixed in the preceding commits.
* gsk: Make uniform regex more forgivingMatthias Clasen2020-09-231-1/+1
| | | | | Accept - in initializers, otherwise we don't accept things like uniform int n = -2;
* gsk: Make uniform regex more forgivingMatthias Clasen2020-09-231-1/+2
| | | | | | Accept comments after a uniform declaration - the very first shader example I tried had these, so we better support it.
* gsk: Fix getters and setters for vector typesMatthias Clasen2020-09-231-6/+6
| | | | | | | The types we store for the uniforms are VEC2/3/4, even though we just store a bunch of floats. This was found while adding some simple tests.
* gsk: Add more shader debug spewMatthias Clasen2020-09-231-17/+54
| | | | | | | Print out the full assembled shader sources when GSK_DEBUG=shaders is given. This is very verbose, but may be useful to see what we actually pass to the compiler.
* gsk: Add some shader debug spewMatthias Clasen2020-09-231-0/+52
| | | | | | When we're done extracting uniform info from the glsl, print out what we've found for GSK_DEBUG=shaders. If something goes wrong, this will be useful.
* docs: Add new snapshot apisMatthias Clasen2020-09-231-0/+3
|
* Rename gl shader snapshot apisMatthias Clasen2020-09-234-55/+57
| | | | | | | | Rename gtk_snapshot_push_glshader and friends to gtk_snapshot_push_gl_shader, following the similar renaming in GSK. Update all callers.
* gsk: Small doc fixupsMatthias Clasen2020-09-232-10/+12
| | | | Tweak the gl shader docs here and there.
* Add GskGLShader apis to the docsMatthias Clasen2020-09-233-0/+51
|
* shadertoy demo: Fix GLSL on GLESAlexander Larsson2020-09-231-2/+4
| | | | I was getting "assignment to varying fragColor" errors
* gtk-demo: Add GskGLShaderNode demoAlexander Larsson2020-09-2312-0/+1127
| | | | | | | | | | | Add adds a demo showing off GskGLShaderNode in various ways. It has a transistion widget, using some examples from gl-transitions.com, with child widgets being both images, a GL area and real widgets (that let you edit the transition shaders themselves. It also has a fancy fire effect on hove on the buttons.
* Support GLShaderNode in backendsAlexander Larsson2020-09-2311-41/+402
| | | | | | For vulkan/broadway this just means to ignore it, but for the gl backend we support (with up to 4 texture inputs, which is similar to what shadertoy does, so should be widely supported).
* GtkSnapshot: Add gtk_snapshot_push_glshader()Alexander Larsson2020-09-232-0/+209
|
* Add GskGLShaderNodeAlexander Larsson2020-09-2310-3/+2148
| | | | | | | | | | | | | | This is a rendernode that is supposed to run a GLSL fragment shader with a set of inputs and produce outputs. The inputs are: * A GskGLShader object with the source and uniforms definitions computed from the source. * A the data for the uniforms, formated according to the GskGLShader * a list of render nodes that are rendered to textures Additionally there is a fallback node which is used in case OpenGL is not supported or there is some kind of failure with the shader code.
* gl: Add some namespacing to the preamble symbolsAlexander Larsson2020-09-2217-121/+121
| | | | | | This adds a gsk prefix to the stuff in the preamble, as we want to avoid it conflicting with things in the main shader. Especially once we start allow some customization of shaders.
* gl backend: Add line numbers to source in glsl compilation errorsAlexander Larsson2020-09-221-2/+22
| | | | | | Almost always the source is created by combining various sources, which means the line numbers in the error messages are hard to use. Adding the line numbers to the source in the error message helps with this.
* gl: Properly report error if shader linking failsAlexander Larsson2020-09-221-0/+1
| | | | | | In gsk_gl_shader_builder_create_program(), if linking fails we need to return -1 to indicate error, rather than the old deleted program id.
* glrenderer: Move ProgramState into ProgramAlexander Larsson2020-09-223-59/+61
| | | | | | There is no real reason to have this on the side indexed via the index, as it is stored next to each other anyway. Plus, storing them together lets use use `Program` structures not in the array.
* Merge branch 'improve-columnview-styling' into 'master'Matthias Clasen2020-09-221-13/+40
|\ | | | | | | | | Adwaita: Improve columnview styling See merge request GNOME/gtk!2608
| * Adwaita: Don't restrict columnview editablelabel style to .data-tablenana-42020-09-221-10/+10
| | | | | | | | This should be available without .data-table.
| * Adwaita: Improve columnview stylingnana-42020-09-221-0/+27
| | | | | | | | | | | | | | - Move padding from parent row to child cell. - Align horizontal sizing of cell with header button. - Properly support GtkColumnView:show-column-separators. - Change cell height with and without .data-table.
| * Adwaita: Fix separator color for listsnana-42020-09-221-3/+3
|/