diff options
author | Eric Anholt <[email protected]> | 2015-03-23 17:26:40 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-03-24 10:39:12 -0700 |
commit | af3d7471943d54e692f2dd7448321a4f96e56ed2 (patch) | |
tree | 493052e8ab687b82cdf84ff638086b801e3c7ef9 /src/gallium/drivers/vc4/vc4_resource.c | |
parent | 9bafcf630ab009b3b39bbe3c0f4370386bc5a6b2 (diff) |
vc4: Make a new #define for making code conditional on the simulator.
I'd like to compile as much of the device-specific code as possible
when building for simulator, and using if (using_simulator) instead of
ifdefs helps.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_resource.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_resource.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c index b8efa0da1a8..0dda0d86a69 100644 --- a/src/gallium/drivers/vc4/vc4_resource.c +++ b/src/gallium/drivers/vc4/vc4_resource.c @@ -404,11 +404,11 @@ vc4_resource_from_handle(struct pipe_screen *pscreen, if (!rsc->bo) goto fail; -#ifdef USE_VC4_SIMULATOR - slice->stride = align(prsc->width0 * rsc->cpp, 16); -#else - slice->stride = handle->stride; -#endif + if (!using_vc4_simulator) + slice->stride = handle->stride; + else + slice->stride = align(prsc->width0 * rsc->cpp, 16); + slice->tiling = VC4_TILING_FORMAT_LINEAR; rsc->vc4_format = get_resource_texture_format(prsc); |