Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
f253ff9f
Commit
f253ff9f
authored
9 years ago
by
RealBadAngel
Committed by
Kahrl
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Dump shader programs on compile errors
parent
7e5eea9a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shader.cpp
+23
-0
23 additions, 0 deletions
src/shader.cpp
src/shader.h
+3
-0
3 additions, 0 deletions
src/shader.h
with
26 additions
and
0 deletions
src/shader.cpp
+
23
−
0
View file @
f253ff9f
...
...
@@ -808,6 +808,9 @@ ShaderInfo generate_shader(std::string name, u8 material_type, u8 drawtype,
"failed to generate
\"
"
<<
name
<<
"
\"
, "
"addHighLevelShaderMaterial failed."
<<
std
::
endl
;
dumpShaderProgram
(
warningstream
,
"Vertex"
,
vertex_program
);
dumpShaderProgram
(
warningstream
,
"Pixel"
,
pixel_program
);
dumpShaderProgram
(
warningstream
,
"Geometry"
,
geometry_program
);
return
shaderinfo
;
}
}
...
...
@@ -826,6 +829,8 @@ ShaderInfo generate_shader(std::string name, u8 material_type, u8 drawtype,
"failed to generate
\"
"
<<
name
<<
"
\"
, "
"addShaderMaterial failed."
<<
std
::
endl
;
dumpShaderProgram
(
warningstream
,
"Vertex"
,
vertex_program
);
dumpShaderProgram
(
warningstream
,
"Pixel"
,
pixel_program
);
return
shaderinfo
;
}
}
...
...
@@ -871,3 +876,21 @@ void load_shaders(std::string name, SourceShaderCache *sourcecache,
}
}
void
dumpShaderProgram
(
std
::
ostream
&
output_stream
,
const
std
::
string
&
program_type
,
const
std
::
string
&
program
)
{
output_stream
<<
program_type
<<
" shader program:"
<<
std
::
endl
<<
"----------------------------------"
<<
std
::
endl
;
size_t
pos
=
0
;
size_t
prev
=
0
;
s16
line
=
1
;
while
((
pos
=
program
.
find
(
"
\n
"
,
prev
))
!=
std
::
string
::
npos
)
{
output_stream
<<
line
++
<<
": "
<<
program
.
substr
(
prev
,
pos
-
prev
)
<<
std
::
endl
;
prev
=
pos
+
1
;
}
output_stream
<<
line
<<
": "
<<
program
.
substr
(
prev
)
<<
std
::
endl
<<
"End of "
<<
program_type
<<
" shader program."
<<
std
::
endl
<<
" "
<<
std
::
endl
;
}
This diff is collapsed.
Click to expand it.
src/shader.h
+
3
−
0
View file @
f253ff9f
...
...
@@ -110,4 +110,7 @@ class IWritableShaderSource : public IShaderSource
IWritableShaderSource
*
createShaderSource
(
IrrlichtDevice
*
device
);
void
dumpShaderProgram
(
std
::
ostream
&
output_stream
,
const
std
::
string
&
program_type
,
const
std
::
string
&
program
);
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment