st/xorg: create basic fragment shader
This commit is contained in:
parent
490f640cd5
commit
b324aacf13
|
@ -64,21 +64,9 @@ create_vs(struct pipe_context *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
create_fs(struct pipe_context *ctx,
|
create_fs(struct pipe_context *pipe,
|
||||||
unsigned vs_traits)
|
unsigned fs_traits)
|
||||||
{
|
{
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct xorg_shader
|
|
||||||
xorg_shader_construct(struct exa_context *exa,
|
|
||||||
int op,
|
|
||||||
PicturePtr src_picture,
|
|
||||||
PicturePtr mask_picture,
|
|
||||||
PicturePtr dst_picture)
|
|
||||||
{
|
|
||||||
struct xorg_shader shader = {0};
|
|
||||||
#if 0
|
|
||||||
struct ureg_program *ureg;
|
struct ureg_program *ureg;
|
||||||
struct ureg_src dst_sampler, src_sampler, mask_sampler;
|
struct ureg_src dst_sampler, src_sampler, mask_sampler;
|
||||||
struct ureg_src dst_pos, src_pos, mask_pos;
|
struct ureg_src dst_pos, src_pos, mask_pos;
|
||||||
|
@ -86,10 +74,7 @@ xorg_shader_construct(struct exa_context *exa,
|
||||||
|
|
||||||
ureg = ureg_create(TGSI_PROCESSOR_FRAGMENT);
|
ureg = ureg_create(TGSI_PROCESSOR_FRAGMENT);
|
||||||
if (ureg == NULL)
|
if (ureg == NULL)
|
||||||
return shader;
|
return 0;
|
||||||
|
|
||||||
if (sid.is_fill)
|
|
||||||
return shader;
|
|
||||||
|
|
||||||
#if 0 /* unused right now */
|
#if 0 /* unused right now */
|
||||||
dst_sampler = ureg_DECL_sampler(ureg);
|
dst_sampler = ureg_DECL_sampler(ureg);
|
||||||
|
@ -105,18 +90,18 @@ xorg_shader_construct(struct exa_context *exa,
|
||||||
1,
|
1,
|
||||||
TGSI_INTERPOLATE_PERSPECTIVE);
|
TGSI_INTERPOLATE_PERSPECTIVE);
|
||||||
|
|
||||||
if (sid.mask) {
|
if ((fs_traits & FS_MASK)) {
|
||||||
mask_sampler = ureg_DECL_sampler(ureg);
|
mask_sampler = ureg_DECL_sampler(ureg);
|
||||||
src_pos = ureg_DECL_fs_input(ureg,
|
mask_pos = ureg_DECL_fs_input(ureg,
|
||||||
TGSI_SEMANTIC_POSITION,
|
TGSI_SEMANTIC_POSITION,
|
||||||
2,
|
2,
|
||||||
TGSI_INTERPOLATE_PERSPECTIVE);
|
TGSI_INTERPOLATE_PERSPECTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ureg_TEX(ureg, ureg_dst(src),
|
ureg_TEX(ureg, ureg_dst(src),
|
||||||
TGSI_TEXTURE_2D, src_pos, src_sampler);
|
TGSI_TEXTURE_2D, src_pos, src_sampler);
|
||||||
|
|
||||||
if (sid.mask) {
|
if ((fs_traits & FS_MASK)) {
|
||||||
ureg_TEX(ureg, ureg_dst(mask),
|
ureg_TEX(ureg, ureg_dst(mask),
|
||||||
TGSI_TEXTURE_2D, mask_pos, mask_sampler);
|
TGSI_TEXTURE_2D, mask_pos, mask_sampler);
|
||||||
/* src IN mask */
|
/* src IN mask */
|
||||||
|
@ -125,8 +110,7 @@ xorg_shader_construct(struct exa_context *exa,
|
||||||
|
|
||||||
ureg_END(ureg);
|
ureg_END(ureg);
|
||||||
|
|
||||||
#endif
|
return ureg_create_shader_and_destroy(ureg, pipe);
|
||||||
return shader;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xorg_shaders * xorg_shaders_create(struct exa_context *exa)
|
struct xorg_shaders * xorg_shaders_create(struct exa_context *exa)
|
||||||
|
|
Loading…
Reference in New Issue