]> git.tdb.fi Git - libs/gl.git/log
libs/gl.git
2 years agoReformat gl.h to make it easier to read
Mikko Rasa [Tue, 5 Sep 2023 09:56:04 +0000 (12:56 +0300)]
Reformat gl.h to make it easier to read

2 years agoUse the mspcore version of getenv
Mikko Rasa [Tue, 5 Sep 2023 09:50:03 +0000 (12:50 +0300)]
Use the mspcore version of getenv

2 years agoAdd some files to the source tarball
Mikko Rasa [Tue, 5 Sep 2023 09:49:09 +0000 (12:49 +0300)]
Add some files to the source tarball

This also includes them in the Visual Studio project, which is useful
for development.

2 years agoInvoke the extension generator through the python3 binary
Mikko Rasa [Tue, 5 Sep 2023 09:48:11 +0000 (12:48 +0300)]
Invoke the extension generator through the python3 binary

On Windows it's not executable directly.

2 years agoExport get_backend_api from the library
Mikko Rasa [Tue, 5 Sep 2023 08:50:32 +0000 (11:50 +0300)]
Export get_backend_api from the library

2 years agoDefer retrieval of default resources in Renderer until needed
Mikko Rasa [Thu, 17 Aug 2023 11:53:22 +0000 (14:53 +0300)]
Defer retrieval of default resources in Renderer until needed

This allows the Renderer to work when no resources are present. provided
that all resources are explicitly supplied.

2 years agoRedesign OffscreenView to own the render target
Mikko Rasa [Wed, 2 Aug 2023 20:33:30 +0000 (23:33 +0300)]
Redesign OffscreenView to own the render target

Change RenderTarget::get_framebuffer to const to accommodate this;
outsiders should not modify the framebuffer's structure anyway.

2 years agoFix compiler warnings introduced by gcc 13
Mikko Rasa [Wed, 2 Aug 2023 20:32:40 +0000 (23:32 +0300)]
Fix compiler warnings introduced by gcc 13

2 years agoRequire GLSL 1.40 for layout qualifiers
Mikko Rasa [Tue, 18 Jul 2023 09:28:57 +0000 (12:28 +0300)]
Require GLSL 1.40 for layout qualifiers

2 years agoDon't run conversion passes when compiling a GLSL module
Mikko Rasa [Tue, 18 Jul 2023 09:25:34 +0000 (12:25 +0300)]
Don't run conversion passes when compiling a GLSL module

Such modules are intended to be later consumed by the same compiler, so
there's no need to convert them to a lower version.

2 years agoAdd a function in Renderer to upload data to a buffer
Mikko Rasa [Tue, 18 Jul 2023 08:29:55 +0000 (11:29 +0300)]
Add a function in Renderer to upload data to a buffer

This accounts for the current frame in flight if necessary.

2 years agoSupport using storage blocks for rendering
Mikko Rasa [Tue, 18 Jul 2023 08:28:40 +0000 (11:28 +0300)]
Support using storage blocks for rendering

2 years agoSome minor refactoring
Mikko Rasa [Tue, 18 Jul 2023 08:27:49 +0000 (11:27 +0300)]
Some minor refactoring

2 years agoAdd a function to query if a uniform is a storage image
Mikko Rasa [Tue, 18 Jul 2023 08:12:57 +0000 (11:12 +0300)]
Add a function to query if a uniform is a storage image

2 years agoRename uniform blocks to just blocks in ReflectData
Mikko Rasa [Mon, 17 Jul 2023 10:31:31 +0000 (13:31 +0300)]
Rename uniform blocks to just blocks in ReflectData

2 years agoAdd storage block support to the shader compiler
Mikko Rasa [Sun, 16 Jul 2023 20:02:29 +0000 (23:02 +0300)]
Add storage block support to the shader compiler

At the moment extended alignment (std140 layout) is used for storage
blocks.  Supporting base alignment (std430) has some complications
because structs may need to be duplicated as base and extended versions.

2 years agoExport a couple of things from the shader compiler so unit tests can work
Mikko Rasa [Sun, 16 Jul 2023 19:40:15 +0000 (22:40 +0300)]
Export a couple of things from the shader compiler so unit tests can work

I'll have to think of a better way to do this later.

2 years agoFix sizing of implicitly sized arrays
Mikko Rasa [Sun, 16 Jul 2023 17:29:25 +0000 (20:29 +0300)]
Fix sizing of implicitly sized arrays

Max index was being initialized to 0, so the sizing code thought every
array was being accessed with a literal 0.

2 years agoRemove some old functions which are no longer used
Mikko Rasa [Sun, 16 Jul 2023 15:04:21 +0000 (18:04 +0300)]
Remove some old functions which are no longer used

2 years agoAdd a function to query the binding of a single uniform block
Mikko Rasa [Sun, 16 Jul 2023 15:03:56 +0000 (18:03 +0300)]
Add a function to query the binding of a single uniform block

2 years agoKeep uniform blocks sorted by their hashed name
Mikko Rasa [Sun, 16 Jul 2023 15:03:33 +0000 (18:03 +0300)]
Keep uniform blocks sorted by their hashed name

2 years agoAvoid duplicate things when generating OpenGL extensions
Mikko Rasa [Sun, 16 Jul 2023 09:45:53 +0000 (12:45 +0300)]
Avoid duplicate things when generating OpenGL extensions

2 years agoCorrectly export cameras aligned on the Z axis
Mikko Rasa [Sat, 15 Jul 2023 19:33:32 +0000 (22:33 +0300)]
Correctly export cameras aligned on the Z axis

2 years agoRetrieve sampler from technique in Text
Mikko Rasa [Fri, 14 Jul 2023 21:13:15 +0000 (00:13 +0300)]
Retrieve sampler from technique in Text

In some cases, like when using a pixelated retro font, it's important
to use a specific sampler.

2 years agoRename Text::texture_slot to texture_tag
Mikko Rasa [Fri, 14 Jul 2023 21:10:00 +0000 (00:10 +0300)]
Rename Text::texture_slot to texture_tag

It refers to the actual binding, so calling it a slot can be confusing.

2 years agoAdd getters for textures and samplers in RenderMethod
Mikko Rasa [Fri, 14 Jul 2023 21:08:28 +0000 (00:08 +0300)]
Add getters for textures and samplers in RenderMethod

2 years agoRecord texture bindings on older OpenGL versions
Mikko Rasa [Fri, 14 Jul 2023 20:35:12 +0000 (23:35 +0300)]
Record texture bindings on older OpenGL versions

2 years agoAdd missing header
Mikko Rasa [Thu, 13 Jul 2023 20:12:28 +0000 (23:12 +0300)]
Add missing header

This was supposed to be in 7864dec.

2 years agoReset the default pipeline state when rendering ends
Mikko Rasa [Mon, 3 Apr 2023 13:15:31 +0000 (16:15 +0300)]
Reset the default pipeline state when rendering ends

This avoids invalid accesses to resources which get destroyed before
the next frame, particularly with the OpenGL backend.

2 years agoResolve blocks after applying constant condition elimination
Mikko Rasa [Mon, 3 Apr 2023 13:13:52 +0000 (16:13 +0300)]
Resolve blocks after applying constant condition elimination

If the body of the conditional scope had any nested blocks, their parent
pointers need to be updated.

2 years agoRemove redundant destructor declarations
Mikko Rasa [Thu, 5 Jan 2023 18:47:48 +0000 (20:47 +0200)]
Remove redundant destructor declarations

Destructors are implicitly noexcept in C++11.

2 years agoDecorate things which constitute the public API of the library
Mikko Rasa [Wed, 4 Jan 2023 22:36:12 +0000 (00:36 +0200)]
Decorate things which constitute the public API of the library

2 years agoAdjustments due to changes in Variant
Mikko Rasa [Wed, 4 Jan 2023 22:10:19 +0000 (00:10 +0200)]
Adjustments due to changes in Variant

Retrieving an object from a collection now requires its type to be fully
defined.

2 years agoAdd debug names to some things which didn't have them
Mikko Rasa [Tue, 11 Oct 2022 08:50:25 +0000 (11:50 +0300)]
Add debug names to some things which didn't have them

2 years agoFix use of incorrect buffer in Mesh
Mikko Rasa [Tue, 11 Oct 2022 08:49:03 +0000 (11:49 +0300)]
Fix use of incorrect buffer in Mesh

Besides crashing the program in specific conditions this was causing
index buffers to sometimes lack a debug name.

2 years agoAdd SplatMaterial to Resources
Mikko Rasa [Tue, 11 Oct 2022 08:48:49 +0000 (11:48 +0300)]
Add SplatMaterial to Resources

2 years agoImprove consistency of debug names
Mikko Rasa [Tue, 11 Oct 2022 08:36:12 +0000 (11:36 +0300)]
Improve consistency of debug names

Hierarchies are now always denoted with a colon.  Square brackets are
used to add indexing-like details to child objects.

2 years agoAdd asset credits for forest pond
Mikko Rasa [Tue, 11 Oct 2022 06:48:56 +0000 (09:48 +0300)]
Add asset credits for forest pond

2 years agoDon't try to refresh a non-existent vertex setup
Mikko Rasa [Mon, 10 Oct 2022 13:23:19 +0000 (16:23 +0300)]
Don't try to refresh a non-existent vertex setup

Compute pipelines don't use one

2 years agoHandle depth range conversion in geometry and tessellation shaders
Mikko Rasa [Mon, 10 Oct 2022 11:49:11 +0000 (14:49 +0300)]
Handle depth range conversion in geometry and tessellation shaders

Clip coordinates are taken from the last stage to deal with vertex
positions, so always converting in the vertex shader is not appropriate.
A geometry shader needs the conversion before every EmitVertex call.

2 years agoRefactor statement creation in DepthRangeConverter into a function
Mikko Rasa [Mon, 10 Oct 2022 11:47:41 +0000 (14:47 +0300)]
Refactor statement creation in DepthRangeConverter into a function

2 years agoEnsure that render targets are writable when clearing
Mikko Rasa [Mon, 10 Oct 2022 09:25:13 +0000 (12:25 +0300)]
Ensure that render targets are writable when clearing

2 years agoAdd a falling raindrops effect to forest pond
Mikko Rasa [Mon, 10 Oct 2022 07:27:37 +0000 (10:27 +0300)]
Add a falling raindrops effect to forest pond

2 years agoDisable depth writes for blended rendering steps
Mikko Rasa [Mon, 10 Oct 2022 07:23:46 +0000 (10:23 +0300)]
Disable depth writes for blended rendering steps

2 years agoEnable advanced rendering options for the forest pond scene
Mikko Rasa [Sun, 9 Oct 2022 21:56:05 +0000 (00:56 +0300)]
Enable advanced rendering options for the forest pond scene

2 years agoAdd a property to always export a blended step for a sequence
Mikko Rasa [Sun, 9 Oct 2022 21:53:14 +0000 (00:53 +0300)]
Add a property to always export a blended step for a sequence

2 years agoAdjust terrain tints in the forest pond scene
Mikko Rasa [Sun, 9 Oct 2022 14:21:12 +0000 (17:21 +0300)]
Adjust terrain tints in the forest pond scene

The moss texture was overly bright.  Re-export also corrected camera
parameters after recent fixes.

2 years agoAccess vector components in Blender by name, not index
Mikko Rasa [Sun, 9 Oct 2022 14:02:28 +0000 (17:02 +0300)]
Access vector components in Blender by name, not index

2 years agoCorrectly export camera up direction
Mikko Rasa [Sun, 9 Oct 2022 13:55:43 +0000 (16:55 +0300)]
Correctly export camera up direction

2 years agoAccount for render resolution when exporting camera field of view
Mikko Rasa [Sun, 9 Oct 2022 13:34:48 +0000 (16:34 +0300)]
Account for render resolution when exporting camera field of view

This is a big of a kludge since in theory a camera could be used in
multiple scenes, but likely to work fine in practice.

2 years agoAdd reflection and refaction to the water in forest pond
Mikko Rasa [Sun, 9 Oct 2022 13:22:18 +0000 (16:22 +0300)]
Add reflection and refaction to the water in forest pond

2 years agoAdd shader functions to get more exact environment samples
Mikko Rasa [Sun, 9 Oct 2022 09:05:50 +0000 (12:05 +0300)]
Add shader functions to get more exact environment samples

The environment map depth buffer is now stored in a cube texture and
passed to the shader so it's possible to raymarch through it.

2 years agoPass frame number to TransferQueue from the outside
Mikko Rasa [Fri, 7 Oct 2022 18:32:43 +0000 (21:32 +0300)]
Pass frame number to TransferQueue from the outside

It can't reliably track it by itself since transfers may be dispatched
multiple times per frame.

2 years agoRename frame_index in Renderer to frame_number
Mikko Rasa [Fri, 7 Oct 2022 18:22:20 +0000 (21:22 +0300)]
Rename frame_index in Renderer to frame_number

It's a free-running counter, not used directly as an index.

2 years agoCheck the flat qualifier from the correct member master
Mikko Rasa [Thu, 6 Oct 2022 11:09:30 +0000 (14:09 +0300)]
Check the flat qualifier from the correct member

2 years agoAdd an internal error for invalid equality comparison in SPIR-V
Mikko Rasa [Thu, 6 Oct 2022 10:48:26 +0000 (13:48 +0300)]
Add an internal error for invalid equality comparison in SPIR-V

2 years agoUse a splat material for the terrain in forest pond
Mikko Rasa [Thu, 6 Oct 2022 10:37:54 +0000 (13:37 +0300)]
Use a splat material for the terrain in forest pond

2 years agoRename VulkanFramebuffer::prepare_image_layouts to synchronize_resources
Mikko Rasa [Thu, 6 Oct 2022 10:31:08 +0000 (13:31 +0300)]
Rename VulkanFramebuffer::prepare_image_layouts to synchronize_resources

For consistency with PipelineState.

2 years agoDon't apply primitive restart to list primitives
Mikko Rasa [Thu, 6 Oct 2022 10:19:06 +0000 (13:19 +0300)]
Don't apply primitive restart to list primitives

2 years agoSynchronize sampled images in addition to storage images
Mikko Rasa [Thu, 6 Oct 2022 10:15:57 +0000 (13:15 +0300)]
Synchronize sampled images in addition to storage images

The same image may alternate between sampled and storage for successive
compute dispatches, and different layouts are needed for each usage.

2 years agoShader fixes in the forest pond demo
Mikko Rasa [Thu, 6 Oct 2022 09:50:07 +0000 (12:50 +0300)]
Shader fixes in the forest pond demo

2 years agoSet a default value for the tint property in PbrMaterial
Mikko Rasa [Wed, 5 Oct 2022 11:35:04 +0000 (14:35 +0300)]
Set a default value for the tint property in PbrMaterial

2 years agoSupport exporting splat materials from Blender
Mikko Rasa [Tue, 4 Oct 2022 22:13:24 +0000 (01:13 +0300)]
Support exporting splat materials from Blender

2 years agoImplement a splat material type
Mikko Rasa [Tue, 4 Oct 2022 22:07:15 +0000 (01:07 +0300)]
Implement a splat material type

Currently it can't hold very many sub-materials because of limitations
of ProgramData.

2 years agoRearrange some things in the shader library
Mikko Rasa [Tue, 4 Oct 2022 21:34:03 +0000 (00:34 +0300)]
Rearrange some things in the shader library

Lighting parameters and queries are now in their own module.  The Cook-
Torrance BRDF has been separated from the PBR material so it's easier to
use elsewhere.

2 years agoChange the vertex group attribute to uvec4
Mikko Rasa [Tue, 4 Oct 2022 21:15:18 +0000 (00:15 +0300)]
Change the vertex group attribute to uvec4

The exporter writes it as UBYTE, which is not compatible with a signed
integer attribute.

2 years agoFix some errors in the Phong shader
Mikko Rasa [Tue, 4 Oct 2022 21:11:58 +0000 (00:11 +0300)]
Fix some errors in the Phong shader

2 years agoRefactor handling some material parameters in cooktorrance.glsl
Mikko Rasa [Mon, 3 Oct 2022 20:44:46 +0000 (23:44 +0300)]
Refactor handling some material parameters in cooktorrance.glsl

Occlusion is now passed as a parameter to the lighting function.
Emission is handled outside of it since it's not properly a part of the
Cook-Torrance BRDF.

2 years agoHandle OpPhi when specializing SPIR-V modules
Mikko Rasa [Mon, 3 Oct 2022 20:43:33 +0000 (23:43 +0300)]
Handle OpPhi when specializing SPIR-V modules

2 years agoHack to work around an issue with the flat interpolation qualifier
Mikko Rasa [Sat, 1 Oct 2022 20:05:45 +0000 (23:05 +0300)]
Hack to work around an issue with the flat interpolation qualifier

It appears that at least on my current system (GeForce 980 Ti, driver
460.91.03) vertex attributes somehow block the flat qualifier from
working on the same location.  It feels like a driver bug but that
remains to be confirmed.

2 years agoAn assortment of minor fixes
Mikko Rasa [Sun, 25 Sep 2022 17:21:19 +0000 (20:21 +0300)]
An assortment of minor fixes

Mostly formatting, with a few cleanups of unnecessary things.

2 years agoOnly apply ambient occlusion to the ambient lighting component
Mikko Rasa [Sun, 25 Sep 2022 17:15:03 +0000 (20:15 +0300)]
Only apply ambient occlusion to the ambient lighting component

2 years agoRecreate ProgramData buffer when needed even if no blocks were updated
Mikko Rasa [Sun, 25 Sep 2022 17:02:52 +0000 (20:02 +0300)]
Recreate ProgramData buffer when needed even if no blocks were updated

This can happen if setting a uniform triggers promotion of the buffer
from static to streaming, but the next shader program does not use that
uniform.

2 years agoUse forward references for entry point interfaces in SPIR-V
Mikko Rasa [Sun, 25 Sep 2022 16:58:40 +0000 (19:58 +0300)]
Use forward references for entry point interfaces in SPIR-V

2 years agoAdd a tint property for PBR materials
Mikko Rasa [Sun, 25 Sep 2022 16:45:34 +0000 (19:45 +0300)]
Add a tint property for PBR materials

2 years agoFix exporting of single objects
Mikko Rasa [Sun, 25 Sep 2022 16:32:08 +0000 (19:32 +0300)]
Fix exporting of single objects

2 years agoRefactor handling of texture storage properties in the Blender exporter
Mikko Rasa [Sun, 25 Sep 2022 16:13:43 +0000 (19:13 +0300)]
Refactor handling of texture storage properties in the Blender exporter

2 years agoAdd flat interpolation qualifier for integer inputs in fragment shader
Mikko Rasa [Sun, 25 Sep 2022 14:49:15 +0000 (17:49 +0300)]
Add flat interpolation qualifier for integer inputs in fragment shader

2 years agoFix validation checks for interpolation and sampling qualifiers
Mikko Rasa [Sun, 25 Sep 2022 14:48:51 +0000 (17:48 +0300)]
Fix validation checks for interpolation and sampling qualifiers

2 years agoPrint warnings if a required resource is not bound in PipelineState
Mikko Rasa [Sun, 25 Sep 2022 13:18:01 +0000 (16:18 +0300)]
Print warnings if a required resource is not bound in PipelineState

3 years agoRestore limits.max_storage_texture_bindings in Vulkan backend
Mikko Rasa [Sun, 11 Sep 2022 17:28:38 +0000 (20:28 +0300)]
Restore limits.max_storage_texture_bindings in Vulkan backend

Something funky happened with commits 569772f and 2a70fec, resulting in
this getting removed.

3 years agoRemove the separate clamping step from forest pond fluid simulation
Mikko Rasa [Sun, 11 Sep 2022 17:23:52 +0000 (20:23 +0300)]
Remove the separate clamping step from forest pond fluid simulation

Instead calculate clamping on the fly in the integration shader.  This
ends up using a few less texture reads in total.

3 years agoImplement water simulation and surface shader for forest pond
Mikko Rasa [Sun, 11 Sep 2022 12:54:22 +0000 (15:54 +0300)]
Implement water simulation and surface shader for forest pond

3 years agoRe-export forest pond data to enable alpha to coverage
Mikko Rasa [Sun, 11 Sep 2022 12:53:39 +0000 (15:53 +0300)]
Re-export forest pond data to enable alpha to coverage

3 years agoDeclare capability for extended storage image formats if required
Mikko Rasa [Tue, 6 Sep 2022 11:54:35 +0000 (14:54 +0300)]
Declare capability for extended storage image formats if required

3 years agoPass a non-sampled image to OP_IMAGE_FETCH
Mikko Rasa [Tue, 6 Sep 2022 11:52:56 +0000 (14:52 +0300)]
Pass a non-sampled image to OP_IMAGE_FETCH

3 years agoFix exporting of resource-only scenes
Mikko Rasa [Sun, 4 Sep 2022 10:55:57 +0000 (13:55 +0300)]
Fix exporting of resource-only scenes

3 years agoCompare constructor calls in TypeComparer
Mikko Rasa [Sat, 3 Sep 2022 19:25:27 +0000 (22:25 +0300)]
Compare constructor calls in TypeComparer

These may arise if e.g. an uint constant is initialized with an integer
literal.

3 years agoSupport exporting meshes from Blender using patch primitives
Mikko Rasa [Sat, 3 Sep 2022 13:40:35 +0000 (16:40 +0300)]
Support exporting meshes from Blender using patch primitives

3 years agoAdd tessellation shader support to the engine
Mikko Rasa [Sat, 3 Sep 2022 13:38:03 +0000 (16:38 +0300)]
Add tessellation shader support to the engine

3 years agoRefactor batch setup in Renderer to a helper function
Mikko Rasa [Sat, 3 Sep 2022 13:36:44 +0000 (16:36 +0300)]
Refactor batch setup in Renderer to a helper function

3 years agoClear load ID when assigning to a component
Mikko Rasa [Sat, 3 Sep 2022 13:31:16 +0000 (16:31 +0300)]
Clear load ID when assigning to a component

This prevents an issue where reading the value of the entire variable
afterwards would incorrectly use the old cached load.

3 years agoImplement tessellation shaders in the shader compiler
Mikko Rasa [Sat, 3 Sep 2022 13:14:43 +0000 (16:14 +0300)]
Implement tessellation shaders in the shader compiler

3 years agoHandle the flat and centroid qualifiers in SPIR-V output
Mikko Rasa [Sat, 3 Sep 2022 13:15:52 +0000 (16:15 +0300)]
Handle the flat and centroid qualifiers in SPIR-V output

3 years agoValidate that compute shaders specify a workgroup size
Mikko Rasa [Sat, 3 Sep 2022 12:05:33 +0000 (15:05 +0300)]
Validate that compute shaders specify a workgroup size

3 years agoValidate the presence of in/out layout qualifiers for geometry shaders
Mikko Rasa [Sat, 3 Sep 2022 11:33:43 +0000 (14:33 +0300)]
Validate the presence of in/out layout qualifiers for geometry shaders

Builtin arrays are now always autosized, even when the appropriate size
isn't known, because the error message from the missing size is confusing.

3 years agoFix incorrect check for end of string when processing SPIR-V modules
Mikko Rasa [Thu, 1 Sep 2022 19:44:32 +0000 (22:44 +0300)]
Fix incorrect check for end of string when processing SPIR-V modules

3 years agoMake VulkanFramebuffer::is_format_supported const
Mikko Rasa [Thu, 1 Sep 2022 19:36:14 +0000 (22:36 +0300)]
Make VulkanFramebuffer::is_format_supported const

3 years agoUse correct to_present flag when creating framebuffers and pipelines
Mikko Rasa [Thu, 1 Sep 2022 19:32:37 +0000 (22:32 +0300)]
Use correct to_present flag when creating framebuffers and pipelines

After a recent update validation layers started complaining about
incompatible render passes because subpass dependencies did not match.

3 years agoMake it possible to query if a framebuffer can be presented
Mikko Rasa [Thu, 1 Sep 2022 19:31:17 +0000 (22:31 +0300)]
Make it possible to query if a framebuffer can be presented