Li Qiang
a5ac49940c
vrend: add sanity check for vertext buffer index
...
The vertext_buffer_index is read from guest and then used
to index the 'vbo' array in struct 'vrend_sub_context'.
Add sanity check for this to avoid oob issue.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years ago
Li Qiang
926b9b3460
vrend: fix a stack overflow in set framebuffer state
...
Add the sanity check of the 'nr_cbufs' to avoid stack
overflow.
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years ago
Li Qiang
747a293ff6
vrend: fix a leak in context create internal
...
Create a context more than once causes memory leak issue.
Juest return if the context exists.
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years ago
Dave Airlie
12c89d559a
renderer: add support for handling blit render conditions.
...
This with a change in the mesa side should fix the remaining
render condition test fails
9 years ago
Marc-André Lureau
9a2464c027
vrend: fix VREND_MAX_CTX checks
...
Context array is declared as dec_ctx[VREND_MAX_CTX], virgl shouldn't accept id
== VREND_MAX_CTX.
Found thanks to AddressSanitizer.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
c59eddf16e
Fix -Wswitch-default
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years ago
Marc-André Lureau
64c9469587
decode: check streamout-targets num_handles
...
Prevent out-of-bound array access.
Found thanks to AddressSanitizer & american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
b93e67deb0
decode: check the buffer length before access
...
Avoid out of bounds array access.
Found thanks to AddressSanitizer & american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
ec24bd2211
decode: fix set_scissor_state bounds
...
Do not accept negative values for num & start.
Fix found thanks to american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
78f8994a63
decode: check set_uniform_buffer arguments
...
Fix found thanks to american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
3c0a03de89
decode: check set_sampler_views args
...
Fix found thanks to american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
bfa6cd741d
renderer: prevent out of bound vps access
...
Fix found thanks to american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
775f5ed62a
renderer: validate shader_type value
...
Fix found thanks to american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
36492a4012
decode: validate shader type
...
Fix found thanks to american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
2aa6c5bca9
decode: check we don't reach MAX_VIEWPORTS
...
Fix found thanks to american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
9033b26976
renderer: validate num_so_outputs
...
Avoid out-of-bound acces of array so_info.output.
Fix found thanks to american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 years ago
Marc-André Lureau
bc358da307
decode: prevent handle 0 object creation
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
9 years ago
Dave Airlie
85602b31bd
renderer: fix regression in shader binding
...
made a mistake in the shader binding code, not good,
time for brown paper bag.
9 years ago
Dave Airlie
92b00c978b
renderer: CLEANUP - remove TABs
...
I didn't do a good enough job last time at purging these.
9 years ago
Dave Airlie
81b741a05c
virgl/shaders: handle large shaders.
...
the protocol failed to handle larger shaders, this allow
the renderer to reassemble large shaders and recombined
the chunks before passing them to the GLSL translation.
This also enhances the renderer protocol to allow
for some more info in the shader object, and removes
the separate vs/gs/fs variants in favour of a type field
in the shader.
9 years ago
Dave Airlie
fd8116476b
virgl: add query index to top 16-bits of query type.
...
This is an ABI valid change, we won't get passed indices
unless we advertise later GLSL versions.
9 years ago
Dave Airlie
7e85c2f114
renderer: CLEANUP: whitespace and reindent
...
this uses the mesa coding style, pray I never have to do
this again.
strip all trailing whitespace as much as possible
10 years ago
Dave Airlie
ca23e98b22
renderer: CLEANUP: boolean/GLboolean -> bool
...
use stdbool.h as much as possible
some of the gallium code imported uses boolean
so leave it alone for now
10 years ago
Dave Airlie
9259bc768e
renderer: handle transform feedback 2 and 3 extensions
...
This fixes a number of issues with how transform feedback works
it does requires ARB_transform_feedback3 to work at all, but
hopefully this extension is widespread enough, if not we can
revisit later.
It uses transform feedback objects to store the stream out
state.
10 years ago
Dave Airlie
f6a786c6ea
renderer: allow binding 0 vbos
...
This was broken calculation, we should allow binding 0 vbos.
10 years ago
Dave Airlie
3f4e3e1cad
renderer: add support for ARB_viewport_array
10 years ago
Dave Airlie
0ff22a06b7
renderer: ABI break: overhaul viewport/scissor state
...
add support for multiple viewports, and reduce
viewport size.
10 years ago
Dave Airlie
1fe0822ff4
renderer: fix bug transfer inline write decoding
...
cleanup a little, but also read layer stride from correct place
found writing validation tests.
10 years ago
Dave Airlie
aea7785887
renderer: handle resource inline writes using common code
...
inline resource writes should use common code for transfers
10 years ago
Dave Airlie
cccbc3b5e4
renderer: return values from submit_cmd/decode block
...
makes easier to write unit tests.
10 years ago
Marc-André Lureau
58ef21b0b8
vrend: accept empty vertex elements
...
Vertex elements may have a count of 0, this is an acceptable value.
Fix piglit spec/glsl-1.50/execution/geometry/primitive-types
gl_triangle_fan test.
10 years ago
Marc-André Lureau
e094ca79f9
vrend: return EINVAL for unknown object type
10 years ago
Dave Airlie
fa71f3761d
renderer: free vertex element data
...
this is duplicated by the renderer so free the decoder data.
found with rendering test
10 years ago
Dave Airlie
3d91ff730e
renderer: cleanup context create errors and context destroy
10 years ago
Dave Airlie
96e1b0b693
renderer: reset decode contexts in two stages
...
reset the non-0 contexts first, then kill resource
table, then nuke the 0 context.
10 years ago
Dave Airlie
8ea7848b6e
virglrenderer: fix some memory leaks on cleanup
...
Writing some unit tests with valgrind, showed we don't always
cleanup properly fix that.
10 years ago
Dave Airlie
03e3116a75
import latest renderer code
10 years ago