Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Improve shader logging

Open VReaperV opened this issue 1 year ago • 3 comments

Parse info logs on shader compilation failure in an implementation-dependent way, which poduces an output like this:

 136: 	vec4 color;
 137: 	vec2 texCoord, lmCoord;a
 138: 
 139: 	VertexFetch( position, LB, color, texCoord, lmCoord );
------	-----------^-------------------------------------------------------
0(139) : error C0000: syntax error, unexpected '(', expecting "::" at token "("

 140: 	color = color * u_ColorModulate + u_Color;

If the exact character is not known, the line will just be like "^^^^^^^^^^".

Also reorganised some code a bit due to changes. Removed BuildGPUShaderText() since it was just unnecesserily fragmenting the code at this point.

VReaperV avatar Aug 13 '24 21:08 VReaperV

I have tested this on Nvidia and Intel (the latter sometimes reports incorrect line numbers though...), so just need someone to test with AMD.

VReaperV avatar Aug 13 '24 21:08 VReaperV

Mesa is probably all the same whatever the hardware (AMD, Nvidia, Intel, etc.), and Mesa is probably different different to Windows/macOS proprietary AMD even on AMD. With some luck AMD OGLP on Linux is same as AMD on Windows and macOS. On Windows and Linux, one may try Mesa llvmpipe as a generic Mesa driver.

illwieckz avatar Aug 13 '24 21:08 illwieckz

Guess I'll wait for this to be rebased on #1242 :)

slipher avatar Aug 17 '24 02:08 slipher

Rebased. This now uses the functionality added in #1242.

VReaperV avatar Sep 29 '24 10:09 VReaperV

LGTM

slipher avatar Oct 05 '24 03:10 slipher