Hi,
In order to compute some shader offline , i would like to know if there is a simple way to convert GLSL to GX2 format for vertex/pixel shader ?
for record, I was able to successfully use libgui shader into retroarch https://github.com/Maschell/libgui/blob/master/source/video/shaders/Texture2DShader.cpp
but if i want to go ahead and implement some libretro glsl shader ( https://github.com/libretro/glsl-shaders ) in retroarch , is there any open free tool that
can help to convert GLSL shader to GX2. I know AMD gpu analyser can transform GLSL to ASM shader , but after we have the asm how can we transform the asm to something compatible with the GPU7 shader like @aliaspider did ?
Any help would be appreciate. I only have an average knowledge of the GLSL shader and all the asm part is above to me.
After dealing with the result GX2VertexShader GX2PixelShader GX2SamplerVar is more in my skills.
In order to compute some shader offline , i would like to know if there is a simple way to convert GLSL to GX2 format for vertex/pixel shader ?
for record, I was able to successfully use libgui shader into retroarch https://github.com/Maschell/libgui/blob/master/source/video/shaders/Texture2DShader.cpp
but if i want to go ahead and implement some libretro glsl shader ( https://github.com/libretro/glsl-shaders ) in retroarch , is there any open free tool that
can help to convert GLSL shader to GX2. I know AMD gpu analyser can transform GLSL to ASM shader , but after we have the asm how can we transform the asm to something compatible with the GPU7 shader like @aliaspider did ?
Code:
/*******************************************************
*******************************************************
*
* Pixel Shader GLSL source:
*
*******************************************************
*******************************************************
*
* varying vec2 tex_coord;
* uniform sampler2D s;
* void main()
* {
* gl_FragColor = texture2D(s, tex_coord);
* }
*
******************************************************
******************************************************
*
* assembly output from AMD's GPU ShaderAnalyzer :
*
******************************************************
******************************************************
*
* 00 TEX: ADDR(16) CNT(1) VALID_PIX
* 0 SAMPLE R0, R0.xy0x, t0, s0
* 01 EXP_DONE: PIX0, R0
* END_OF_PROGRAM
*
*******************************************************
*******************************************************
*/
__attribute__((aligned(GX2_SHADER_ALIGNMENT)))
static struct
{
u32 cf[16 * 2]; /* first ADDR() * 2 */
u32 tex[1 * 3]; /* CNT() sum * 3 */
} ps_program =
{
{
TEX(16, 1) VALID_PIX,
EXP_DONE(PIX0, _R0, _X, _Y, _Z, _W)
END_OF_PROGRAM
},
{
TEX_SAMPLE(_R0, _X, _Y, _Z, _W, _R0, _X, _Y, _0, _X, _t0, _s0)
}
};
Any help would be appreciate. I only have an average knowledge of the GLSL shader and all the asm part is above to me.
After dealing with the result GX2VertexShader GX2PixelShader GX2SamplerVar is more in my skills.
Last edited by rioray,
, Reason: fix name