Conversation
…ix semantics, remove Sampler12.h dead code, fix base.hlsli SPOTLIGHT overlap and colorUtils.hlsli type error
…ports .hlsl extension
PS_IN struct member order (D3D12 varying signature fix): - Reorder PS_IN members in 9 test PS shaders to match VS_OUT declaration order - Fix example_HorizontalColor_ps.hlsl: add missing v_color, rename gl_FragCoord→pixelCoord AXSLC_UV_TOP / AX_Y_UP macros (base.hlsli): - AXSLC_UV_TOP: built-in per-target define (0=GLSL/ESSL, 1=HLSL/SPIRV/MSL) - AX_Y_UP(v): convert to bottom-left Y-up coordinate convention - vr_vs.hlsl: TEXCOORD_Y → AX_Y_UP Fullscreen PS Y-flip (11 shaders): - Use #if AXSLC_UV_TOP for conditional gl_FragCoord.y flip - example_Heart, Julia, Flower, Mandelbrot, Monjori, Twist, Plasma, shadertoy_FireBall/Glow/LensFlare, example_LensFlare Live2D vertex shaders (3 files): - live2d_blend_vs.hlsl: add AX_Y_UP for v_blendCoord - live2d_masked_vs.hlsl: conditional v_clipPos Y-flip (#if AXSLC_UV_TOP) - live2d_masked_blend_vs.hlsl: both fixes above Documentation: - docs/hlsl-spec.md: add Section 15 Target Macros, updated pipeline diagram - Remove tmp/pr3233-migration.md (merged into spec)
…variants - Rename property AXSLCC_OUTPUT1 → AXSLCC_VARIANT_DEFINES for clarity - Add axslcc_parse_defines() helper to parse comma-separated defines - Replace single-variant if/else with N-variant foreach loop (semicolons separate variants) - Fix variant define placement: base output gets SC_FLAGS only, _1 variant gets extra -D flags - Cleanup: remove empty #ifdef USE_NORMAL_MAPPING blocks in positionNormalTexture_vs.hlsl - Fix: reorder PS_IN members in colorNormal_ps.hlsl (D3D12 location matching) - Add ShaderModule::getCodeSpan()
…-spec.md) Add section 14.1 'Shader Compile Variants' with variant naming and delimiter rules.
- axslc-spec.h: sync SC_PROFILE_BINARY flag from axslcc - GraphicsCore: add currentShaderILProfile to State (set by Driver init) - D3D12: set 60 (DXIL) if DXC available, else 51 (DXBC) - D3D11/Vulkan/Metal: set to currentShaderProfile as default - ShaderModule: add _precompiled + isPrecompiled() - ShaderModule::parseShaderCode: binary-aware sc_target_entry matching - Reads SC_PROFILE_BINARY from profile_ver - Prefers bytecode entry matching currentShaderILProfile - D3D11 Driver: skip D3DCompile for precompiled DXBC, create shader directly - D3D12 Driver: skip DXC/FXC compilation for precompiled bytecode - AXSLCC.cmake: hlsl-50/51 -> d3d11/d3d12, --dxc -> conditional --dxbc - --dxbc enabled for Release/MinSizeRel/RelWithDebInfo only
…precompiled - ShaderModule base: add _blob span + _nativeBlob ComPtr + getBytecode() - D3D11/D3D12 ShaderModule: remove backend-specific blob storage - Precompiled: _blob = _codeSpan (zero-copy), _nativeBlob = nullptr - Source: _blob = compiled blob view, _nativeBlob owns COM blob - createShaderFromBytecode extracted from D3D11 compileShader - compileShader: remove isPrecompiled param (handled by caller) - Program API: getVSBlob/getPSBlob return std::span<uint8_t> universally - VertexLayout11/RenderPipeline12: use span .data()/.size() - D3D12BlobHandle retained for Driver internal use only
…2 subclasses Non-D3D backends (Vulkan/Metal/GL) use _codeSpan directly and don't need a separate compiled bytecode blob.
AXSLCC_FLAGS is a free-form flags string (like CMAKE_CXX_FLAGS). Default is '-S' to keep source (safe cross-platform default). Users can set e.g.: -DAXSLCC_FLAGS='-O2' for optimized bytecode -DAXSLCC_FLAGS='-O0 -S' for debug source -DAXSLCC_FLAGS='-O3' for max optimization
- Add Program::isValid() to check shader compilation status - Replace assert(false) with graceful error handling across all backends - Add dedicated vertex shader layer_radialGradient_vs - Fix HLSL semantics: float3->float4 a_position, SV_Position->POSITION, NORMAL->POSITION - Fix example_Noisy_fs.hlsl pixel coordinate and noise color channels - Add missing a_color/v_color to example_Simple_vs.hlsl - Add Y-flip conditional for GLSL target in live2d_test_vs.hlsl - Bump axslcc to 3.99.1
- Add setSamplers() method to resolve sampler presets via SamplerCache - Call setSamplers() alongside setUniformBuffer() and setTextures() - Samplers with no preset fall back to texture-owned samplers from setTextures()
- Split sampler binding into two phases: TextureOwned (per-texture) and ShaderPreset (built-in sampler presets from base.hlsli) - Rename SamplerIndex to SamplerPreset and update all backends (D3D11, Metal, Vulkan) - Document sampler model in hlsl-faq.md and update hlsl-spec.md - Sync lua shader bindings with Shaders.h: fix _vert/_frag to _vs/_fs and add all missing shader variables
Collaborator
Author
|
/clang-format |
halx99
marked this pull request as ready for review
July 15, 2026 13:35
halx99
marked this pull request as draft
July 17, 2026 05:55
- Rename SamplerBindingInfo fields: descriptorSet->space, comparison->flags - Add SCSamplerFlags enum, kCustomSamplerDescriptorSet, sampler helpers - Generalize SamplerRegistry: getDesc->getSamplerDesc, use string_map - D3D11: compact sequential sampler slot binding - D3D12: add allocateBatch/deallocateBatch, custom sampler root descriptor table - Vulkan: separate descriptor set (set 2) for custom samplers - OpenGL: bind custom sampler objects per program - Update docs/hlsl-faq.md and docs/hlsl-spec.md for custom samplers - Add ShaderCustomSampler test with custom HLSL shader
Collaborator
Author
|
/clang-format |
halx99
marked this pull request as ready for review
July 18, 2026 09:20
- Program: add _textureSamplerIds map and getTextureSampler() for per-binding sampler lookup - axslc-spec: add sampler_ref field for combined texture uniforms - Vulkan: rename SET_INDEX_RESERVED to SET_INDEX_CUSTOM_SAMPLER - D3D11: fix sampler slot overflow check - OpenGL: simplify bindSampler, use getTextureSampler() per binding - Test: add ShaderMultiCustomSampler with two custom samplers
Collaborator
Author
|
/clang-format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
WIP migration guide: https://github.com/axmolengine/axmol/wiki/Shaders-in-Axmol3
axslccpipeline compiles the same HLSL sources for D3D11, D3D12, Vulkan, Metal, OpenGL and OpenGL ES, and CMake now selects targets from the enabled RHI backends and supports multi-compile shader variants.axslcc3.99, including target code metadata, semantic-based vertex input reflection, explicit texture/sampler reflection and backend-independent resource binding metadata.POSITION,TEXCOORD0,COLOR0, custom semantics, etc.), then updates engine, 3D, extension and test vertex layouts to use the new contract.SamplerRegistryand a unified sampler model: 22 stable built-in presets plus named custom samplers registered beforeProgramcreation. Programs validate unresolved samplers, while every RHI backend maps reflected logical bindings to its native binding model.Issue ticket number and link
Checklist before requesting a review
For This PR
dxcompilerby default,glslangonly for verificationCMake Deprecation Warning at 3rdparty/glslang/CMakeLists.txt:111 (message): ENABLE_HLSL is deprecated. The HLSL front-end will be removed in a future major release of glslang. See https://github.com/KhronosGroup/glslang/issues/4210 for details.For each PR
Add Copyright if it missed:
-
"Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."I have performed a self-review of my code.
Optional:
For core/new feature PR
Axmol 3.x ------------------------------------------------------------
For each 3.x PR