diff options
author | Kenneth Graunke <[email protected]> | 2019-02-28 01:13:33 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-03-07 11:39:27 -0800 |
commit | 4787bc944a2d219dd04201eef699d9f999b479b8 (patch) | |
tree | 082f124a94a40b269150e8b2e5c42ef91f393d41 /src/intel/isl | |
parent | 575f8e8b60ab06e559a62ffe90913453352f32b4 (diff) |
isl: Add a swizzle parameter to isl_buffer_fill_state()
This is necessary for legacy texture buffer object formats, where we'll
need to use a swizzle to fake e.g. luminance.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/isl')
-rw-r--r-- | src/intel/isl/isl.h | 5 | ||||
-rw-r--r-- | src/intel/isl/isl_surface_state.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h index cfac922a3d2..a792e18e5d1 100644 --- a/src/intel/isl/isl.h +++ b/src/intel/isl/isl.h @@ -1361,6 +1361,11 @@ struct isl_buffer_fill_state_info { */ enum isl_format format; + /** + * The swizzle to use in the surface state + */ + struct isl_swizzle swizzle; + uint32_t stride_B; }; diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c index 7ab260d701b..cf31b36ccbe 100644 --- a/src/intel/isl/isl_surface_state.c +++ b/src/intel/isl/isl_surface_state.c @@ -745,10 +745,10 @@ isl_genX(buffer_fill_state_s)(void *state, #endif #if (GEN_GEN >= 8 || GEN_IS_HASWELL) - s.ShaderChannelSelectRed = SCS_RED; - s.ShaderChannelSelectGreen = SCS_GREEN; - s.ShaderChannelSelectBlue = SCS_BLUE; - s.ShaderChannelSelectAlpha = SCS_ALPHA; + s.ShaderChannelSelectRed = (enum GENX(ShaderChannelSelect)) info->swizzle.r; + s.ShaderChannelSelectGreen = (enum GENX(ShaderChannelSelect)) info->swizzle.g; + s.ShaderChannelSelectBlue = (enum GENX(ShaderChannelSelect)) info->swizzle.b; + s.ShaderChannelSelectAlpha = (enum GENX(ShaderChannelSelect)) info->swizzle.a; #endif GENX(RENDER_SURFACE_STATE_pack)(NULL, state, &s); |