radeonsi: Properly translate vertex format swizzle.
egltri_screen works correctly!
This commit is contained in:

committed by
Michel Dänzer

parent
03d9c24c04
commit
c2f1fbf912
@@ -1166,24 +1166,6 @@ static void si_delete_sampler_state(struct pipe_context *ctx,
|
|||||||
free(state);
|
free(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned si_map_swizzle(unsigned swizzle)
|
|
||||||
{
|
|
||||||
switch (swizzle) {
|
|
||||||
case UTIL_FORMAT_SWIZZLE_Y:
|
|
||||||
return V_008F1C_SQ_SEL_Y;
|
|
||||||
case UTIL_FORMAT_SWIZZLE_Z:
|
|
||||||
return V_008F1C_SQ_SEL_Z;
|
|
||||||
case UTIL_FORMAT_SWIZZLE_W:
|
|
||||||
return V_008F1C_SQ_SEL_W;
|
|
||||||
case UTIL_FORMAT_SWIZZLE_0:
|
|
||||||
return V_008F1C_SQ_SEL_0;
|
|
||||||
case UTIL_FORMAT_SWIZZLE_1:
|
|
||||||
return V_008F1C_SQ_SEL_1;
|
|
||||||
default: /* UTIL_FORMAT_SWIZZLE_X */
|
|
||||||
return V_008F1C_SQ_SEL_X;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_context *ctx,
|
static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_context *ctx,
|
||||||
struct pipe_resource *texture,
|
struct pipe_resource *texture,
|
||||||
const struct pipe_sampler_view *state)
|
const struct pipe_sampler_view *state)
|
||||||
|
@@ -630,11 +630,10 @@ static void r600_vertex_buffer_update(struct r600_context *rctx)
|
|||||||
vertex_buffer->stride);
|
vertex_buffer->stride);
|
||||||
else
|
else
|
||||||
ptr[2] = vertex_buffer->buffer->width0 - offset;
|
ptr[2] = vertex_buffer->buffer->width0 - offset;
|
||||||
/* XXX: Hardcoding RGBA */
|
ptr[3] = (S_008F0C_DST_SEL_X(si_map_swizzle(desc->swizzle[0])) |
|
||||||
ptr[3] = (S_008F0C_DST_SEL_X(V_008F0C_SQ_SEL_X) |
|
S_008F0C_DST_SEL_Y(si_map_swizzle(desc->swizzle[1])) |
|
||||||
S_008F0C_DST_SEL_Y(V_008F0C_SQ_SEL_Y) |
|
S_008F0C_DST_SEL_Z(si_map_swizzle(desc->swizzle[2])) |
|
||||||
S_008F0C_DST_SEL_Z(V_008F0C_SQ_SEL_Z) |
|
S_008F0C_DST_SEL_W(si_map_swizzle(desc->swizzle[3])) |
|
||||||
S_008F0C_DST_SEL_W(V_008F0C_SQ_SEL_W) |
|
|
||||||
S_008F0C_NUM_FORMAT(num_format) |
|
S_008F0C_NUM_FORMAT(num_format) |
|
||||||
S_008F0C_DATA_FORMAT(data_format));
|
S_008F0C_DATA_FORMAT(data_format));
|
||||||
|
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#include "r600.h"
|
#include "r600.h"
|
||||||
#include "radeonsi_public.h"
|
#include "radeonsi_public.h"
|
||||||
#include "r600_resource.h"
|
#include "r600_resource.h"
|
||||||
|
#include "sid.h"
|
||||||
|
|
||||||
#define R600_MAX_CONST_BUFFERS 1
|
#define R600_MAX_CONST_BUFFERS 1
|
||||||
#define R600_MAX_CONST_BUFFER_SIZE 4096
|
#define R600_MAX_CONST_BUFFER_SIZE 4096
|
||||||
@@ -467,6 +468,24 @@ static INLINE uint32_t S_FIXED(float value, uint32_t frac_bits)
|
|||||||
}
|
}
|
||||||
#define ALIGN_DIVUP(x, y) (((x) + (y) - 1) / (y))
|
#define ALIGN_DIVUP(x, y) (((x) + (y) - 1) / (y))
|
||||||
|
|
||||||
|
static INLINE unsigned si_map_swizzle(unsigned swizzle)
|
||||||
|
{
|
||||||
|
switch (swizzle) {
|
||||||
|
case UTIL_FORMAT_SWIZZLE_Y:
|
||||||
|
return V_008F0C_SQ_SEL_Y;
|
||||||
|
case UTIL_FORMAT_SWIZZLE_Z:
|
||||||
|
return V_008F0C_SQ_SEL_Z;
|
||||||
|
case UTIL_FORMAT_SWIZZLE_W:
|
||||||
|
return V_008F0C_SQ_SEL_W;
|
||||||
|
case UTIL_FORMAT_SWIZZLE_0:
|
||||||
|
return V_008F0C_SQ_SEL_0;
|
||||||
|
case UTIL_FORMAT_SWIZZLE_1:
|
||||||
|
return V_008F0C_SQ_SEL_1;
|
||||||
|
default: /* UTIL_FORMAT_SWIZZLE_X */
|
||||||
|
return V_008F0C_SQ_SEL_X;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline unsigned r600_tex_aniso_filter(unsigned filter)
|
static inline unsigned r600_tex_aniso_filter(unsigned filter)
|
||||||
{
|
{
|
||||||
if (filter <= 1) return 0;
|
if (filter <= 1) return 0;
|
||||||
|
Reference in New Issue
Block a user