mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
regress: Add fragment shader test for one-dimensional constant buffers.
This commit is contained in:
parent
4771e536e1
commit
44ac4c4e2c
2 changed files with 19 additions and 5 deletions
|
|
@ -0,0 +1,13 @@
|
||||||
|
FRAG
|
||||||
|
|
||||||
|
DCL IN[0], COLOR, LINEAR
|
||||||
|
DCL OUT[0], COLOR
|
||||||
|
DCL CONST[1]
|
||||||
|
DCL CONST[3]
|
||||||
|
DCL TEMP[0..1]
|
||||||
|
|
||||||
|
ADD TEMP[0], IN[0], CONST[1]
|
||||||
|
RCP TEMP[1], CONST[3].xxxx
|
||||||
|
MUL OUT[0], TEMP[0], TEMP[1]
|
||||||
|
|
||||||
|
END
|
||||||
|
|
@ -147,17 +147,17 @@ def test(dev, name):
|
||||||
fs = Shader(file('frag-' + name + '.sh', 'rt').read())
|
fs = Shader(file('frag-' + name + '.sh', 'rt').read())
|
||||||
ctx.set_fragment_shader(fs)
|
ctx.set_fragment_shader(fs)
|
||||||
|
|
||||||
constbuf0 = dev.buffer_create(16,
|
constbuf0 = dev.buffer_create(64,
|
||||||
(PIPE_BUFFER_USAGE_CONSTANT |
|
(PIPE_BUFFER_USAGE_CONSTANT |
|
||||||
PIPE_BUFFER_USAGE_GPU_READ |
|
PIPE_BUFFER_USAGE_GPU_READ |
|
||||||
PIPE_BUFFER_USAGE_CPU_WRITE),
|
PIPE_BUFFER_USAGE_CPU_WRITE),
|
||||||
4 * 4 * 4)
|
4 * 4 * 4)
|
||||||
|
|
||||||
cbdata = ''
|
cbdata = ''
|
||||||
cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5)
|
cbdata += struct.pack('4f', 0.4, 0.0, 0.0, 1.0)
|
||||||
cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5)
|
cbdata += struct.pack('4f', 1.0, 1.0, 1.0, 1.0)
|
||||||
cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5)
|
cbdata += struct.pack('4f', 2.0, 2.0, 2.0, 2.0)
|
||||||
cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5)
|
cbdata += struct.pack('4f', 4.0, 8.0, 16.0, 32.0)
|
||||||
|
|
||||||
constbuf0.write(cbdata, 0)
|
constbuf0.write(cbdata, 0)
|
||||||
|
|
||||||
|
|
@ -221,6 +221,7 @@ def main():
|
||||||
tests = [
|
tests = [
|
||||||
'abs',
|
'abs',
|
||||||
'add',
|
'add',
|
||||||
|
'cb-1d',
|
||||||
'cb-2d',
|
'cb-2d',
|
||||||
'dp3',
|
'dp3',
|
||||||
'dp4',
|
'dp4',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue