Commit Graph

35681 Commits

Author SHA1 Message Date
José Fonseca
2aa3203660 svga: Silence debug printf. 2010-12-01 12:23:12 +00:00
Chia-I Wu
0dadc0b808 st/vega: Avoid unnecessary constant bufer upload.
Remember the last uploaded data and avoid re-uploading.
2010-12-01 18:36:27 +08:00
Chia-I Wu
d7a6901cac st/vega: Initialize pipe states with renderer.
Initialize vertex elements, rasterizer, stencil ref, and vertex shader
with renderer_create.  Remove RASTERIZER_DIRTY and VS_DIRTY flags.
2010-12-01 18:07:00 +08:00
Chia-I Wu
c91c386012 st/vega: Create drawing surface mask as needed.
As the blend texture, a drawing surface mask is used when masking is
enabled.  It should be created as needed.

s/alpha_mask/surface_mask/ to follow OpenVG 1.1 naming.
2010-12-01 18:03:06 +08:00
Chia-I Wu
04f342b417 st/vega: Delay blend texture creation until needed.
It is used for more advanced blending or mask update.  It might not be
ever needed for some applications.
2010-12-01 17:46:34 +08:00
Chia-I Wu
f8e0dd246b st/vega: Remove st_inlines.h.
Per b0427bedde.
2010-12-01 17:00:22 +08:00
Chia-I Wu
2bb788ccc6 st/vega: Simplify radial gradient.
Eight less instructions with comments.
2010-12-01 16:46:01 +08:00
Chia-I Wu
d7aa03b4fe st/vega: Fix degenerate paints.
Fix the case that the two points of a linear gradient coincide, or the
case that the radius of a radial gradient is equal to or less than 0.
2010-12-01 16:46:01 +08:00
Zhenyu Wang
c530fd3f8a i965: also using align1 mode for math2 on sandybridge
Like Eric's workaround patch of commit 490c23ee6b.
This forces to align1 mode for math2 too.
2010-12-01 15:04:18 +08:00
Chia-I Wu
06e7a55028 st/vega: Fix negated logic in image_draw.
A typo from last commit.
2010-12-01 11:39:33 +08:00
Chia-I Wu
b06de80843 st/vega: Fix paint coordinates transformations.
Depending on whether vgDrawPath(mode), vgDrawImage, or vgDrawGlyph[s] is
called, different paint-to-user and user-to-surface matrices should be
used to derive the sample points for the paint.

This fixes "paint" demo.
2010-12-01 11:31:00 +08:00
Chia-I Wu
ca8bc9c05b st/vega: Bump version to 1.1. 2010-12-01 11:23:53 +08:00
Chia-I Wu
e360f91f15 st/vega: Add color transformation support.
Per OpenVG 1.1.  A new shader stage is added.  It uses the first two
constants of the fragment shader for color transformation parameters.
2010-12-01 11:23:52 +08:00
Chia-I Wu
213e288e78 st/vega: More flexible shader selection.
Divide bits of VegaShaderType into 6 groups: paint, image, mask, fill,
premultiply, and bw.  Each group represents a stage.  At most one shader
from each group will be selected when constructing the final fragment
shader.
2010-12-01 11:23:52 +08:00
Chia-I Wu
30cab4b6cb st/vega: Revive mask layer support. 2010-12-01 11:23:52 +08:00
Chia-I Wu
5d64a06a63 st/vega: Add primitive text support.
Optional features such as auth-hinting are not implemented.  There is no
anti-aliasing, and no effort is done to keep the glyph origin integral.
So the text quality is poor.
2010-12-01 11:23:52 +08:00
Chia-I Wu
34f466d4e6 st/vega: Make image_draw take a matrix. 2010-12-01 11:23:52 +08:00
Chia-I Wu
165cb19abc st/vega: Make path_render and path_stroke take a matrix. 2010-12-01 11:23:51 +08:00
Chia-I Wu
d873f1f5b6 st/vega: Fix image sampler views for alpha-only formats.
For alpha-only VG formats, R = G = B = 1.0.
2010-12-01 11:23:51 +08:00
Chia-I Wu
56f02cedfa st/vega: Update to latest headers. 2010-12-01 11:23:51 +08:00
Chia-I Wu
20ce148c30 st/vega: Get rid of renderer_copy_texture. 2010-12-01 11:23:51 +08:00
Chia-I Wu
33ca973e7a st/vega: vg_copy_texture and vg_copy_surface should share code. 2010-12-01 11:23:51 +08:00
Chia-I Wu
4690cdfe07 st/vega: Clean up renderer fields and functions. 2010-12-01 11:23:50 +08:00
Chia-I Wu
ace4539e88 st/vega: Clean up vg_context fields and functions. 2010-12-01 11:23:50 +08:00
Chia-I Wu
635fe3e192 st/vega: vg_manager should care about only the color buffer.
Move depth/stencil buffer, blend texture view, and alpha mask view
creation to vg_context.c.
2010-12-01 11:23:50 +08:00
Chia-I Wu
ee0f1ab923 st/vega: Make shader_bind call into the renderer.
With this commit, the pipe states are entirely managed by the renderer.
The rest of the code interfaces with the renderer instead of
manipulating the states directly.
2010-12-01 11:23:50 +08:00
Chia-I Wu
b730f0fc52 st/vega: Move g3d states to renderer.
Let vg_context focus on OpenVG states and renderer focus on gallium
states.
2010-12-01 11:23:50 +08:00
Chia-I Wu
96c6637a13 st/vega: Use st_framebuffer for fb width/height.
This allows us to eventually make g3d states opaque.
2010-12-01 11:23:50 +08:00
Chia-I Wu
438359597c st/vega: Delay fb state update to vg_validate_state.
vg_manager_validate_framebuffer should mark the fb dirty and have
vg_validate_state call cso_set_framebuffer.  Rename VIEWPORT_DIRTY to
FRAMEBUFFER_DIRTY.
2010-12-01 11:23:49 +08:00
Chia-I Wu
3b71cb6ad6 st/vega: Add POLYGON_STENCIL and POLYGON_FILL renderer state.
The states are designated for polygon filling.  Polygon filling is a
two-pass process utilizing the stencil buffer.  polygon_fill and
polygon_array_fill functions are updated to make use of the state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
b23f732075 st/vega: Use the renderer for vgMask.
vgMask renders to the alpha mask with special fragment shaders.  The
operation can be supported by switching the renderer to FILTER state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
e5968a5355 st/vega: Add FILTER renderer state for image filtering.
The state is designated to perform image filtering.  execute_filter is
updated to make use of the state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
6b241f532a st/vega: Add CLEAR renderer state for vgClear.
This state provides the ability to clear rectangles of the framebuffer
to the specified color, honoring scissoring.  vegaClear is updated to
make use of the state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
54cb382ea5 st/vega: Add SCISSOR renderer state.
The state can be used to set rectangles of the depth buffer to 0.0f.
update_clip_state is changed to use the state for scissor update.
2010-12-01 11:23:49 +08:00
Chia-I Wu
e31a04ea3b st/vega: Add DRAWTEX renderer state.
This state provides glDrawTex-like function.  It can be used for
vgSetPixels.

Rather than modifying every user of the renderer, this commit instead
modifies renderer_copy_surface to use DRAWTEX or COPY state internally
depending on whether the destination is the framebuffer.
2010-12-01 11:23:48 +08:00
Chia-I Wu
59309337e4 st/vega: Overhaul renderer with renderer states.
Renderer states are high-level states to perform specific tasks.  The
renderer is initially in INIT state.  In that state, the renderer is
used for OpenVG pipeline.

This commit adds a new COPY state to the renderer.  The state is used
for copying between two pipe resources using textured drawing.  It can
be used for vgCopyImage, for example.

Rather than modifying every user of the renderer, this commit instead
modifies renderer_copy_texture to use the COPY state internally.
2010-12-01 11:23:48 +08:00
Chia-I Wu
709e57ae4f llvmpipe: Fix build errors on x86.
The errors were introduced by
efc82aef35.
2010-12-01 11:23:48 +08:00
Brian Paul
efc82aef35 gallivm/llvmpipe: squash merge of the llvm-context branch
This branch defines a gallivm_state structure which contains the
LLVMBuilderRef, LLVMContextRef, etc.  All data structures built with
this object can be periodically freed during a "garbage collection"
operation.

The gallivm_state object has to be passed to most of the builder
functions where LLVMBuilderRef used to be used.

Conflicts:
	src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
	src/gallium/drivers/llvmpipe/lp_state_setup.c
2010-11-30 16:35:12 -07:00
Marek Olšák
1f1375d4d8 r300g: fix texture border color once again
I made the texwrap test be more thorough and realized that this driver code
had not been quite right. This commit fixes the border color for depth
textures, compressed textures, and 16-bits-per-channel textures
with up to 2 channels (R16, RG16).

NOTE: This is a candidate for the 7.9 branch.
2010-11-30 23:31:16 +01:00
Kenneth Graunke
2da02e75b1 glsl/linker: Free any IR discarded by optimization passes.
Previously, IR for a linked shader was allocated directly out of the
gl_shader object - meaning all of it lived as long as the shader.

Now, IR is allocated out of a temporary context, and any -live- IR is
reparented/stolen to (effectively) the gl_shader.  Any remaining IR can
be freed.

NOTE: This is a candidate for the 7.9 branch.
2010-11-30 13:48:28 -08:00
Kenneth Graunke
ff994eeff8 glsl: Remove anti-built-in hacks from the print visitor.
Now that we only import built-in signatures that are actually used,
printing them is reasonable.
2010-11-30 13:48:28 -08:00
Kenneth Graunke
f5692f452f glsl: Lazily import built-in function prototypes.
This makes a very simple 1.30 shader go from 196k of memory to 9k.

NOTE: This -may- be a candidate for the 7.9 branch, as the benefit is
substantial.  However, it's not a simple change, so it may be wiser to
wait for 7.10.
2010-11-30 13:48:28 -08:00
Kenneth Graunke
01a25bb64e glsl: Refactor out cloning of function prototypes.
This allows us to reuse some code and will be useful later.
2010-11-30 13:48:28 -08:00
Aras Pranckevicius
4ce084c707 glsl: fix matrix type check in ir_algebraic
Fixes glsl-mat-mul-1.
2010-11-30 13:32:00 -08:00
Eric Anholt
d56c97413e glsl: Quiet unreachable no-return-from-function warning. 2010-11-30 13:29:28 -08:00
Zack Rusin
b22d65e9fc scons: add alias for identity 2010-11-30 16:13:11 -05:00
Eric Anholt
ff79633d9f glsl: Fix structure and array comparisions.
We were trying to emit a single ir_expression to compare the whole
thing.  The backends (ir_to_mesa.cpp and brw_fs.cpp so far) expected
ir_binop_any_nequal or ir_binop_all_equal to apply to at most a vector
(with matrices broken down by the lowering pass).  Break them down to
a bunch of ORed or ANDed any_nequals/all_equals.

Fixes:
glsl-array-compare
glsl-array-compare-02
glsl-fs-struct-equal
glsl-fs-struct-notequal
Bug #31909
2010-11-30 11:42:42 -08:00
Eric Anholt
6b937465d4 glsl: Add a helper constructor for expressions that works out result type.
This doesn't cover all expressions or all operand types, but it will
complain if you overreach and it allows for much greater slack on the
programmer's part.
2010-11-30 11:23:24 -08:00
Keith Whitwell
68a4f63247 llvmpipe: shortcircuit some calls to set_scene_state 2010-11-30 12:01:29 +00:00
Keith Whitwell
d9169364d4 llvmpipe: remove misleading debug string 2010-11-30 12:01:29 +00:00