[Mesa-dev] [RFC PATCH 32/56] glsl: Make stand-alone compiler work with tessellation shaders.
Chris Forbes
chrisf at ijw.co.nz
Sat Sep 20 18:41:12 PDT 2014
From: Fabian Bieler <fabianbieler at fastmail.fm>
---
src/glsl/main.cpp | 8 +++++++-
src/glsl/standalone_scaffolding.cpp | 1 +
src/glsl/standalone_scaffolding.h | 4 ++++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index a4452e0..9043fa7 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -210,6 +210,8 @@ initialize_context(struct gl_context *ctx, gl_api api)
break;
}
+ ctx->Const.MaxPatchVertices = 32;
+
ctx->Driver.NewShader = _mesa_new_shader;
}
@@ -279,7 +281,7 @@ usage_fail(const char *name)
{
const char *header =
- "usage: %s [options] <file.vert | file.geom | file.frag>\n"
+ "usage: %s [options] <file.vert | file.tesc | file.tese | file.geom | file.frag | file.comp>\n"
"\n"
"Possible options are:\n";
printf(header, name, name);
@@ -374,6 +376,10 @@ main(int argc, char **argv)
const char *const ext = & argv[optind][len - 5];
if (strncmp(".vert", ext, 5) == 0 || strncmp(".glsl", ext, 5) == 0)
shader->Type = GL_VERTEX_SHADER;
+ else if (strncmp(".tesc", ext, 5) == 0)
+ shader->Type = GL_TESS_CONTROL_SHADER;
+ else if (strncmp(".tese", ext, 5) == 0)
+ shader->Type = GL_TESS_EVALUATION_SHADER;
else if (strncmp(".geom", ext, 5) == 0)
shader->Type = GL_GEOMETRY_SHADER;
else if (strncmp(".frag", ext, 5) == 0)
diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp
index 2b76dd1..d5d54ab 100644
--- a/src/glsl/standalone_scaffolding.cpp
+++ b/src/glsl/standalone_scaffolding.cpp
@@ -106,6 +106,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
ctx->Extensions.ARB_shader_texture_lod = true;
ctx->Extensions.ARB_shading_language_420pack = true;
ctx->Extensions.ARB_shading_language_packing = true;
+ ctx->Extensions.ARB_tessellation_shader = true;
ctx->Extensions.ARB_texture_cube_map_array = true;
ctx->Extensions.ARB_texture_gather = true;
ctx->Extensions.ARB_texture_multisample = true;
diff --git a/src/glsl/standalone_scaffolding.h b/src/glsl/standalone_scaffolding.h
index df783af..5934532 100644
--- a/src/glsl/standalone_scaffolding.h
+++ b/src/glsl/standalone_scaffolding.h
@@ -58,6 +58,10 @@ _mesa_shader_enum_to_shader_stage(GLenum v)
return MESA_SHADER_FRAGMENT;
case GL_GEOMETRY_SHADER:
return MESA_SHADER_GEOMETRY;
+ case GL_TESS_CONTROL_SHADER:
+ return MESA_SHADER_TESS_CTRL;
+ case GL_TESS_EVALUATION_SHADER:
+ return MESA_SHADER_TESS_EVAL;
case GL_COMPUTE_SHADER:
return MESA_SHADER_COMPUTE;
default:
--
2.1.0
More information about the mesa-dev
mailing list