summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Janes <mark.a.janes@intel.com>2017-11-28 12:00:03 -0800
committerMark Janes <mark.a.janes@intel.com>2017-11-28 12:00:03 -0800
commit8e3321af68d7ac21a3a6b4da3be9ce78a7496636 (patch)
treeaf4489f8c1be47c481c05b7b4b4c3285fada17a0
parent796acaa477fa2014e3772c7477149ae173e8dec5 (diff)
State: Enable glDepthMask
-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.cpp5
-rw-r--r--retrace/daemon/glframe_state_override.cpp15
4 files changed, 29 insertions, 1 deletions
diff --git a/retrace/daemon/gldispatch/glframe_glhelper.cpp b/retrace/daemon/gldispatch/glframe_glhelper.cpp
index 94474123..9f90b707 100644
--- a/retrace/daemon/gldispatch/glframe_glhelper.cpp
+++ b/retrace/daemon/gldispatch/glframe_glhelper.cpp
@@ -126,6 +126,7 @@ static void *pColorMask = NULL;
static void *pClearDepthf = NULL;
static void *pDepthFunc = NULL;
static void *pDepthRangef = NULL;
+static void *pDepthMask = NULL;
} // namespace
@@ -348,6 +349,8 @@ GlFunctions::Init(void *lookup_fn) {
assert(pDepthFunc);
pDepthRangef = _GetProcAddress("glDepthRangef");
assert(pDepthRangef);
+ pDepthMask = _GetProcAddress("glDepthMask");
+ assert(pDepthMask);
}
GLuint
@@ -1008,3 +1011,9 @@ GlFunctions::DepthRangef(GLfloat n, GLfloat f) {
typedef void (*DEPTHRANGEF)(GLfloat n, GLfloat f);
return ((DEPTHRANGEF)pDepthRangef)(n, f);
}
+
+void
+GlFunctions::DepthMask(GLboolean flag) {
+ typedef void (*DEPTHMASK)(GLboolean flag);
+ return ((DEPTHMASK)pDepthMask)(flag);
+}
diff --git a/retrace/daemon/gldispatch/glframe_glhelper.hpp b/retrace/daemon/gldispatch/glframe_glhelper.hpp
index 23026dc5..91901293 100644
--- a/retrace/daemon/gldispatch/glframe_glhelper.hpp
+++ b/retrace/daemon/gldispatch/glframe_glhelper.hpp
@@ -182,6 +182,7 @@ class GlFunctions {
static void ClearDepthf(GLfloat d);
static void DepthFunc(GLenum func);
static void DepthRangef(GLfloat n, GLfloat f);
+ static void DepthMask(GLboolean flag);
private:
GlFunctions();
diff --git a/retrace/daemon/glframe_state_enums.cpp b/retrace/daemon/glframe_state_enums.cpp
index 3333270f..9b4b57c6 100644
--- a/retrace/daemon/glframe_state_enums.cpp
+++ b/retrace/daemon/glframe_state_enums.cpp
@@ -59,6 +59,7 @@ glretrace::state_name_to_enum(const std::string &value) {
{"GL_DEPTH_FUNC", GL_DEPTH_FUNC},
{"GL_DEPTH_RANGE", GL_DEPTH_RANGE},
{"GL_DEPTH_TEST", GL_DEPTH_TEST},
+ {"GL_DEPTH_WRITEMASK", GL_DEPTH_WRITEMASK},
{"GL_DST_ALPHA", GL_DST_ALPHA},
{"GL_DST_COLOR", GL_DST_COLOR},
{"GL_EQUAL", GL_EQUAL},
@@ -123,6 +124,7 @@ glretrace::state_enum_to_name(GLint value) {
{GL_DEPTH_FUNC, "GL_DEPTH_FUNC"},
{GL_DEPTH_RANGE, "GL_DEPTH_RANGE"},
{GL_DEPTH_TEST, "GL_DEPTH_TEST"},
+ {GL_DEPTH_WRITEMASK, "GL_DEPTH_WRITEMASK"},
{GL_DST_ALPHA, "GL_DST_ALPHA"},
{GL_DST_COLOR, "GL_DST_COLOR"},
{GL_EQUAL, "GL_EQUAL"},
@@ -168,6 +170,7 @@ glretrace::state_name_to_choices(const std::string &n) {
case GL_COLOR_WRITEMASK:
case GL_CULL_FACE:
case GL_DEPTH_TEST:
+ case GL_DEPTH_WRITEMASK:
case GL_LINE_SMOOTH:
return {"true", "false"};
case GL_BLEND_DST:
@@ -222,6 +225,8 @@ glretrace::state_name_to_indices(const std::string &n) {
return {"Red", "Green", "Blue", "Alpha"};
case GL_DEPTH_RANGE:
return {"Near", "Far"};
+ case GL_DEPTH_WRITEMASK:
+ return {"Enabled"};
default:
return {};
}
diff --git a/retrace/daemon/glframe_state_override.cpp b/retrace/daemon/glframe_state_override.cpp
index 55fc5658..cf5d4289 100644
--- a/retrace/daemon/glframe_state_override.cpp
+++ b/retrace/daemon/glframe_state_override.cpp
@@ -106,6 +106,7 @@ StateOverride::interpret_value(const StateKey &item,
case GL_LINE_SMOOTH:
case GL_DEPTH_FUNC:
case GL_DEPTH_TEST:
+ case GL_DEPTH_WRITEMASK:
return state_name_to_enum(value);
// float values
@@ -154,7 +155,8 @@ StateOverride::getState(const StateKey &item,
get_integer_state(n, data);
break;
}
- case GL_COLOR_WRITEMASK: {
+ case GL_COLOR_WRITEMASK:
+ case GL_DEPTH_WRITEMASK: {
data->resize(4);
get_bool_state(n, data);
break;
@@ -350,6 +352,11 @@ StateOverride::enact_state(const KeyMap &m) const {
assert(GL::GetError() == GL_NO_ERROR);
break;
}
+ case GL_DEPTH_WRITEMASK: {
+ GlFunctions::DepthMask(i.second[0]);
+ assert(GL::GetError() == GL_NO_ERROR);
+ break;
+ }
case GL_INVALID_ENUM:
default:
assert(false);
@@ -514,4 +521,10 @@ StateOverride::onState(SelectionId selId,
callback->onState(selId, experimentCount, renderId,
k, {data[0] ? "true" : "false"});
}
+ {
+ StateKey k("Depth State", "GL_DEPTH_WRITEMASK");
+ getState(k, &data);
+ callback->onState(selId, experimentCount, renderId, k,
+ {data[0] ? "true" : "false"});
+ }
}