summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2015-04-17 15:23:18 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2015-04-22 16:00:32 -0700
commita921475c22fe88fb6921a1f628d3ea05d55ba43b (patch)
tree79b6b0318bd83cca59fe8b17ca8026dd29208838 /src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
parentceb6e5eebe13b85f57cf5a7a22371c10170943a3 (diff)
downloadexternal_mesa3d-a921475c22fe88fb6921a1f628d3ea05d55ba43b.zip
external_mesa3d-a921475c22fe88fb6921a1f628d3ea05d55ba43b.tar.gz
external_mesa3d-a921475c22fe88fb6921a1f628d3ea05d55ba43b.tar.bz2
i965: Do better fake context setup in unit tests
In future tests, we will start relying on devinfo and not just brw in the compiler. Changing this now keeps these tests from failing in the future. Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp b/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
index ed8744d..206a76e 100644
--- a/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
@@ -31,6 +31,7 @@ class cmod_propagation_test : public ::testing::Test {
public:
struct brw_context *brw;
+ struct brw_device_info *devinfo;
struct gl_context *ctx;
struct brw_wm_prog_data *prog_data;
struct gl_shader_program *shader_prog;
@@ -51,6 +52,9 @@ public:
void cmod_propagation_test::SetUp()
{
brw = (struct brw_context *)calloc(1, sizeof(*brw));
+ devinfo = (struct brw_device_info *)calloc(1, sizeof(*brw));
+ brw->intelScreen = (struct intel_screen *)calloc(1, sizeof(*brw->intelScreen));
+ brw->intelScreen->devinfo = devinfo;
ctx = &brw->ctx;
fp = ralloc(NULL, struct brw_fragment_program);
@@ -61,7 +65,7 @@ void cmod_propagation_test::SetUp()
_mesa_init_fragment_program(ctx, &fp->program, GL_FRAGMENT_SHADER, 0);
- brw->gen = 4;
+ brw->gen = devinfo->gen = 4;
}
static fs_inst *