aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/blorp/blorp_clear.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-10-21 11:30:05 -0700
committerJason Ekstrand <[email protected]>2016-11-16 10:11:29 -0800
commit99b436ae5cfa410c6daad89f78acbe5ec88b9426 (patch)
treee9c9800cf1fd204b82aaefc1936849f522bc44cd /src/intel/blorp/blorp_clear.c
parent1acebeb1910b5fb29195acf132bbb88ebeebfb8b (diff)
intel/blorp: Add a shader type to make keys more unique
Depending on how the driver using blorp implements its shader caching, there is a small chance of shader collisions due to identical keys between blit and clear programs. Adding a small shader type at the top of the key alleviates this problem. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/blorp/blorp_clear.c')
-rw-r--r--src/intel/blorp/blorp_clear.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c
index c59040e0313..2b8af18019d 100644
--- a/src/intel/blorp/blorp_clear.c
+++ b/src/intel/blorp/blorp_clear.c
@@ -35,6 +35,7 @@
struct brw_blorp_const_color_prog_key
{
+ enum blorp_shader_type shader_type; /* Must be BLORP_SHADER_TYPE_CLEAR */
bool use_simd16_replicated_data;
bool pad[3];
};
@@ -44,9 +45,10 @@ blorp_params_get_clear_kernel(struct blorp_context *blorp,
struct blorp_params *params,
bool use_replicated_data)
{
- struct brw_blorp_const_color_prog_key blorp_key;
- memset(&blorp_key, 0, sizeof(blorp_key));
- blorp_key.use_simd16_replicated_data = use_replicated_data;
+ const struct brw_blorp_const_color_prog_key blorp_key = {
+ .shader_type = BLORP_SHADER_TYPE_CLEAR,
+ .use_simd16_replicated_data = use_replicated_data,
+ };
if (blorp->lookup_shader(blorp, &blorp_key, sizeof(blorp_key),
&params->wm_prog_kernel, &params->wm_prog_data))