@ -3304,10 +3304,12 @@ static inline void vrend_fill_shader_key(struct vrend_sub_context *sub_ctx,
bool add_alpha_test = true ;
bool add_alpha_test = true ;
// Only use integer info when drawing to avoid stale info.
// Only use integer info when drawing to avoid stale info.
if ( vrend_state . use_integer & & sub_ctx - > drawing ) {
if ( vrend_state . use_integer & & sub_ctx - > drawing & &
key - > attrib_signed_int_bitmask = sub_ctx - > ve - > signed_int_bitmask ;
type = = PIPE_SHADER_VERTEX ) {
key - > attrib_unsigned_int_bitmask = sub_ctx - > ve - > unsigned_int_bitmask ;
key - > vs . attrib_signed_int_bitmask = sub_ctx - > ve - > signed_int_bitmask ;
key - > vs . attrib_unsigned_int_bitmask = sub_ctx - > ve - > unsigned_int_bitmask ;
}
}
if ( type = = PIPE_SHADER_FRAGMENT ) {
for ( i = 0 ; i < sub_ctx - > nr_cbufs ; i + + ) {
for ( i = 0 ; i < sub_ctx - > nr_cbufs ; i + + ) {
if ( ! sub_ctx - > surf [ i ] )
if ( ! sub_ctx - > surf [ i ] )
continue ;
continue ;
@ -3319,12 +3321,13 @@ static inline void vrend_fill_shader_key(struct vrend_sub_context *sub_ctx,
key - > fs . cbufs_signed_int_bitmask ,
key - > fs . cbufs_signed_int_bitmask ,
key - > fs . cbufs_unsigned_int_bitmask ) ;
key - > fs . cbufs_unsigned_int_bitmask ) ;
}
}
key - > surface_component_bits [ i ] = util_format_get_component_bits ( sub_ctx - > surf [ i ] - > format , UTIL_FORMAT_COLORSPACE_RGB , 0 ) ;
key - > fs . surface_component_bits [ i ] = util_format_get_component_bits ( sub_ctx - > surf [ i ] - > format , UTIL_FORMAT_COLORSPACE_RGB , 0 ) ;
}
}
if ( add_alpha_test ) {
if ( add_alpha_test ) {
key - > add_alpha_test = sub_ctx - > dsa_state . alpha . enabled ;
key - > add_alpha_test = sub_ctx - > dsa_state . alpha . enabled ;
key - > alpha_test = sub_ctx - > dsa_state . alpha . func ;
key - > alpha_test = sub_ctx - > dsa_state . alpha . func ;
}
}
}
key - > pstipple_tex = sub_ctx - > rs_state . poly_stipple_enable ;
key - > pstipple_tex = sub_ctx - > rs_state . poly_stipple_enable ;
key - > color_two_side = sub_ctx - > rs_state . light_twoside ;
key - > color_two_side = sub_ctx - > rs_state . light_twoside ;
@ -3333,8 +3336,6 @@ static inline void vrend_fill_shader_key(struct vrend_sub_context *sub_ctx,
key - > flatshade = sub_ctx - > rs_state . flatshade ? true : false ;
key - > flatshade = sub_ctx - > rs_state . flatshade ? true : false ;
}
}
key - > fs . invert_origin = ! sub_ctx - > inverted_fbo_content ;
key - > gs_present = ! ! sub_ctx - > shaders [ PIPE_SHADER_GEOMETRY ] ;
key - > gs_present = ! ! sub_ctx - > shaders [ PIPE_SHADER_GEOMETRY ] ;
key - > tcs_present = ! ! sub_ctx - > shaders [ PIPE_SHADER_TESS_CTRL ] ;
key - > tcs_present = ! ! sub_ctx - > shaders [ PIPE_SHADER_TESS_CTRL ] ;
key - > tes_present = ! ! sub_ctx - > shaders [ PIPE_SHADER_TESS_EVAL ] ;
key - > tes_present = ! ! sub_ctx - > shaders [ PIPE_SHADER_TESS_EVAL ] ;
@ -3379,6 +3380,7 @@ static inline void vrend_fill_shader_key(struct vrend_sub_context *sub_ctx,
int next_type = - 1 ;
int next_type = - 1 ;
if ( type = = PIPE_SHADER_FRAGMENT ) {
if ( type = = PIPE_SHADER_FRAGMENT ) {
key - > fs . invert_origin = ! sub_ctx - > inverted_fbo_content ;
key - > fs . swizzle_output_rgb_to_bgr = sub_ctx - > swizzle_output_rgb_to_bgr ;
key - > fs . swizzle_output_rgb_to_bgr = sub_ctx - > swizzle_output_rgb_to_bgr ;
if ( vrend_state . use_gles & & can_emulate_logicop ( sub_ctx - > blend_state . logicop_func ) ) {
if ( vrend_state . use_gles & & can_emulate_logicop ( sub_ctx - > blend_state . logicop_func ) ) {
key - > fs . logicop_enabled = sub_ctx - > blend_state . logicop_enable ;
key - > fs . logicop_enabled = sub_ctx - > blend_state . logicop_enable ;