Updated: Witness changes to hlsl2glsl #19

merged 4 commits into from Mar 8, 2013


None yet
2 participants

anchsm commented Feb 28, 2013

Looks like the handling of #extension directives changed since I forked to make my post-1.20 texture lookup changes (was getting nested double #extension... directives). I've updated the pull request with a fix for that.


anchsm added some commits Feb 27, 2013

Add ETargetGLSL_140 and make it produce post 1.20 style texture lookups.
e.g. texture() and textureProj() instead of texture2D() and texture2DProj().
To do this I now (optionally) pass the ETargetVersion to Hlsl2Glsl_Initialize so it can choose what style of texture lookup functions initializeHLSLSupportLibrary() inserts into hlslSupportLib.
This means once initialized, every call to Hlsl2Glsl_Translate() has to use the matching ETargetVersion.
fix bug where hlsl2glsl was leaving duplicates in the uniforms list.
In buildUniformsAndLibFunctions(), std::unique only removes contiguous duplicates, so vector must first be sorted to remove them all.
allow non-type-explicit constant initializers.
e.g. where your hlsl could do:
	uniform float3 my_constants = float3(1, 2, 3);
now also allow this, which (afaik) is valid hlsl:
	uniform float3 my_constants = { 1, 2, 3 };
Handling of #extension directives changes since my post-1.20 texture …
…lookup changes, fix them to work with the new system

aras-p added a commit that referenced this pull request Mar 8, 2013

Merge pull request #19 from anchsm/master
Updated: Witness changes to hlsl2glsl:
* added GLSL 1.40 target
* fixed a bug where duplicates were left in uniforms list
* allow non-type-explicit constant initializers

@aras-p aras-p merged commit 838e841 into aras-p:master Mar 8, 2013

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