summaryrefslogtreecommitdiff
path: root/retrace
diff options
context:
space:
mode:
authorMark Janes <mark.a.janes@intel.com>2017-11-28 11:44:32 -0800
committerMark Janes <mark.a.janes@intel.com>2017-11-28 11:44:32 -0800
commit981fb3f9381daf21db920f2ead16107b3b3de4f6 (patch)
treef9ece4b75e4563b39b20b7a36bbe73a5072b9724 /retrace
parente62b5987eb8ace7c7a74d3e0badb0215a26f105e (diff)
State: Enable glDepthRangef
Diffstat (limited to 'retrace')
-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.cpp4
-rw-r--r--retrace/daemon/glframe_state_override.cpp23
4 files changed, 37 insertions, 0 deletions
diff --git a/retrace/daemon/gldispatch/glframe_glhelper.cpp b/retrace/daemon/gldispatch/glframe_glhelper.cpp
index bb419018..94474123 100644
--- a/retrace/daemon/gldispatch/glframe_glhelper.cpp
+++ b/retrace/daemon/gldispatch/glframe_glhelper.cpp
@@ -125,6 +125,7 @@ static void *pLineWidth = NULL;
static void *pColorMask = NULL;
static void *pClearDepthf = NULL;
static void *pDepthFunc = NULL;
+static void *pDepthRangef = NULL;
} // namespace
@@ -345,6 +346,8 @@ GlFunctions::Init(void *lookup_fn) {
assert(pClearDepthf);
pDepthFunc = _GetProcAddress("glDepthFunc");
assert(pDepthFunc);
+ pDepthRangef = _GetProcAddress("glDepthRangef");
+ assert(pDepthRangef);
}
GLuint
@@ -999,3 +1002,9 @@ GlFunctions::DepthFunc(GLenum func) {
typedef void (*DEPTHFUNC)(GLenum func);
return ((DEPTHFUNC)pDepthFunc)(func);
}
+
+void
+GlFunctions::DepthRangef(GLfloat n, GLfloat f) {
+ typedef void (*DEPTHRANGEF)(GLfloat n, GLfloat f);
+ return ((DEPTHRANGEF)pDepthRangef)(n, f);
+}
diff --git a/retrace/daemon/gldispatch/glframe_glhelper.hpp b/retrace/daemon/gldispatch/glframe_glhelper.hpp
index e5904610..23026dc5 100644
--- a/retrace/daemon/gldispatch/glframe_glhelper.hpp
+++ b/retrace/daemon/gldispatch/glframe_glhelper.hpp
@@ -181,6 +181,7 @@ class GlFunctions {
GLboolean blue, GLboolean alpha);
static void ClearDepthf(GLfloat d);
static void DepthFunc(GLenum func);
+ static void DepthRangef(GLfloat n, GLfloat f);
private:
GlFunctions();
diff --git a/retrace/daemon/glframe_state_enums.cpp b/retrace/daemon/glframe_state_enums.cpp
index 329291e0..32f0da5b 100644
--- a/retrace/daemon/glframe_state_enums.cpp
+++ b/retrace/daemon/glframe_state_enums.cpp
@@ -57,6 +57,7 @@ glretrace::state_name_to_enum(const std::string &value) {
{"GL_CULL_FACE_MODE", GL_CULL_FACE_MODE},
{"GL_DEPTH_CLEAR_VALUE", GL_DEPTH_CLEAR_VALUE},
{"GL_DEPTH_FUNC", GL_DEPTH_FUNC},
+ {"GL_DEPTH_RANGE", GL_DEPTH_RANGE},
{"GL_DST_ALPHA", GL_DST_ALPHA},
{"GL_DST_COLOR", GL_DST_COLOR},
{"GL_EQUAL", GL_EQUAL},
@@ -119,6 +120,7 @@ glretrace::state_enum_to_name(GLint value) {
{GL_CULL_FACE_MODE, "GL_CULL_FACE_MODE"},
{GL_DEPTH_CLEAR_VALUE, "GL_DEPTH_CLEAR_VALUE"},
{GL_DEPTH_FUNC, "GL_DEPTH_FUNC"},
+ {GL_DEPTH_RANGE, "GL_DEPTH_RANGE"},
{GL_DST_ALPHA, "GL_DST_ALPHA"},
{GL_DST_COLOR, "GL_DST_COLOR"},
{GL_EQUAL, "GL_EQUAL"},
@@ -215,6 +217,8 @@ glretrace::state_name_to_indices(const std::string &n) {
case GL_BLEND_COLOR:
case GL_COLOR_CLEAR_VALUE:
return {"Red", "Green", "Blue", "Alpha"};
+ case GL_DEPTH_RANGE:
+ return {"Near", "Far"};
default:
return {};
}
diff --git a/retrace/daemon/glframe_state_override.cpp b/retrace/daemon/glframe_state_override.cpp
index a4a807d4..d70203a3 100644
--- a/retrace/daemon/glframe_state_override.cpp
+++ b/retrace/daemon/glframe_state_override.cpp
@@ -111,6 +111,7 @@ StateOverride::interpret_value(const StateKey &item,
case GL_BLEND_COLOR:
case GL_COLOR_CLEAR_VALUE:
case GL_DEPTH_CLEAR_VALUE:
+ case GL_DEPTH_RANGE:
case GL_LINE_WIDTH: {
IntFloat i_f;
i_f.f = std::stof(value);
@@ -167,6 +168,11 @@ StateOverride::getState(const StateKey &item,
get_float_state(n, data);
break;
}
+ case GL_DEPTH_RANGE: {
+ data->resize(2);
+ get_float_state(n, data);
+ break;
+ }
}
}
@@ -332,6 +338,15 @@ StateOverride::enact_state(const KeyMap &m) const {
assert(GL::GetError() == GL_NO_ERROR);
break;
}
+ case GL_DEPTH_RANGE: {
+ assert(i.second.size() == 2);
+ IntFloat near, far;
+ near.i = i.second[0];
+ far.i = i.second[1];
+ GlFunctions::DepthRangef(near.f, far.f);
+ assert(GL::GetError() == GL_NO_ERROR);
+ break;
+ }
case GL_INVALID_ENUM:
default:
assert(false);
@@ -482,4 +497,12 @@ StateOverride::onState(SelectionId selId,
callback->onState(selId, experimentCount, renderId,
k, {state_enum_to_name(data[0])});
}
+ {
+ StateKey k("Depth State", "GL_DEPTH_RANGE");
+ getState(k, &data);
+ std::vector<std::string> range;
+ floatStrings(data, &range);
+ callback->onState(selId, experimentCount, renderId,
+ k, range);
+ }
}