summaryrefslogtreecommitdiff
path: root/retrace/daemon
diff options
context:
space:
mode:
authorMark Janes <mark.a.janes@intel.com>2017-11-28 14:21:31 -0800
committerMark Janes <mark.a.janes@intel.com>2017-11-28 14:21:31 -0800
commit79dfff5a7b7e8d54ae8c1af6688c18a12f123ace (patch)
tree82fc9d2eb88af710416f65ac2916602a8505e425 /retrace/daemon
parentd9f6437c2bac1e4b0c501b351ab0b66fdf6c7c70 (diff)
State: Enable glFrontFace
Diffstat (limited to 'retrace/daemon')
-rw-r--r--retrace/daemon/gldispatch/glframe_glhelper.cpp9
-rw-r--r--retrace/daemon/gldispatch/glframe_glhelper.hpp1
-rw-r--r--retrace/daemon/glframe_state_enums.cpp8
-rw-r--r--retrace/daemon/glframe_state_override.cpp15
4 files changed, 32 insertions, 1 deletions
diff --git a/retrace/daemon/gldispatch/glframe_glhelper.cpp b/retrace/daemon/gldispatch/glframe_glhelper.cpp
index 9f90b707..540a1a98 100644
--- a/retrace/daemon/gldispatch/glframe_glhelper.cpp
+++ b/retrace/daemon/gldispatch/glframe_glhelper.cpp
@@ -127,6 +127,7 @@ static void *pClearDepthf = NULL;
static void *pDepthFunc = NULL;
static void *pDepthRangef = NULL;
static void *pDepthMask = NULL;
+static void *pFrontFace = NULL;
} // namespace
@@ -351,6 +352,8 @@ GlFunctions::Init(void *lookup_fn) {
assert(pDepthRangef);
pDepthMask = _GetProcAddress("glDepthMask");
assert(pDepthMask);
+ pFrontFace = _GetProcAddress("glFrontFace");
+ assert(pFrontFace);
}
GLuint
@@ -1017,3 +1020,9 @@ GlFunctions::DepthMask(GLboolean flag) {
typedef void (*DEPTHMASK)(GLboolean flag);
return ((DEPTHMASK)pDepthMask)(flag);
}
+
+void
+GlFunctions::FrontFace(GLenum mode) {
+ typedef void (*FRONTFACE)(GLenum mode);
+ return ((FRONTFACE)pFrontFace)(mode);
+}
diff --git a/retrace/daemon/gldispatch/glframe_glhelper.hpp b/retrace/daemon/gldispatch/glframe_glhelper.hpp
index 91901293..4d443e5d 100644
--- a/retrace/daemon/gldispatch/glframe_glhelper.hpp
+++ b/retrace/daemon/gldispatch/glframe_glhelper.hpp
@@ -183,6 +183,7 @@ class GlFunctions {
static void DepthFunc(GLenum func);
static void DepthRangef(GLfloat n, GLfloat f);
static void DepthMask(GLboolean flag);
+ static void FrontFace(GLenum mode);
private:
GlFunctions();
diff --git a/retrace/daemon/glframe_state_enums.cpp b/retrace/daemon/glframe_state_enums.cpp
index 7388bcd8..baaa31c4 100644
--- a/retrace/daemon/glframe_state_enums.cpp
+++ b/retrace/daemon/glframe_state_enums.cpp
@@ -49,6 +49,8 @@ glretrace::state_name_to_enum(const std::string &value) {
{"GL_BLEND_SRC", GL_BLEND_SRC},
{"GL_BLEND_SRC_ALPHA", GL_BLEND_SRC_ALPHA},
{"GL_BLEND_SRC_RGB", GL_BLEND_SRC_RGB},
+ {"GL_CCW", GL_CCW},
+ {"GL_CW", GL_CW},
{"GL_COLOR_CLEAR_VALUE", GL_COLOR_CLEAR_VALUE},
{"GL_COLOR_WRITEMASK", GL_COLOR_WRITEMASK},
{"GL_CONSTANT_ALPHA", GL_CONSTANT_ALPHA},
@@ -65,6 +67,7 @@ glretrace::state_name_to_enum(const std::string &value) {
{"GL_DST_COLOR", GL_DST_COLOR},
{"GL_EQUAL", GL_EQUAL},
{"GL_FRONT", GL_FRONT},
+ {"GL_FRONT_FACE", GL_FRONT_FACE},
{"GL_FRONT_AND_BACK", GL_FRONT_AND_BACK},
{"GL_FUNC_ADD", GL_FUNC_ADD},
{"GL_FUNC_REVERSE_SUBTRACT", GL_FUNC_REVERSE_SUBTRACT},
@@ -115,6 +118,8 @@ glretrace::state_enum_to_name(GLint value) {
{GL_BLEND_SRC, "GL_BLEND_SRC"},
{GL_BLEND_SRC_ALPHA, "GL_BLEND_SRC_ALPHA"},
{GL_BLEND_SRC_RGB, "GL_BLEND_SRC_RGB"},
+ {GL_CCW, "GL_CCW"},
+ {GL_CW, "GL_CW"},
{GL_COLOR_CLEAR_VALUE, "GL_COLOR_CLEAR_VALUE"},
{GL_COLOR_WRITEMASK, "GL_COLOR_WRITEMASK"},
{GL_CONSTANT_ALPHA, "GL_CONSTANT_ALPHA"},
@@ -131,6 +136,7 @@ glretrace::state_enum_to_name(GLint value) {
{GL_DST_COLOR, "GL_DST_COLOR"},
{GL_EQUAL, "GL_EQUAL"},
{GL_FRONT, "GL_FRONT"},
+ {GL_FRONT_FACE, "GL_FRONT_FACE"},
{GL_FRONT_AND_BACK, "GL_FRONT_AND_BACK"},
{GL_FUNC_ADD, "GL_FUNC_ADD"},
{GL_FUNC_REVERSE_SUBTRACT, "GL_FUNC_REVERSE_SUBTRACT"},
@@ -211,6 +217,8 @@ glretrace::state_name_to_choices(const std::string &n) {
case GL_DEPTH_FUNC:
return {"GL_NEVER", "GL_LESS", "GL_EQUAL", "GL_LEQUAL",
"GL_GREATER", "GL_NOTEQUAL", "GL_GEQUAL", "GL_ALWAYS"};
+ case GL_FRONT_FACE:
+ return {"GL_CW", "GL_CCW"};
case GL_INVALID_ENUM:
assert(false);
default:
diff --git a/retrace/daemon/glframe_state_override.cpp b/retrace/daemon/glframe_state_override.cpp
index 0fbe44e2..e45cb48e 100644
--- a/retrace/daemon/glframe_state_override.cpp
+++ b/retrace/daemon/glframe_state_override.cpp
@@ -108,6 +108,7 @@ StateOverride::interpret_value(const StateKey &item,
case GL_DEPTH_TEST:
case GL_DEPTH_WRITEMASK:
case GL_DITHER:
+ case GL_FRONT_FACE:
return state_name_to_enum(value);
// float values
@@ -152,7 +153,8 @@ StateOverride::getState(const StateKey &item,
case GL_BLEND_SRC_ALPHA:
case GL_BLEND_SRC_RGB:
case GL_CULL_FACE_MODE:
- case GL_DEPTH_FUNC: {
+ case GL_DEPTH_FUNC:
+ case GL_FRONT_FACE: {
data->resize(1);
get_integer_state(n, data);
break;
@@ -360,6 +362,11 @@ StateOverride::enact_state(const KeyMap &m) const {
assert(GL::GetError() == GL_NO_ERROR);
break;
}
+ case GL_FRONT_FACE: {
+ GlFunctions::FrontFace(i.second[0]);
+ assert(GL::GetError() == GL_NO_ERROR);
+ break;
+ }
case GL_INVALID_ENUM:
default:
assert(false);
@@ -536,4 +543,10 @@ StateOverride::onState(SelectionId selId,
callback->onState(selId, experimentCount, renderId, k,
{data[0] ? "true" : "false"});
}
+ {
+ StateKey k("Primitive", "GL_FRONT_FACE");
+ getState(k, &data);
+ callback->onState(selId, experimentCount, renderId,
+ k, {state_enum_to_name(data[0])});
+ }
}