mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 22:50:08 +01:00
crocus: add GL_CLAMP emulation in driver again.
I removed this because I thought the state tracker could handle it, and it really should handle it, but it has some minecraft side effects I'm unsure about. This fixes the problem for now, we can revisit it later. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11822>
This commit is contained in:
parent
ead3340262
commit
8dcd4e4849
4 changed files with 25 additions and 2 deletions
|
|
@ -150,6 +150,7 @@ crocus_populate_sampler_prog_key_data(struct crocus_context *ice,
|
|||
bool uses_texture_gather,
|
||||
struct brw_sampler_prog_key_data *key)
|
||||
{
|
||||
struct crocus_screen *screen = (struct crocus_screen *)ice->ctx.screen;
|
||||
uint32_t mask = ish->nir->info.textures_used[0];
|
||||
|
||||
while (mask) {
|
||||
|
|
@ -167,6 +168,8 @@ crocus_populate_sampler_prog_key_data(struct crocus_context *ice,
|
|||
key->swizzles[s] = crocus_get_texture_swizzle(ice, texture);
|
||||
}
|
||||
|
||||
screen->vtbl.fill_clamp_mask(ice->state.shaders[stage].samplers[s], s, key->gl_clamp_mask);
|
||||
|
||||
/* gather4 for RG32* is broken in multiple ways on Gen7. */
|
||||
if (devinfo->ver == 7 && uses_texture_gather) {
|
||||
switch (texture->base.format) {
|
||||
|
|
|
|||
|
|
@ -210,14 +210,13 @@ crocus_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED:
|
||||
case PIPE_CAP_FENCE_SIGNAL:
|
||||
case PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION:
|
||||
case PIPE_CAP_GL_CLAMP:
|
||||
return true;
|
||||
case PIPE_CAP_INT64:
|
||||
case PIPE_CAP_INT64_DIVMOD:
|
||||
case PIPE_CAP_TGSI_BALLOT:
|
||||
case PIPE_CAP_PACKED_UNIFORMS:
|
||||
return devinfo->ver == 8;
|
||||
case PIPE_CAP_GL_CLAMP:
|
||||
return false;
|
||||
case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
|
||||
return devinfo->ver <= 5;
|
||||
case PIPE_CAP_TEXTURE_QUERY_LOD:
|
||||
|
|
|
|||
|
|
@ -136,6 +136,9 @@ struct crocus_vtable {
|
|||
struct brw_wm_prog_key *key);
|
||||
void (*populate_cs_key)(const struct crocus_context *ice,
|
||||
struct brw_cs_prog_key *key);
|
||||
void (*fill_clamp_mask)(const struct crocus_sampler_state *state,
|
||||
int s,
|
||||
uint32_t *clamp_mask);
|
||||
void (*lost_genx_state)(struct crocus_context *ice, struct crocus_batch *batch);
|
||||
|
||||
void (*finish_batch)(struct crocus_batch *batch); /* haswell only */
|
||||
|
|
|
|||
|
|
@ -9079,6 +9079,23 @@ static void update_so_strides(struct crocus_context *ice,
|
|||
}
|
||||
#endif
|
||||
|
||||
static void crocus_fill_clamp_mask(const struct crocus_sampler_state *samp,
|
||||
int s,
|
||||
uint32_t *clamp_mask)
|
||||
{
|
||||
#if GFX_VER < 8
|
||||
if (samp->pstate.min_img_filter != PIPE_TEX_FILTER_NEAREST &&
|
||||
samp->pstate.mag_img_filter != PIPE_TEX_FILTER_NEAREST) {
|
||||
if (samp->pstate.wrap_s == PIPE_TEX_WRAP_CLAMP)
|
||||
clamp_mask[0] |= (1 << s);
|
||||
if (samp->pstate.wrap_t == PIPE_TEX_WRAP_CLAMP)
|
||||
clamp_mask[1] |= (1 << s);
|
||||
if (samp->pstate.wrap_r == PIPE_TEX_WRAP_CLAMP)
|
||||
clamp_mask[2] |= (1 << s);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
crocus_set_frontend_noop(struct pipe_context *ctx, bool enable)
|
||||
{
|
||||
|
|
@ -9145,6 +9162,7 @@ genX(crocus_init_screen_state)(struct crocus_screen *screen)
|
|||
screen->vtbl.upload_urb_fence = crocus_upload_urb_fence;
|
||||
screen->vtbl.calculate_urb_fence = crocus_calculate_urb_fence;
|
||||
#endif
|
||||
screen->vtbl.fill_clamp_mask = crocus_fill_clamp_mask;
|
||||
screen->vtbl.batch_reset_dirty = crocus_batch_reset_dirty;
|
||||
screen->vtbl.translate_prim_type = translate_prim_type;
|
||||
#if GFX_VER >= 6
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue