Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Explicit Resource Bindings in OpenGL#51

Open
Jorgemagic wants to merge 17 commits into
microsoft:mastermicrosoft/ShaderConductor:masterfrom
Jorgemagic:ExplicitResourceBindingsJorgemagic/ShaderConductor:ExplicitResourceBindingsCopy head branch name to clipboard
Open

Explicit Resource Bindings in OpenGL#51
Jorgemagic wants to merge 17 commits into
microsoft:mastermicrosoft/ShaderConductor:masterfrom
Jorgemagic:ExplicitResourceBindingsJorgemagic/ShaderConductor:ExplicitResourceBindingsCopy head branch name to clipboard

Conversation

@Jorgemagic

Copy link
Copy Markdown
Contributor

Hi @gongminmin,

In this pull request I added several things:

Added Explicit resource bindings in OpenGL translation

HLSL

Texture2D DiffuseTexture : register(t0);
SamplerState Sampler : register(s0);
Texture2D DiffuseTexture2 : register(t1);

Produced explicit layout bindings in GLSL

layout(binding = 0) uniform sampler2D SPIRV_Cross_CombinedDiffuseTextureSampler;
layout(binding = 1) uniform sampler2D SPIRV_Cross_CombinedDiffuseTexture2Sampler;

This ensures the resource bindings are the same that in original HLSL.

More flexible load dependencies (dxcompiler) on windows

Before:
m_dxcompilerDll = ::LoadLibraryA(dllName);
Issue: Only search dxcompiler library in executable path and system paths, now is possible load library from ShaderConductor library path.

Included libShaderConductorWrapper to cmake compilation

Now the AzurePipeline artifacts will include libdxcompiler, libShaderConductor, and libShaderConductorWrapper libraries.

#ifdef _WIN32
m_dxcompilerDll = ::LoadLibraryA(dllName);
HMODULE hm = NULL;
if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCSTR) "DllMain",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(LPCSTR)"DllMain"
can be changed to
TEXT("DllMain")
to make it compatible to both MBCS and UNICODE. Or just use GetModuleHandleExA without C-style case to DllMain. Same as GetModuleFileName below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that it is interesting.

Comment thread Source/CMakeLists.txt
set_target_properties(${DLL_NAME} PROPERTIES FOLDER "Wrapper")

set(CSHARP_TEST CSharpPinvoke)
if(SC_WITH_CSHARP)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be:
if(NOT SC_WITH_CSHARP)
return()
endif()
to avoid indent most lines in this file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.