text stringlengths 1 1.05M |
|---|
; A313975: Coordination sequence Gal.4.145.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,10,17,22,27,32,37,44,49,54,59,64,71,76,81,86,91,98,103,108,113,118,125,130,135,140,145,152,157,162,167,172,179,184,189,194,199,206,211,216,221,226,233,238,243,248,253,260,265
mov $1,$0
seq $1,312475 ; Coordination sequence Gal.3.16.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
add $0,$1
|
bits 64
je .l
resb 128
.l:
|
;
; Copyright (c) 2014 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
%include "vpx_ports/x86_abi_support.asm"
%macro GET_PARAM_4 0
mov rdx, arg(5) ;filter ptr
mov rsi, arg(0) ;src_ptr
mov rdi, arg(2) ;output_ptr
mov ecx, 0x01000100
movdqa xmm3, [rdx] ;load filters
psrldq xmm3, 6
packsswb xmm3, xmm3
pshuflw xmm3, xmm3, 0b ;k3_k4
movd xmm2, ecx ;rounding_shift
pshufd xmm2, xmm2, 0
movsxd rax, DWORD PTR arg(1) ;pixels_per_line
movsxd rdx, DWORD PTR arg(3) ;out_pitch
movsxd rcx, DWORD PTR arg(4) ;output_height
%endm
%macro APPLY_FILTER_4 1
punpcklbw xmm0, xmm1
pmaddubsw xmm0, xmm3
pmulhrsw xmm0, xmm2 ;rounding(+64)+shift(>>7)
packuswb xmm0, xmm0 ;pack to byte
%if %1
movd xmm1, [rdi]
pavgb xmm0, xmm1
%endif
movd [rdi], xmm0
lea rsi, [rsi + rax]
lea rdi, [rdi + rdx]
dec rcx
%endm
%macro GET_PARAM 0
mov rdx, arg(5) ;filter ptr
mov rsi, arg(0) ;src_ptr
mov rdi, arg(2) ;output_ptr
mov ecx, 0x01000100
movdqa xmm7, [rdx] ;load filters
psrldq xmm7, 6
packsswb xmm7, xmm7
pshuflw xmm7, xmm7, 0b ;k3_k4
punpcklwd xmm7, xmm7
movd xmm6, ecx ;rounding_shift
pshufd xmm6, xmm6, 0
movsxd rax, DWORD PTR arg(1) ;pixels_per_line
movsxd rdx, DWORD PTR arg(3) ;out_pitch
movsxd rcx, DWORD PTR arg(4) ;output_height
%endm
%macro APPLY_FILTER_8 1
punpcklbw xmm0, xmm1
pmaddubsw xmm0, xmm7
pmulhrsw xmm0, xmm6 ;rounding(+64)+shift(>>7)
packuswb xmm0, xmm0 ;pack back to byte
%if %1
movq xmm1, [rdi]
pavgb xmm0, xmm1
%endif
movq [rdi], xmm0 ;store the result
lea rsi, [rsi + rax]
lea rdi, [rdi + rdx]
dec rcx
%endm
%macro APPLY_FILTER_16 1
punpcklbw xmm0, xmm1
punpckhbw xmm2, xmm1
pmaddubsw xmm0, xmm7
pmaddubsw xmm2, xmm7
pmulhrsw xmm0, xmm6 ;rounding(+64)+shift(>>7)
pmulhrsw xmm2, xmm6
packuswb xmm0, xmm2 ;pack back to byte
%if %1
movdqu xmm1, [rdi]
pavgb xmm0, xmm1
%endif
movdqu [rdi], xmm0 ;store the result
lea rsi, [rsi + rax]
lea rdi, [rdi + rdx]
dec rcx
%endm
SECTION .text
globalsym(vpx_filter_block1d4_v2_ssse3)
sym(vpx_filter_block1d4_v2_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
push rsi
push rdi
; end prolog
GET_PARAM_4
.loop:
movd xmm0, [rsi] ;load src
movd xmm1, [rsi + rax]
APPLY_FILTER_4 0
jnz .loop
; begin epilog
pop rdi
pop rsi
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d8_v2_ssse3)
sym(vpx_filter_block1d8_v2_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
SAVE_XMM 7
push rsi
push rdi
; end prolog
GET_PARAM
.loop:
movq xmm0, [rsi] ;0
movq xmm1, [rsi + rax] ;1
APPLY_FILTER_8 0
jnz .loop
; begin epilog
pop rdi
pop rsi
RESTORE_XMM
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d16_v2_ssse3)
sym(vpx_filter_block1d16_v2_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
SAVE_XMM 7
push rsi
push rdi
; end prolog
GET_PARAM
.loop:
movdqu xmm0, [rsi] ;0
movdqu xmm1, [rsi + rax] ;1
movdqa xmm2, xmm0
APPLY_FILTER_16 0
jnz .loop
; begin epilog
pop rdi
pop rsi
RESTORE_XMM
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d4_v2_avg_ssse3)
sym(vpx_filter_block1d4_v2_avg_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
push rsi
push rdi
; end prolog
GET_PARAM_4
.loop:
movd xmm0, [rsi] ;load src
movd xmm1, [rsi + rax]
APPLY_FILTER_4 1
jnz .loop
; begin epilog
pop rdi
pop rsi
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d8_v2_avg_ssse3)
sym(vpx_filter_block1d8_v2_avg_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
SAVE_XMM 7
push rsi
push rdi
; end prolog
GET_PARAM
.loop:
movq xmm0, [rsi] ;0
movq xmm1, [rsi + rax] ;1
APPLY_FILTER_8 1
jnz .loop
; begin epilog
pop rdi
pop rsi
RESTORE_XMM
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d16_v2_avg_ssse3)
sym(vpx_filter_block1d16_v2_avg_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
SAVE_XMM 7
push rsi
push rdi
; end prolog
GET_PARAM
.loop:
movdqu xmm0, [rsi] ;0
movdqu xmm1, [rsi + rax] ;1
movdqa xmm2, xmm0
APPLY_FILTER_16 1
jnz .loop
; begin epilog
pop rdi
pop rsi
RESTORE_XMM
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d4_h2_ssse3)
sym(vpx_filter_block1d4_h2_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
push rsi
push rdi
; end prolog
GET_PARAM_4
.loop:
movdqu xmm0, [rsi] ;load src
movdqa xmm1, xmm0
psrldq xmm1, 1
APPLY_FILTER_4 0
jnz .loop
; begin epilog
pop rdi
pop rsi
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d8_h2_ssse3)
sym(vpx_filter_block1d8_h2_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
SAVE_XMM 7
push rsi
push rdi
; end prolog
GET_PARAM
.loop:
movdqu xmm0, [rsi] ;load src
movdqa xmm1, xmm0
psrldq xmm1, 1
APPLY_FILTER_8 0
jnz .loop
; begin epilog
pop rdi
pop rsi
RESTORE_XMM
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d16_h2_ssse3)
sym(vpx_filter_block1d16_h2_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
SAVE_XMM 7
push rsi
push rdi
; end prolog
GET_PARAM
.loop:
movdqu xmm0, [rsi] ;load src
movdqu xmm1, [rsi + 1]
movdqa xmm2, xmm0
APPLY_FILTER_16 0
jnz .loop
; begin epilog
pop rdi
pop rsi
RESTORE_XMM
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d4_h2_avg_ssse3)
sym(vpx_filter_block1d4_h2_avg_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
push rsi
push rdi
; end prolog
GET_PARAM_4
.loop:
movdqu xmm0, [rsi] ;load src
movdqa xmm1, xmm0
psrldq xmm1, 1
APPLY_FILTER_4 1
jnz .loop
; begin epilog
pop rdi
pop rsi
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d8_h2_avg_ssse3)
sym(vpx_filter_block1d8_h2_avg_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
SAVE_XMM 7
push rsi
push rdi
; end prolog
GET_PARAM
.loop:
movdqu xmm0, [rsi] ;load src
movdqa xmm1, xmm0
psrldq xmm1, 1
APPLY_FILTER_8 1
jnz .loop
; begin epilog
pop rdi
pop rsi
RESTORE_XMM
UNSHADOW_ARGS
pop rbp
ret
globalsym(vpx_filter_block1d16_h2_avg_ssse3)
sym(vpx_filter_block1d16_h2_avg_ssse3):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
SAVE_XMM 7
push rsi
push rdi
; end prolog
GET_PARAM
.loop:
movdqu xmm0, [rsi] ;load src
movdqu xmm1, [rsi + 1]
movdqa xmm2, xmm0
APPLY_FILTER_16 1
jnz .loop
; begin epilog
pop rdi
pop rsi
RESTORE_XMM
UNSHADOW_ARGS
pop rbp
ret
|
<%
from pwnlib.shellcraft.powerpc.linux import syscall
%>
<%page args="which, who, prio"/>
<%docstring>
Invokes the syscall setpriority. See 'man 2 setpriority' for more information.
Arguments:
which(priority_which_t): which
who(id_t): who
prio(int): prio
</%docstring>
${syscall('SYS_setpriority', which, who, prio)}
|
;;
;; Upcaste Performance Libraries
;; Copyright (C) 2012-2013 Jesse W. Towner
;;
;; Permission is hereby granted, free of charge, to any person obtaining
;; a copy of this software and associated documentation files (the
;; "Software"), to deal in the Software without restriction, including
;; without limitation the rights to use, copy, modify, merge, publish,
;; distribute, sublicense, and/or sell copies of the Software, and to
;; permit persons to whom the Software is furnished to do so, subject to
;; the following conditions:
;;
;; The above copyright notice and this permission notice shall be
;; included in all copies or substantial portions of the Software.
;;
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
;;
INCLUDE fenv.inc
;;
;; int fesetenv(fenv_t const* envp);
;;
;; Sets the floating-point environment to the one supplied by the
;; caller, handling special environments FE_DFL_ENV and FE_NOMASK_ENV.
;; This function preserves the x87 FPU precision mode for all given
;; environments. The default and no-mask environments also preserve
;; the SSE flush-to-zero and denormals-as-zeros flags, but a user
;; environment is allowed to override them. This should ensure
;; maximum compatability with the MSVC CRT and user-code.
;;
;; Input:
;; rcx = envp
;; Output:
;; rax = 0
;;
.CODE
ALIGN 8
PUBLIC fesetenv
fesetenv PROC
; check input arguments
test rcx, rcx
jz _invalid_envp
; fetch current floating point environment
fnstenv [rsp - SIZEOF fenv]
stmxcsr [rsp - SIZEOF fenv].fenv.mxcsr
; check for special environments
xor rax, rax
cmp rcx, FE_NOMASK_ENV
jb _user_environment
; clear out bits we don't want to set
mov [rsp - SIZEOF fenv].fenv.ip_offset, eax
mov [rsp - SIZEOF fenv].fenv.ip_selector, ax
mov [rsp - SIZEOF fenv].fenv.opcode, ax
mov [rsp - SIZEOF fenv].fenv.data_offset, eax
mov [rsp - SIZEOF fenv].fenv.data_selector, ax
; apply default environment if specified by caller
je _nomask_environment
mov cx, [rsp - SIZEOF fenv].fenv.control_word
mov edx, [rsp - SIZEOF fenv].fenv.mxcsr
or cx, FE_CTRL_MASK_INIT ; exceptions are disabled
and edx, MXSCR_NOROUND_UNMASK ; round-to-nearest & exception status cleared
and cx, FE_CTRL_NOROUND ; round-to-nearest
or edx, MXSCR_ALL_EXCEPT ; exceptions are disabled
mov [rsp - SIZEOF fenv].fenv.control_word, cx
and [rsp - SIZEOF fenv].fenv.status_word, FE_STAT_UNMASK ; exception status cleared
mov [rsp - SIZEOF fenv].fenv.mxcsr, edx
jmp _done
; apply no-mask environment if specified by caller
_nomask_environment:
and [rsp - SIZEOF fenv].fenv.control_word, FE_CTRL_NOMASK_INIT ; exceptions enabled & round-to-nearest
and [rsp - SIZEOF fenv].fenv.status_word, FE_STAT_UNMASK ; exception status cleared
and [rsp - SIZEOF fenv].fenv.mxcsr, MXSCR_NOMASK_INIT ; round-to-nearest, exceptions enabled, exception status cleared
jmp _done
; set user supplied environment
_user_environment:
mov r8w, [rcx].fenv.control_word
mov r9w, [rcx].fenv.status_word
mov r10w, [rsp - SIZEOF fenv].fenv.control_word
mov r11w, [rsp - SIZEOF fenv].fenv.status_word
and r8w, FE_CTRL_USER_INIT ; envp->control_word & (FE_ALL_EXCEPT | FE_TOWARDZERO)
and r9w, FE_ALL_EXCEPT ; envp->status_word & FE_ALL_EXCEPT
and r10w, FE_CTRL_NOMASK_INIT ; control_word &= ~(FE_ALL_EXCEPT | FE_TOWARDZERO)
and r11w, FE_STAT_UNMASK ; status_word &= ~FE_ALL_EXCEPT
or r10w, r8w
or r11w, r9w
mov [rsp - SIZEOF fenv].fenv.control_word, r10w
mov [rsp - SIZEOF fenv].fenv.status_word, r11w
mov r9d, [rcx].fenv.ip_offset
mov r8w, [rcx].fenv.ip_selector
mov dx, [rcx].fenv.opcode
mov r10d, [rcx].fenv.data_offset
mov r11w, [rcx].fenv.data_selector
mov [rsp - SIZEOF fenv].fenv.ip_offset, r9d
mov [rsp - SIZEOF fenv].fenv.ip_selector, r8w
mov [rsp - SIZEOF fenv].fenv.opcode, dx
mov r9d, [rcx].fenv.mxcsr
mov [rsp - SIZEOF fenv].fenv.data_offset, r10d
mov [rsp - SIZEOF fenv].fenv.data_selector, r11w
mov [rsp - SIZEOF fenv].fenv.mxcsr, r9d
; finish by setting the x87 FPU environment and SSE control-status register
_done:
fldenv [rsp - SIZEOF fenv]
ldmxcsr [rsp - SIZEOF fenv].fenv.mxcsr
ret
; return error code
_invalid_envp:
mov rax, -1
ret
fesetenv ENDP
END
|
; A120326: Cumulative sum of the remainders when dividing primes by 3.
; Submitted by Jon Maiga
; 2,2,4,5,7,8,10,11,13,15,16,17,19,20,22,24,26,27,28,30,31,32,34,36,37,39,40,42,43,45,46,48,50,51,53,54,55,56,58,60,62,63,65,66,68,69,70,71,73,74,76,78,79,81,83,85,87,88,89,91,92,94,95,97,98,100,101,102,104,105,107,109,110,111,112,114,116,117,119,120,122,123,125,126,127,129,131,132,134,135,137,139,140,142,143,145,147,149,150,151
mov $2,$0
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
seq $0,6005 ; The odd prime numbers together with 1.
mod $0,3
add $3,$0
lpe
mov $0,$3
add $0,2
|
;
; Copyright (c) 2014 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
%include "third_party/x86inc/x86inc.asm"
SECTION_RODATA
pw_8: times 8 dw 8
bilin_filter_m_sse2: times 8 dw 16
times 8 dw 0
times 8 dw 14
times 8 dw 2
times 8 dw 12
times 8 dw 4
times 8 dw 10
times 8 dw 6
times 16 dw 8
times 8 dw 6
times 8 dw 10
times 8 dw 4
times 8 dw 12
times 8 dw 2
times 8 dw 14
SECTION .text
; int vpx_sub_pixel_varianceNxh(const uint8_t *src, ptrdiff_t src_stride,
; int x_offset, int y_offset,
; const uint8_t *dst, ptrdiff_t dst_stride,
; int height, unsigned int *sse);
;
; This function returns the SE and stores SSE in the given pointer.
%macro SUM_SSE 6 ; src1, dst1, src2, dst2, sum, sse
psubw %3, %4
psubw %1, %2
mova %4, %3 ; make copies to manipulate to calc sum
mova %2, %1 ; use originals for calc sse
pmaddwd %3, %3
paddw %4, %2
pmaddwd %1, %1
movhlps %2, %4
paddd %6, %3
paddw %4, %2
pxor %2, %2
pcmpgtw %2, %4 ; mask for 0 > %4 (sum)
punpcklwd %4, %2 ; sign-extend word to dword
paddd %6, %1
paddd %5, %4
%endmacro
%macro STORE_AND_RET 0
%if mmsize == 16
; if H=64 and W=16, we have 8 words of each 2(1bit)x64(6bit)x9bit=16bit
; in m6, i.e. it _exactly_ fits in a signed word per word in the xmm reg.
; We have to sign-extend it before adding the words within the register
; and outputing to a dword.
movhlps m3, m7
movhlps m4, m6
paddd m7, m3
paddd m6, m4
pshufd m3, m7, 0x1
pshufd m4, m6, 0x1
paddd m7, m3
paddd m6, m4
mov r1, ssem ; r1 = unsigned int *sse
movd [r1], m7 ; store sse
movd eax, m6 ; store sum as return value
%endif
RET
%endmacro
%macro INC_SRC_BY_SRC_STRIDE 0
%if ARCH_X86=1 && CONFIG_PIC=1
add srcq, src_stridemp
add srcq, src_stridemp
%else
lea srcq, [srcq + src_strideq*2]
%endif
%endmacro
%macro SUBPEL_VARIANCE 1-2 0 ; W
%define bilin_filter_m bilin_filter_m_sse2
%define filter_idx_shift 5
%if ARCH_X86_64
%if %2 == 1 ; avg
cglobal highbd_sub_pixel_avg_variance%1xh, 9, 10, 13, src, src_stride, \
x_offset, y_offset, \
dst, dst_stride, \
sec, sec_stride, height, sse
%define sec_str sec_strideq
%else
cglobal highbd_sub_pixel_variance%1xh, 7, 8, 13, src, src_stride, \
x_offset, y_offset, \
dst, dst_stride, height, sse
%endif
%define block_height heightd
%define bilin_filter sseq
%else
%if CONFIG_PIC=1
%if %2 == 1 ; avg
cglobal highbd_sub_pixel_avg_variance%1xh, 7, 7, 13, src, src_stride, \
x_offset, y_offset, \
dst, dst_stride, \
sec, sec_stride, height, sse, \
g_bilin_filter, g_pw_8
%define block_height dword heightm
%define sec_str sec_stridemp
; Store bilin_filter and pw_8 location in stack
%if GET_GOT_DEFINED == 1
GET_GOT eax
add esp, 4 ; restore esp
%endif
lea ecx, [GLOBAL(bilin_filter_m)]
mov g_bilin_filterm, ecx
lea ecx, [GLOBAL(pw_8)]
mov g_pw_8m, ecx
LOAD_IF_USED 0, 1 ; load eax, ecx back
%else
cglobal highbd_sub_pixel_variance%1xh, 7, 7, 13, src, src_stride, \
x_offset, y_offset, \
dst, dst_stride, height, sse, \
g_bilin_filter, g_pw_8
%define block_height heightd
; Store bilin_filter and pw_8 location in stack
%if GET_GOT_DEFINED == 1
GET_GOT eax
add esp, 4 ; restore esp
%endif
lea ecx, [GLOBAL(bilin_filter_m)]
mov g_bilin_filterm, ecx
lea ecx, [GLOBAL(pw_8)]
mov g_pw_8m, ecx
LOAD_IF_USED 0, 1 ; load eax, ecx back
%endif
%else
%if %2 == 1 ; avg
cglobal highbd_sub_pixel_avg_variance%1xh, 7, 7, 13, src, src_stride, \
x_offset, y_offset, \
dst, dst_stride, \
sec, sec_stride, height, sse
%define block_height dword heightm
%define sec_str sec_stridemp
%else
cglobal highbd_sub_pixel_variance%1xh, 7, 7, 13, src, src_stride, \
x_offset, y_offset, \
dst, dst_stride, height, sse
%define block_height heightd
%endif
%define bilin_filter bilin_filter_m
%endif
%endif
ASSERT %1 <= 16 ; m6 overflows if w > 16
pxor m6, m6 ; sum
pxor m7, m7 ; sse
%if %1 < 16
sar block_height, 1
%endif
%if %2 == 1 ; avg
shl sec_str, 1
%endif
; FIXME(rbultje) replace by jumptable?
test x_offsetd, x_offsetd
jnz .x_nonzero
; x_offset == 0
test y_offsetd, y_offsetd
jnz .x_zero_y_nonzero
; x_offset == 0 && y_offset == 0
.x_zero_y_zero_loop:
%if %1 == 16
movu m0, [srcq]
movu m2, [srcq + 16]
mova m1, [dstq]
mova m3, [dstq + 16]
%if %2 == 1 ; avg
pavgw m0, [secq]
pavgw m2, [secq+16]
%endif
SUM_SSE m0, m1, m2, m3, m6, m7
lea srcq, [srcq + src_strideq*2]
lea dstq, [dstq + dst_strideq*2]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%else ; %1 < 16
movu m0, [srcq]
movu m2, [srcq + src_strideq*2]
mova m1, [dstq]
mova m3, [dstq + dst_strideq*2]
%if %2 == 1 ; avg
pavgw m0, [secq]
add secq, sec_str
pavgw m2, [secq]
%endif
SUM_SSE m0, m1, m2, m3, m6, m7
lea srcq, [srcq + src_strideq*4]
lea dstq, [dstq + dst_strideq*4]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%endif
dec block_height
jg .x_zero_y_zero_loop
STORE_AND_RET
.x_zero_y_nonzero:
cmp y_offsetd, 8
jne .x_zero_y_nonhalf
; x_offset == 0 && y_offset == 0.5
.x_zero_y_half_loop:
%if %1 == 16
movu m0, [srcq]
movu m1, [srcq+16]
movu m4, [srcq+src_strideq*2]
movu m5, [srcq+src_strideq*2+16]
mova m2, [dstq]
mova m3, [dstq+16]
pavgw m0, m4
pavgw m1, m5
%if %2 == 1 ; avg
pavgw m0, [secq]
pavgw m1, [secq+16]
%endif
SUM_SSE m0, m2, m1, m3, m6, m7
lea srcq, [srcq + src_strideq*2]
lea dstq, [dstq + dst_strideq*2]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%else ; %1 < 16
movu m0, [srcq]
movu m1, [srcq+src_strideq*2]
movu m5, [srcq+src_strideq*4]
mova m2, [dstq]
mova m3, [dstq+dst_strideq*2]
pavgw m0, m1
pavgw m1, m5
%if %2 == 1 ; avg
pavgw m0, [secq]
add secq, sec_str
pavgw m1, [secq]
%endif
SUM_SSE m0, m2, m1, m3, m6, m7
lea srcq, [srcq + src_strideq*4]
lea dstq, [dstq + dst_strideq*4]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%endif
dec block_height
jg .x_zero_y_half_loop
STORE_AND_RET
.x_zero_y_nonhalf:
; x_offset == 0 && y_offset == bilin interpolation
%if ARCH_X86_64
lea bilin_filter, [GLOBAL(bilin_filter_m)]
%endif
shl y_offsetd, filter_idx_shift
%if ARCH_X86_64 && mmsize == 16
mova m8, [bilin_filter+y_offsetq]
mova m9, [bilin_filter+y_offsetq+16]
mova m10, [GLOBAL(pw_8)]
%define filter_y_a m8
%define filter_y_b m9
%define filter_rnd m10
%else ; x86-32 or mmx
%if ARCH_X86=1 && CONFIG_PIC=1
; x_offset == 0, reuse x_offset reg
%define tempq x_offsetq
add y_offsetq, g_bilin_filterm
%define filter_y_a [y_offsetq]
%define filter_y_b [y_offsetq+16]
mov tempq, g_pw_8m
%define filter_rnd [tempq]
%else
add y_offsetq, bilin_filter
%define filter_y_a [y_offsetq]
%define filter_y_b [y_offsetq+16]
%define filter_rnd [GLOBAL(pw_8)]
%endif
%endif
.x_zero_y_other_loop:
%if %1 == 16
movu m0, [srcq]
movu m1, [srcq + 16]
movu m4, [srcq+src_strideq*2]
movu m5, [srcq+src_strideq*2+16]
mova m2, [dstq]
mova m3, [dstq+16]
; FIXME(rbultje) instead of out=((num-x)*in1+x*in2+rnd)>>log2(num), we can
; also do out=in1+(((num-x)*(in2-in1)+rnd)>>log2(num)). Total number of
; instructions is the same (5), but it is 1 mul instead of 2, so might be
; slightly faster because of pmullw latency. It would also cut our rodata
; tables in half for this function, and save 1-2 registers on x86-64.
pmullw m1, filter_y_a
pmullw m5, filter_y_b
paddw m1, filter_rnd
pmullw m0, filter_y_a
pmullw m4, filter_y_b
paddw m0, filter_rnd
paddw m1, m5
paddw m0, m4
psrlw m1, 4
psrlw m0, 4
%if %2 == 1 ; avg
pavgw m0, [secq]
pavgw m1, [secq+16]
%endif
SUM_SSE m0, m2, m1, m3, m6, m7
lea srcq, [srcq + src_strideq*2]
lea dstq, [dstq + dst_strideq*2]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%else ; %1 < 16
movu m0, [srcq]
movu m1, [srcq+src_strideq*2]
movu m5, [srcq+src_strideq*4]
mova m4, m1
mova m2, [dstq]
mova m3, [dstq+dst_strideq*2]
pmullw m1, filter_y_a
pmullw m5, filter_y_b
paddw m1, filter_rnd
pmullw m0, filter_y_a
pmullw m4, filter_y_b
paddw m0, filter_rnd
paddw m1, m5
paddw m0, m4
psrlw m1, 4
psrlw m0, 4
%if %2 == 1 ; avg
pavgw m0, [secq]
add secq, sec_str
pavgw m1, [secq]
%endif
SUM_SSE m0, m2, m1, m3, m6, m7
lea srcq, [srcq + src_strideq*4]
lea dstq, [dstq + dst_strideq*4]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%endif
dec block_height
jg .x_zero_y_other_loop
%undef filter_y_a
%undef filter_y_b
%undef filter_rnd
STORE_AND_RET
.x_nonzero:
cmp x_offsetd, 8
jne .x_nonhalf
; x_offset == 0.5
test y_offsetd, y_offsetd
jnz .x_half_y_nonzero
; x_offset == 0.5 && y_offset == 0
.x_half_y_zero_loop:
%if %1 == 16
movu m0, [srcq]
movu m1, [srcq + 16]
movu m4, [srcq + 2]
movu m5, [srcq + 18]
mova m2, [dstq]
mova m3, [dstq + 16]
pavgw m0, m4
pavgw m1, m5
%if %2 == 1 ; avg
pavgw m0, [secq]
pavgw m1, [secq+16]
%endif
SUM_SSE m0, m2, m1, m3, m6, m7
lea srcq, [srcq + src_strideq*2]
lea dstq, [dstq + dst_strideq*2]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%else ; %1 < 16
movu m0, [srcq]
movu m1, [srcq + src_strideq*2]
movu m4, [srcq + 2]
movu m5, [srcq + src_strideq*2 + 2]
mova m2, [dstq]
mova m3, [dstq + dst_strideq*2]
pavgw m0, m4
pavgw m1, m5
%if %2 == 1 ; avg
pavgw m0, [secq]
add secq, sec_str
pavgw m1, [secq]
%endif
SUM_SSE m0, m2, m1, m3, m6, m7
lea srcq, [srcq + src_strideq*4]
lea dstq, [dstq + dst_strideq*4]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%endif
dec block_height
jg .x_half_y_zero_loop
STORE_AND_RET
.x_half_y_nonzero:
cmp y_offsetd, 8
jne .x_half_y_nonhalf
; x_offset == 0.5 && y_offset == 0.5
%if %1 == 16
movu m0, [srcq]
movu m1, [srcq+16]
movu m2, [srcq+2]
movu m3, [srcq+18]
lea srcq, [srcq + src_strideq*2]
pavgw m0, m2
pavgw m1, m3
.x_half_y_half_loop:
movu m2, [srcq]
movu m3, [srcq + 16]
movu m4, [srcq + 2]
movu m5, [srcq + 18]
pavgw m2, m4
pavgw m3, m5
pavgw m0, m2
pavgw m1, m3
mova m4, [dstq]
mova m5, [dstq + 16]
%if %2 == 1 ; avg
pavgw m0, [secq]
pavgw m1, [secq+16]
%endif
SUM_SSE m0, m4, m1, m5, m6, m7
mova m0, m2
mova m1, m3
lea srcq, [srcq + src_strideq*2]
lea dstq, [dstq + dst_strideq*2]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%else ; %1 < 16
movu m0, [srcq]
movu m2, [srcq+2]
lea srcq, [srcq + src_strideq*2]
pavgw m0, m2
.x_half_y_half_loop:
movu m2, [srcq]
movu m3, [srcq + src_strideq*2]
movu m4, [srcq + 2]
movu m5, [srcq + src_strideq*2 + 2]
pavgw m2, m4
pavgw m3, m5
pavgw m0, m2
pavgw m2, m3
mova m4, [dstq]
mova m5, [dstq + dst_strideq*2]
%if %2 == 1 ; avg
pavgw m0, [secq]
add secq, sec_str
pavgw m2, [secq]
%endif
SUM_SSE m0, m4, m2, m5, m6, m7
mova m0, m3
lea srcq, [srcq + src_strideq*4]
lea dstq, [dstq + dst_strideq*4]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%endif
dec block_height
jg .x_half_y_half_loop
STORE_AND_RET
.x_half_y_nonhalf:
; x_offset == 0.5 && y_offset == bilin interpolation
%if ARCH_X86_64
lea bilin_filter, [GLOBAL(bilin_filter_m)]
%endif
shl y_offsetd, filter_idx_shift
%if ARCH_X86_64 && mmsize == 16
mova m8, [bilin_filter+y_offsetq]
mova m9, [bilin_filter+y_offsetq+16]
mova m10, [GLOBAL(pw_8)]
%define filter_y_a m8
%define filter_y_b m9
%define filter_rnd m10
%else ; x86_32
%if ARCH_X86=1 && CONFIG_PIC=1
; x_offset == 0.5. We can reuse x_offset reg
%define tempq x_offsetq
add y_offsetq, g_bilin_filterm
%define filter_y_a [y_offsetq]
%define filter_y_b [y_offsetq+16]
mov tempq, g_pw_8m
%define filter_rnd [tempq]
%else
add y_offsetq, bilin_filter
%define filter_y_a [y_offsetq]
%define filter_y_b [y_offsetq+16]
%define filter_rnd [GLOBAL(pw_8)]
%endif
%endif
%if %1 == 16
movu m0, [srcq]
movu m1, [srcq+16]
movu m2, [srcq+2]
movu m3, [srcq+18]
lea srcq, [srcq + src_strideq*2]
pavgw m0, m2
pavgw m1, m3
.x_half_y_other_loop:
movu m2, [srcq]
movu m3, [srcq+16]
movu m4, [srcq+2]
movu m5, [srcq+18]
pavgw m2, m4
pavgw m3, m5
mova m4, m2
mova m5, m3
pmullw m1, filter_y_a
pmullw m3, filter_y_b
paddw m1, filter_rnd
paddw m1, m3
pmullw m0, filter_y_a
pmullw m2, filter_y_b
paddw m0, filter_rnd
psrlw m1, 4
paddw m0, m2
mova m2, [dstq]
psrlw m0, 4
mova m3, [dstq+16]
%if %2 == 1 ; avg
pavgw m0, [secq]
pavgw m1, [secq+16]
%endif
SUM_SSE m0, m2, m1, m3, m6, m7
mova m0, m4
mova m1, m5
lea srcq, [srcq + src_strideq*2]
lea dstq, [dstq + dst_strideq*2]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%else ; %1 < 16
movu m0, [srcq]
movu m2, [srcq+2]
lea srcq, [srcq + src_strideq*2]
pavgw m0, m2
.x_half_y_other_loop:
movu m2, [srcq]
movu m3, [srcq+src_strideq*2]
movu m4, [srcq+2]
movu m5, [srcq+src_strideq*2+2]
pavgw m2, m4
pavgw m3, m5
mova m4, m2
mova m5, m3
pmullw m4, filter_y_a
pmullw m3, filter_y_b
paddw m4, filter_rnd
paddw m4, m3
pmullw m0, filter_y_a
pmullw m2, filter_y_b
paddw m0, filter_rnd
psrlw m4, 4
paddw m0, m2
mova m2, [dstq]
psrlw m0, 4
mova m3, [dstq+dst_strideq*2]
%if %2 == 1 ; avg
pavgw m0, [secq]
add secq, sec_str
pavgw m4, [secq]
%endif
SUM_SSE m0, m2, m4, m3, m6, m7
mova m0, m5
lea srcq, [srcq + src_strideq*4]
lea dstq, [dstq + dst_strideq*4]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%endif
dec block_height
jg .x_half_y_other_loop
%undef filter_y_a
%undef filter_y_b
%undef filter_rnd
STORE_AND_RET
.x_nonhalf:
test y_offsetd, y_offsetd
jnz .x_nonhalf_y_nonzero
; x_offset == bilin interpolation && y_offset == 0
%if ARCH_X86_64
lea bilin_filter, [GLOBAL(bilin_filter_m)]
%endif
shl x_offsetd, filter_idx_shift
%if ARCH_X86_64 && mmsize == 16
mova m8, [bilin_filter+x_offsetq]
mova m9, [bilin_filter+x_offsetq+16]
mova m10, [GLOBAL(pw_8)]
%define filter_x_a m8
%define filter_x_b m9
%define filter_rnd m10
%else ; x86-32
%if ARCH_X86=1 && CONFIG_PIC=1
; y_offset == 0. We can reuse y_offset reg.
%define tempq y_offsetq
add x_offsetq, g_bilin_filterm
%define filter_x_a [x_offsetq]
%define filter_x_b [x_offsetq+16]
mov tempq, g_pw_8m
%define filter_rnd [tempq]
%else
add x_offsetq, bilin_filter
%define filter_x_a [x_offsetq]
%define filter_x_b [x_offsetq+16]
%define filter_rnd [GLOBAL(pw_8)]
%endif
%endif
.x_other_y_zero_loop:
%if %1 == 16
movu m0, [srcq]
movu m1, [srcq+16]
movu m2, [srcq+2]
movu m3, [srcq+18]
mova m4, [dstq]
mova m5, [dstq+16]
pmullw m1, filter_x_a
pmullw m3, filter_x_b
paddw m1, filter_rnd
pmullw m0, filter_x_a
pmullw m2, filter_x_b
paddw m0, filter_rnd
paddw m1, m3
paddw m0, m2
psrlw m1, 4
psrlw m0, 4
%if %2 == 1 ; avg
pavgw m0, [secq]
pavgw m1, [secq+16]
%endif
SUM_SSE m0, m4, m1, m5, m6, m7
lea srcq, [srcq+src_strideq*2]
lea dstq, [dstq+dst_strideq*2]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%else ; %1 < 16
movu m0, [srcq]
movu m1, [srcq+src_strideq*2]
movu m2, [srcq+2]
movu m3, [srcq+src_strideq*2+2]
mova m4, [dstq]
mova m5, [dstq+dst_strideq*2]
pmullw m1, filter_x_a
pmullw m3, filter_x_b
paddw m1, filter_rnd
pmullw m0, filter_x_a
pmullw m2, filter_x_b
paddw m0, filter_rnd
paddw m1, m3
paddw m0, m2
psrlw m1, 4
psrlw m0, 4
%if %2 == 1 ; avg
pavgw m0, [secq]
add secq, sec_str
pavgw m1, [secq]
%endif
SUM_SSE m0, m4, m1, m5, m6, m7
lea srcq, [srcq+src_strideq*4]
lea dstq, [dstq+dst_strideq*4]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%endif
dec block_height
jg .x_other_y_zero_loop
%undef filter_x_a
%undef filter_x_b
%undef filter_rnd
STORE_AND_RET
.x_nonhalf_y_nonzero:
cmp y_offsetd, 8
jne .x_nonhalf_y_nonhalf
; x_offset == bilin interpolation && y_offset == 0.5
%if ARCH_X86_64
lea bilin_filter, [GLOBAL(bilin_filter_m)]
%endif
shl x_offsetd, filter_idx_shift
%if ARCH_X86_64 && mmsize == 16
mova m8, [bilin_filter+x_offsetq]
mova m9, [bilin_filter+x_offsetq+16]
mova m10, [GLOBAL(pw_8)]
%define filter_x_a m8
%define filter_x_b m9
%define filter_rnd m10
%else ; x86-32
%if ARCH_X86=1 && CONFIG_PIC=1
; y_offset == 0.5. We can reuse y_offset reg.
%define tempq y_offsetq
add x_offsetq, g_bilin_filterm
%define filter_x_a [x_offsetq]
%define filter_x_b [x_offsetq+16]
mov tempq, g_pw_8m
%define filter_rnd [tempq]
%else
add x_offsetq, bilin_filter
%define filter_x_a [x_offsetq]
%define filter_x_b [x_offsetq+16]
%define filter_rnd [GLOBAL(pw_8)]
%endif
%endif
%if %1 == 16
movu m0, [srcq]
movu m1, [srcq+16]
movu m2, [srcq+2]
movu m3, [srcq+18]
pmullw m0, filter_x_a
pmullw m2, filter_x_b
paddw m0, filter_rnd
pmullw m1, filter_x_a
pmullw m3, filter_x_b
paddw m1, filter_rnd
paddw m0, m2
paddw m1, m3
psrlw m0, 4
psrlw m1, 4
lea srcq, [srcq+src_strideq*2]
.x_other_y_half_loop:
movu m2, [srcq]
movu m3, [srcq+16]
movu m4, [srcq+2]
movu m5, [srcq+18]
pmullw m2, filter_x_a
pmullw m4, filter_x_b
paddw m2, filter_rnd
pmullw m3, filter_x_a
pmullw m5, filter_x_b
paddw m3, filter_rnd
paddw m2, m4
paddw m3, m5
mova m4, [dstq]
mova m5, [dstq+16]
psrlw m2, 4
psrlw m3, 4
pavgw m0, m2
pavgw m1, m3
%if %2 == 1 ; avg
pavgw m0, [secq]
pavgw m1, [secq+16]
%endif
SUM_SSE m0, m4, m1, m5, m6, m7
mova m0, m2
mova m1, m3
lea srcq, [srcq+src_strideq*2]
lea dstq, [dstq+dst_strideq*2]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%else ; %1 < 16
movu m0, [srcq]
movu m2, [srcq+2]
pmullw m0, filter_x_a
pmullw m2, filter_x_b
paddw m0, filter_rnd
paddw m0, m2
psrlw m0, 4
lea srcq, [srcq+src_strideq*2]
.x_other_y_half_loop:
movu m2, [srcq]
movu m3, [srcq+src_strideq*2]
movu m4, [srcq+2]
movu m5, [srcq+src_strideq*2+2]
pmullw m2, filter_x_a
pmullw m4, filter_x_b
paddw m2, filter_rnd
pmullw m3, filter_x_a
pmullw m5, filter_x_b
paddw m3, filter_rnd
paddw m2, m4
paddw m3, m5
mova m4, [dstq]
mova m5, [dstq+dst_strideq*2]
psrlw m2, 4
psrlw m3, 4
pavgw m0, m2
pavgw m2, m3
%if %2 == 1 ; avg
pavgw m0, [secq]
add secq, sec_str
pavgw m2, [secq]
%endif
SUM_SSE m0, m4, m2, m5, m6, m7
mova m0, m3
lea srcq, [srcq+src_strideq*4]
lea dstq, [dstq+dst_strideq*4]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%endif
dec block_height
jg .x_other_y_half_loop
%undef filter_x_a
%undef filter_x_b
%undef filter_rnd
STORE_AND_RET
.x_nonhalf_y_nonhalf:
; loading filter - this is same as in 8-bit depth
%if ARCH_X86_64
lea bilin_filter, [GLOBAL(bilin_filter_m)]
%endif
shl x_offsetd, filter_idx_shift ; filter_idx_shift = 5
shl y_offsetd, filter_idx_shift
%if ARCH_X86_64 && mmsize == 16
mova m8, [bilin_filter+x_offsetq]
mova m9, [bilin_filter+x_offsetq+16]
mova m10, [bilin_filter+y_offsetq]
mova m11, [bilin_filter+y_offsetq+16]
mova m12, [GLOBAL(pw_8)]
%define filter_x_a m8
%define filter_x_b m9
%define filter_y_a m10
%define filter_y_b m11
%define filter_rnd m12
%else ; x86-32
%if ARCH_X86=1 && CONFIG_PIC=1
; In this case, there is NO unused register. Used src_stride register. Later,
; src_stride has to be loaded from stack when it is needed.
%define tempq src_strideq
mov tempq, g_bilin_filterm
add x_offsetq, tempq
add y_offsetq, tempq
%define filter_x_a [x_offsetq]
%define filter_x_b [x_offsetq+16]
%define filter_y_a [y_offsetq]
%define filter_y_b [y_offsetq+16]
mov tempq, g_pw_8m
%define filter_rnd [tempq]
%else
add x_offsetq, bilin_filter
add y_offsetq, bilin_filter
%define filter_x_a [x_offsetq]
%define filter_x_b [x_offsetq+16]
%define filter_y_a [y_offsetq]
%define filter_y_b [y_offsetq+16]
%define filter_rnd [GLOBAL(pw_8)]
%endif
%endif
; end of load filter
; x_offset == bilin interpolation && y_offset == bilin interpolation
%if %1 == 16
movu m0, [srcq]
movu m2, [srcq+2]
movu m1, [srcq+16]
movu m3, [srcq+18]
pmullw m0, filter_x_a
pmullw m2, filter_x_b
paddw m0, filter_rnd
pmullw m1, filter_x_a
pmullw m3, filter_x_b
paddw m1, filter_rnd
paddw m0, m2
paddw m1, m3
psrlw m0, 4
psrlw m1, 4
INC_SRC_BY_SRC_STRIDE
.x_other_y_other_loop:
movu m2, [srcq]
movu m4, [srcq+2]
movu m3, [srcq+16]
movu m5, [srcq+18]
pmullw m2, filter_x_a
pmullw m4, filter_x_b
paddw m2, filter_rnd
pmullw m3, filter_x_a
pmullw m5, filter_x_b
paddw m3, filter_rnd
paddw m2, m4
paddw m3, m5
psrlw m2, 4
psrlw m3, 4
mova m4, m2
mova m5, m3
pmullw m0, filter_y_a
pmullw m2, filter_y_b
paddw m0, filter_rnd
pmullw m1, filter_y_a
pmullw m3, filter_y_b
paddw m0, m2
paddw m1, filter_rnd
mova m2, [dstq]
paddw m1, m3
psrlw m0, 4
psrlw m1, 4
mova m3, [dstq+16]
%if %2 == 1 ; avg
pavgw m0, [secq]
pavgw m1, [secq+16]
%endif
SUM_SSE m0, m2, m1, m3, m6, m7
mova m0, m4
mova m1, m5
INC_SRC_BY_SRC_STRIDE
lea dstq, [dstq + dst_strideq * 2]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%else ; %1 < 16
movu m0, [srcq]
movu m2, [srcq+2]
pmullw m0, filter_x_a
pmullw m2, filter_x_b
paddw m0, filter_rnd
paddw m0, m2
psrlw m0, 4
INC_SRC_BY_SRC_STRIDE
.x_other_y_other_loop:
movu m2, [srcq]
movu m4, [srcq+2]
INC_SRC_BY_SRC_STRIDE
movu m3, [srcq]
movu m5, [srcq+2]
pmullw m2, filter_x_a
pmullw m4, filter_x_b
paddw m2, filter_rnd
pmullw m3, filter_x_a
pmullw m5, filter_x_b
paddw m3, filter_rnd
paddw m2, m4
paddw m3, m5
psrlw m2, 4
psrlw m3, 4
mova m4, m2
mova m5, m3
pmullw m0, filter_y_a
pmullw m2, filter_y_b
paddw m0, filter_rnd
pmullw m4, filter_y_a
pmullw m3, filter_y_b
paddw m0, m2
paddw m4, filter_rnd
mova m2, [dstq]
paddw m4, m3
psrlw m0, 4
psrlw m4, 4
mova m3, [dstq+dst_strideq*2]
%if %2 == 1 ; avg
pavgw m0, [secq]
add secq, sec_str
pavgw m4, [secq]
%endif
SUM_SSE m0, m2, m4, m3, m6, m7
mova m0, m5
INC_SRC_BY_SRC_STRIDE
lea dstq, [dstq + dst_strideq * 4]
%if %2 == 1 ; avg
add secq, sec_str
%endif
%endif
dec block_height
jg .x_other_y_other_loop
%undef filter_x_a
%undef filter_x_b
%undef filter_y_a
%undef filter_y_b
%undef filter_rnd
STORE_AND_RET
%endmacro
INIT_XMM sse2
SUBPEL_VARIANCE 8
SUBPEL_VARIANCE 16
INIT_XMM sse2
SUBPEL_VARIANCE 8, 1
SUBPEL_VARIANCE 16, 1
|
.model small
.stack 100h
.data
str db 50 dup(0)
y db 'Yes$'
n db 'No$'
a db 0
s db 0
m db 0
crlf db 0dh, 0ah, '$'
.code
printStr MACRO strAddr
push dx
push ax
lea dx, strAddr
mov ah, 9
int 21h
pop ax
pop dx
ENDM
findAsm proc
.IF m == 1
ret
.ENDIF
.IF a == 0
.IF al == 'a'
mov a, 1
.ENDIF
ret
.ENDIF
.IF s == 0
.IF al == 's'
mov s, 1
ret
.ENDIF
.IF al == 'a'
ret
.ENDIF
mov a, 0
ret
.ENDIF
.IF al == 'a'
mov s, 0
ret
.ENDIF
.IF al == 'm'
mov m, 1
ret
.ENDIF
.IF al == 'a'
mov s, 0
ret
.ENDIF
mov a, 0
mov s, 0
ret
findAsm endp
start:
mov ax, @data
mov ds, ax
mov di, 0
lea bx, str
input:
mov ah, 1
int 21h
call findAsm
mov [bx + di], al
inc di
cmp al, 0dh
jne input
mov [bx + di], 0ah
inc di
mov [bx + di], '$'
printStr crlf
printStr str
.IF m == 1
printStr y
.ELSE
printStr n
.ENDIF
mov ah, 4ch
int 21h
end start
|
;Rutinas de operaciones basicas con numeros de 16,24 y 32 bits.
VAR1 .EQU 090h
VAR2 .equ 094h
Inicio: LD HL,VAR1 ;Cargamos la direcion del primer numero en HL
;LD DE,VAR2 ;Cargamos la direcion del segundo numero en DE
CALL CPL16 ;Hacemos la resta (VAR1)=(DE)-(HL)
HALT
JP FIN
;/////////////////////////////////////////////////////////////
;Rutinas para complementar numeros de 16,24 y 32 bits
;La direccion del dato a complementar se debe guardar en HL
;
;
;
;Ejemplo
; LD HL,VAR1 ;Cargamos el apuntador a la variable en HL
; CALL CPL16 ;Complementamos el contenido de la variable
; ;(VAR1)= !(VAR1)
CPL16: LD B,2
JP CPL_
CPL24: LD B,3
JP CPL_
CPL32: LD B,4
JP CPL_
CPL_ LD A,(HL)
CPL
LD (HL),A
INC HL
DJNZ CPL_
RET
;/////////////////////////////////////////////////////////////
;/////////////////////////////////////////////////////////////
;Rutinas para incrementar numeros de 16,24 y 32 bits
;La direccion del dato a incrementar se debe guardar en HL
;
;
;
;Ejemplo
; LD HL,VAR1 ;Cargamos el apuntador a la variable en HL
; CALL INC16 ;Incrementamos el contenido de la variable
; ; (VAR1)= (VAR1)+1
INC16: LD B,2
JP INC_
INC24: LD B,3
JP INC_
INC32: LD B,4
JP INC_
INC_ LD A,0FFh
INC A
CINC_: LD A,(HL)
ADC A,0
LD (HL),A
INC HL
DJNZ CINC_
RET
;/////////////////////////////////////////////////////////////
;/////////////////////////////////////////////////////////////
;Rutinas para sumar numeros de 16,24 y 32 bits
;Las direcciones de los datos a sumar se deben guardar
;en HL y DE, y el resultado se guarda en al direccion de la
;variable asignada a HL
;
;Ejemplo
; LD DE,VAR1 ;Cargamos el apuntador a la variable 1 en DE
; LD HL,VAR2 ;Cargamos el apuntador a la variable 2 en HL
; CALL SUMA32 ; (VAR2)=(HL)+(DE)
SUMA16:
LD B,2
JP SUMA_
SUMA24:
LD B,3
JP SUMA_
SUMA32:
LD B,4
JP SUMA_
SUMA_:
OR A
CSUMA_:
LD A,(DE)
ADC A,(HL)
LD (HL),A
INC DE
INC HL
DJNZ CSUMA_
RET
;/////////////////////////////////////////////////////////////
;/////////////////////////////////////////////////////////////
;Rutinas para restar numeros de 16,24 y 32 bits
;Las direcciones de los datos a restar se deben guardar
;en HL y DE, y el resultado se guarda en al direccion de la
;variable asignada a HL. Se realiza [(HL)=(DE)-(HL)]
;
;Ejemplo
; LD DE,VAR1 ;Cargamos el apuntador a la variable 1 en DE
; LD HL,VAR2 ;Cargamos el apuntador a la variable 1 en DE
; CALL RESTA32 ;Hacemos la resta (VAR2)=(DE)-(HL)
RESTA16: LD B,2
JP RESTA_
RESTA24: LD B,3
JP RESTA_
RESTA32: LD B,4
JP RESTA_
RESTA_: OR A
CRES_: LD A,(DE)
SBC A,(HL)
LD (HL),A
INC DE
INC HL
DJNZ CRES_
RET
;/////////////////////////////////////////////////////////////
FIN: HALT
|
;
; Z88dk Generic Floating Point Math Library
;
; Normalise 48bit number in c ix de b
; current exponent in fa+5
; Result -> fa +5
;
; $Id: norm_noaf.asm,v 1.1 2012/04/17 16:37:46 stefano Exp $:
XLIB norm
LIB pack
LIB norm4
LIB afswap
XREF fa
.NORM LD L,B
LD H,E
XOR A
.NORM2 LD B,A
LD A,C
OR A
JR NZ,NORM12 ;nz => 7 or fewer shifts needed
; shift c ix d hl left by one byte
LD C,IXH
LD A,IXL
LD IXH,A
LD IXL,D
XOR A
LD D,H
LD H,L
LD L,A ;...end of shifting
;
LD A,B
SUB 8 ;adjust exponent
CP $D0
JR NZ,NORM2
jp norm4
;
.NORM8 DEC B
; shift c ix d hl left one bit...
ADD HL,HL
RL D
;EX AF,AF'
call afswap
ADD IX,IX
;EX AF,AF'
call afswap
JR NC,NORM10
INC IX
.NORM10 ;EX AF,AF'
call afswap
RL C ;...end of shifting
;
.NORM12 JP P,NORM8 ;p => high order bit still zero
LD A,B
; move number to c ix de b
LD E,H
LD B,L
OR A
JP Z,PACK ;z => exponent unchanged
LD HL,FA+5 ;update exponent
ADD A,(HL)
LD (HL),A
Jp NC,NORM4 ;nc => underflow (set to 0)
RET Z ;z => underflow (leave as 0)
jp pack
|
; A136690: Final nonzero digit of n! in base 3.
; 1,1,2,2,2,1,2,2,1,1,1,2,2,2,1,2,2,1,2,2,1,1,1,2,1,1,2,2,2,1,1,1,2,1,1,2,2,2,1,1,1,2,1,1,2,1,1,2,2,2,1,2,2,1,2,2,1,1,1,2,1,1,2,2,2,1,1,1,2,1,1,2,1,1,2,2,2,1,2,2,1,1,1,2,2,2,1,2,2,1,1,1,2,2,2,1,2,2,1,2,2,1,1,1,2
lpb $0
add $1,$0
div $0,3
sub $1,$0
div $1,2
mod $1,2
mul $1,2
lpe
div $1,2
add $1,1
|
; A025966: Expansion of 1/((1-2x)(1-4x)(1-6x)(1-8x)).
; Submitted by Jon Maiga
; 1,20,260,2800,27216,248640,2182720,18656000,156544256,1296655360,10641146880,86744985600,703688298496,5688011079680,45855653642240,368956766617600,2964331947687936,23790756829593600
mov $1,$0
mov $0,2
pow $0,$1
seq $1,453 ; Stirling numbers of the second kind, S(n,4).
mul $1,$0
mov $0,$1
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1b4b9, %r14
nop
cmp %r10, %r10
movw $0x6162, (%r14)
nop
nop
nop
nop
dec %r10
lea addresses_normal_ht+0x3ca1, %rsi
lea addresses_WC_ht+0x14cb9, %rdi
clflush (%rdi)
nop
nop
nop
xor %r15, %r15
mov $126, %rcx
rep movsq
nop
nop
nop
xor %r15, %r15
lea addresses_D_ht+0x194b9, %rsi
lea addresses_WT_ht+0x2821, %rdi
nop
sub %rbp, %rbp
mov $15, %rcx
rep movsb
nop
nop
and %r15, %r15
lea addresses_WC_ht+0x9b1, %rcx
nop
nop
nop
inc %r14
mov (%rcx), %r10d
nop
nop
nop
nop
add $47597, %r10
lea addresses_D_ht+0x9a99, %rsi
lea addresses_WC_ht+0x5679, %rdi
xor %r10, %r10
mov $61, %rcx
rep movsb
nop
nop
nop
nop
nop
add $59360, %rdi
lea addresses_D_ht+0xfd25, %rsi
lea addresses_WT_ht+0x1188b, %rdi
nop
nop
nop
nop
xor $3695, %rbp
mov $59, %rcx
rep movsl
nop
inc %r10
lea addresses_normal_ht+0xd13b, %rsi
lea addresses_UC_ht+0x339, %rdi
clflush (%rsi)
nop
nop
cmp %rax, %rax
mov $116, %rcx
rep movsq
nop
nop
nop
xor %r14, %r14
lea addresses_normal_ht+0x7eb9, %rsi
cmp %r15, %r15
vmovups (%rsi), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %rdi
nop
nop
nop
nop
nop
cmp $51078, %r14
lea addresses_normal_ht+0x62b9, %r14
nop
nop
nop
nop
add $13933, %rax
mov (%r14), %r15
nop
nop
nop
and $60889, %rsi
lea addresses_normal_ht+0x49f9, %rsi
nop
and $12800, %r14
mov (%rsi), %ax
dec %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r8
push %rbx
push %rcx
push %rdx
push %rsi
// Store
lea addresses_PSE+0x1efb9, %r12
nop
add %rcx, %rcx
mov $0x5152535455565758, %rbx
movq %rbx, (%r12)
nop
nop
nop
and %rdx, %rdx
// Store
mov $0x7c9, %r8
nop
nop
nop
nop
nop
dec %r11
movw $0x5152, (%r8)
nop
nop
nop
nop
sub $10496, %rdx
// Store
lea addresses_UC+0xd489, %rsi
nop
nop
nop
nop
sub $11585, %r8
movl $0x51525354, (%rsi)
nop
inc %rsi
// Store
lea addresses_PSE+0x9b81, %rcx
nop
nop
inc %r12
mov $0x5152535455565758, %r11
movq %r11, %xmm7
vmovups %ymm7, (%rcx)
nop
nop
nop
xor %rsi, %rsi
// Store
lea addresses_PSE+0xb779, %rbx
dec %rcx
movw $0x5152, (%rbx)
nop
nop
and %r12, %r12
// Load
lea addresses_A+0x15eb9, %r11
clflush (%r11)
nop
nop
nop
nop
xor $39495, %rbx
mov (%r11), %cx
nop
sub %rcx, %rcx
// Faulty Load
mov $0x2b9, %rcx
cmp $13397, %r11
vmovntdqa (%rcx), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r8
lea oracles, %rsi
and $0xff, %r8
shlq $12, %r8
mov (%rsi,%r8,1), %r8
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %r8
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_P', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_PSE', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_P', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_UC', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_PSE', 'size': 2, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_A', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_P', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 6, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
;
; jiss2flt.asm - floating-point IDCT (SSE & SSE2)
;
; x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
;
; This file contains a floating-point implementation of the inverse DCT
; (Discrete Cosine Transform). The following code is based directly on
; the IJG's original jidctflt.c; see the jidctflt.c for more details.
;
; Last Modified : February 4, 2006
;
; [TAB8]
%include "jsimdext.inc"
%include "jdct.inc"
%ifdef DCT_FLOAT_SUPPORTED
%ifdef JIDCT_FLT_SSE_SSE2_SUPPORTED
; This module is specialized to the case DCTSIZE = 8.
;
%if DCTSIZE != 8
%error "Sorry, this code only copes with 8x8 DCTs."
%endif
; --------------------------------------------------------------------------
%macro unpcklps2 2 ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)
shufps %1,%2,0x44
%endmacro
%macro unpckhps2 2 ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)
shufps %1,%2,0xEE
%endmacro
; --------------------------------------------------------------------------
SECTION SEG_CONST
alignz 16
global EXTN(jconst_idct_float_sse2)
EXTN(jconst_idct_float_sse2):
PD_1_414 times 4 dd 1.414213562373095048801689
PD_1_847 times 4 dd 1.847759065022573512256366
PD_1_082 times 4 dd 1.082392200292393968799446
PD_M2_613 times 4 dd -2.613125929752753055713286
PD_RNDINT_MAGIC times 4 dd 100663296.0 ; (float)(0x00C00000 << 3)
PB_CENTERJSAMP times 16 db CENTERJSAMPLE
alignz 16
; --------------------------------------------------------------------------
SECTION SEG_TEXT
BITS 32
;
; Perform dequantization and inverse DCT on one block of coefficients.
;
; GLOBAL(void)
; jpeg_idct_float_sse2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
; JCOEFPTR coef_block,
; JSAMPARRAY output_buf, JDIMENSION output_col)
;
%define cinfo(b) (b)+8 ; j_decompress_ptr cinfo
%define compptr(b) (b)+12 ; jpeg_component_info * compptr
%define coef_block(b) (b)+16 ; JCOEFPTR coef_block
%define output_buf(b) (b)+20 ; JSAMPARRAY output_buf
%define output_col(b) (b)+24 ; JDIMENSION output_col
%define original_ebp ebp+0
%define wk(i) ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]
%define WK_NUM 2
%define workspace wk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT
; FAST_FLOAT workspace[DCTSIZE2]
align 16
global EXTN(jpeg_idct_float_sse2)
EXTN(jpeg_idct_float_sse2):
push ebp
mov eax,esp ; eax = original ebp
sub esp, byte 4
and esp, byte (-SIZEOF_XMMWORD) ; align to 128 bits
mov [esp],eax
mov ebp,esp ; ebp = aligned ebp
lea esp, [workspace]
push ebx
; push ecx ; need not be preserved
; push edx ; need not be preserved
push esi
push edi
get_GOT ebx ; get GOT address
; ---- Pass 1: process columns from input, store into work array.
; mov eax, [original_ebp]
mov edx, POINTER [compptr(eax)]
mov edx, POINTER [jcompinfo_dct_table(edx)] ; quantptr
mov esi, JCOEFPTR [coef_block(eax)] ; inptr
lea edi, [workspace] ; FAST_FLOAT * wsptr
mov ecx, DCTSIZE/4 ; ctr
alignx 16,7
.columnloop:
%ifndef NO_ZERO_COLUMN_TEST_FLOAT_SSE
mov eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]
or eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]
jnz near .columnDCT
movq xmm1, _MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]
movq xmm2, _MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]
movq xmm3, _MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]
movq xmm4, _MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]
movq xmm5, _MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]
movq xmm6, _MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]
movq xmm7, _MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]
por xmm1,xmm2
por xmm3,xmm4
por xmm5,xmm6
por xmm1,xmm3
por xmm5,xmm7
por xmm1,xmm5
packsswb xmm1,xmm1
movd eax,xmm1
test eax,eax
jnz short .columnDCT
; -- AC terms all zero
movq xmm0, _MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]
punpcklwd xmm0,xmm0 ; xmm0=(00 00 01 01 02 02 03 03)
psrad xmm0,(DWORD_BIT-WORD_BIT) ; xmm0=in0=(00 01 02 03)
cvtdq2ps xmm0,xmm0 ; xmm0=in0=(00 01 02 03)
mulps xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
movaps xmm1,xmm0
movaps xmm2,xmm0
movaps xmm3,xmm0
shufps xmm0,xmm0,0x00 ; xmm0=(00 00 00 00)
shufps xmm1,xmm1,0x55 ; xmm1=(01 01 01 01)
shufps xmm2,xmm2,0xAA ; xmm2=(02 02 02 02)
shufps xmm3,xmm3,0xFF ; xmm3=(03 03 03 03)
movaps XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm0
movaps XMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm0
movaps XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm1
movaps XMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm1
movaps XMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm2
movaps XMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm2
movaps XMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm3
movaps XMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3
jmp near .nextcolumn
alignx 16,7
%endif
.columnDCT:
; -- Even part
movq xmm0, _MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]
movq xmm1, _MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]
movq xmm2, _MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]
movq xmm3, _MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]
punpcklwd xmm0,xmm0 ; xmm0=(00 00 01 01 02 02 03 03)
punpcklwd xmm1,xmm1 ; xmm1=(20 20 21 21 22 22 23 23)
psrad xmm0,(DWORD_BIT-WORD_BIT) ; xmm0=in0=(00 01 02 03)
psrad xmm1,(DWORD_BIT-WORD_BIT) ; xmm1=in2=(20 21 22 23)
cvtdq2ps xmm0,xmm0 ; xmm0=in0=(00 01 02 03)
cvtdq2ps xmm1,xmm1 ; xmm1=in2=(20 21 22 23)
punpcklwd xmm2,xmm2 ; xmm2=(40 40 41 41 42 42 43 43)
punpcklwd xmm3,xmm3 ; xmm3=(60 60 61 61 62 62 63 63)
psrad xmm2,(DWORD_BIT-WORD_BIT) ; xmm2=in4=(40 41 42 43)
psrad xmm3,(DWORD_BIT-WORD_BIT) ; xmm3=in6=(60 61 62 63)
cvtdq2ps xmm2,xmm2 ; xmm2=in4=(40 41 42 43)
cvtdq2ps xmm3,xmm3 ; xmm3=in6=(60 61 62 63)
mulps xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
mulps xmm1, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
mulps xmm2, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
mulps xmm3, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
movaps xmm4,xmm0
movaps xmm5,xmm1
subps xmm0,xmm2 ; xmm0=tmp11
subps xmm1,xmm3
addps xmm4,xmm2 ; xmm4=tmp10
addps xmm5,xmm3 ; xmm5=tmp13
mulps xmm1,[GOTOFF(ebx,PD_1_414)]
subps xmm1,xmm5 ; xmm1=tmp12
movaps xmm6,xmm4
movaps xmm7,xmm0
subps xmm4,xmm5 ; xmm4=tmp3
subps xmm0,xmm1 ; xmm0=tmp2
addps xmm6,xmm5 ; xmm6=tmp0
addps xmm7,xmm1 ; xmm7=tmp1
movaps XMMWORD [wk(1)], xmm4 ; tmp3
movaps XMMWORD [wk(0)], xmm0 ; tmp2
; -- Odd part
movq xmm2, _MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]
movq xmm3, _MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]
movq xmm5, _MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]
movq xmm1, _MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]
punpcklwd xmm2,xmm2 ; xmm2=(10 10 11 11 12 12 13 13)
punpcklwd xmm3,xmm3 ; xmm3=(30 30 31 31 32 32 33 33)
psrad xmm2,(DWORD_BIT-WORD_BIT) ; xmm2=in1=(10 11 12 13)
psrad xmm3,(DWORD_BIT-WORD_BIT) ; xmm3=in3=(30 31 32 33)
cvtdq2ps xmm2,xmm2 ; xmm2=in1=(10 11 12 13)
cvtdq2ps xmm3,xmm3 ; xmm3=in3=(30 31 32 33)
punpcklwd xmm5,xmm5 ; xmm5=(50 50 51 51 52 52 53 53)
punpcklwd xmm1,xmm1 ; xmm1=(70 70 71 71 72 72 73 73)
psrad xmm5,(DWORD_BIT-WORD_BIT) ; xmm5=in5=(50 51 52 53)
psrad xmm1,(DWORD_BIT-WORD_BIT) ; xmm1=in7=(70 71 72 73)
cvtdq2ps xmm5,xmm5 ; xmm5=in5=(50 51 52 53)
cvtdq2ps xmm1,xmm1 ; xmm1=in7=(70 71 72 73)
mulps xmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
mulps xmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
mulps xmm5, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
mulps xmm1, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
movaps xmm4,xmm2
movaps xmm0,xmm5
addps xmm2,xmm1 ; xmm2=z11
addps xmm5,xmm3 ; xmm5=z13
subps xmm4,xmm1 ; xmm4=z12
subps xmm0,xmm3 ; xmm0=z10
movaps xmm1,xmm2
subps xmm2,xmm5
addps xmm1,xmm5 ; xmm1=tmp7
mulps xmm2,[GOTOFF(ebx,PD_1_414)] ; xmm2=tmp11
movaps xmm3,xmm0
addps xmm0,xmm4
mulps xmm0,[GOTOFF(ebx,PD_1_847)] ; xmm0=z5
mulps xmm3,[GOTOFF(ebx,PD_M2_613)] ; xmm3=(z10 * -2.613125930)
mulps xmm4,[GOTOFF(ebx,PD_1_082)] ; xmm4=(z12 * 1.082392200)
addps xmm3,xmm0 ; xmm3=tmp12
subps xmm4,xmm0 ; xmm4=tmp10
; -- Final output stage
subps xmm3,xmm1 ; xmm3=tmp6
movaps xmm5,xmm6
movaps xmm0,xmm7
addps xmm6,xmm1 ; xmm6=data0=(00 01 02 03)
addps xmm7,xmm3 ; xmm7=data1=(10 11 12 13)
subps xmm5,xmm1 ; xmm5=data7=(70 71 72 73)
subps xmm0,xmm3 ; xmm0=data6=(60 61 62 63)
subps xmm2,xmm3 ; xmm2=tmp5
movaps xmm1,xmm6 ; transpose coefficients(phase 1)
unpcklps xmm6,xmm7 ; xmm6=(00 10 01 11)
unpckhps xmm1,xmm7 ; xmm1=(02 12 03 13)
movaps xmm3,xmm0 ; transpose coefficients(phase 1)
unpcklps xmm0,xmm5 ; xmm0=(60 70 61 71)
unpckhps xmm3,xmm5 ; xmm3=(62 72 63 73)
movaps xmm7, XMMWORD [wk(0)] ; xmm7=tmp2
movaps xmm5, XMMWORD [wk(1)] ; xmm5=tmp3
movaps XMMWORD [wk(0)], xmm0 ; wk(0)=(60 70 61 71)
movaps XMMWORD [wk(1)], xmm3 ; wk(1)=(62 72 63 73)
addps xmm4,xmm2 ; xmm4=tmp4
movaps xmm0,xmm7
movaps xmm3,xmm5
addps xmm7,xmm2 ; xmm7=data2=(20 21 22 23)
addps xmm5,xmm4 ; xmm5=data4=(40 41 42 43)
subps xmm0,xmm2 ; xmm0=data5=(50 51 52 53)
subps xmm3,xmm4 ; xmm3=data3=(30 31 32 33)
movaps xmm2,xmm7 ; transpose coefficients(phase 1)
unpcklps xmm7,xmm3 ; xmm7=(20 30 21 31)
unpckhps xmm2,xmm3 ; xmm2=(22 32 23 33)
movaps xmm4,xmm5 ; transpose coefficients(phase 1)
unpcklps xmm5,xmm0 ; xmm5=(40 50 41 51)
unpckhps xmm4,xmm0 ; xmm4=(42 52 43 53)
movaps xmm3,xmm6 ; transpose coefficients(phase 2)
unpcklps2 xmm6,xmm7 ; xmm6=(00 10 20 30)
unpckhps2 xmm3,xmm7 ; xmm3=(01 11 21 31)
movaps xmm0,xmm1 ; transpose coefficients(phase 2)
unpcklps2 xmm1,xmm2 ; xmm1=(02 12 22 32)
unpckhps2 xmm0,xmm2 ; xmm0=(03 13 23 33)
movaps xmm7, XMMWORD [wk(0)] ; xmm7=(60 70 61 71)
movaps xmm2, XMMWORD [wk(1)] ; xmm2=(62 72 63 73)
movaps XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm6
movaps XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm3
movaps XMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm1
movaps XMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm0
movaps xmm6,xmm5 ; transpose coefficients(phase 2)
unpcklps2 xmm5,xmm7 ; xmm5=(40 50 60 70)
unpckhps2 xmm6,xmm7 ; xmm6=(41 51 61 71)
movaps xmm3,xmm4 ; transpose coefficients(phase 2)
unpcklps2 xmm4,xmm2 ; xmm4=(42 52 62 72)
unpckhps2 xmm3,xmm2 ; xmm3=(43 53 63 73)
movaps XMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm5
movaps XMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm6
movaps XMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm4
movaps XMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3
.nextcolumn:
add esi, byte 4*SIZEOF_JCOEF ; coef_block
add edx, byte 4*SIZEOF_FLOAT_MULT_TYPE ; quantptr
add edi, 4*DCTSIZE*SIZEOF_FAST_FLOAT ; wsptr
dec ecx ; ctr
jnz near .columnloop
; -- Prefetch the next coefficient block
prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]
prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]
prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]
prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]
; ---- Pass 2: process rows from work array, store into output array.
mov eax, [original_ebp]
lea esi, [workspace] ; FAST_FLOAT * wsptr
mov edi, JSAMPARRAY [output_buf(eax)] ; (JSAMPROW *)
mov eax, JDIMENSION [output_col(eax)]
mov ecx, DCTSIZE/4 ; ctr
alignx 16,7
.rowloop:
; -- Even part
movaps xmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]
movaps xmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_FAST_FLOAT)]
movaps xmm2, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_FAST_FLOAT)]
movaps xmm3, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_FAST_FLOAT)]
movaps xmm4,xmm0
movaps xmm5,xmm1
subps xmm0,xmm2 ; xmm0=tmp11
subps xmm1,xmm3
addps xmm4,xmm2 ; xmm4=tmp10
addps xmm5,xmm3 ; xmm5=tmp13
mulps xmm1,[GOTOFF(ebx,PD_1_414)]
subps xmm1,xmm5 ; xmm1=tmp12
movaps xmm6,xmm4
movaps xmm7,xmm0
subps xmm4,xmm5 ; xmm4=tmp3
subps xmm0,xmm1 ; xmm0=tmp2
addps xmm6,xmm5 ; xmm6=tmp0
addps xmm7,xmm1 ; xmm7=tmp1
movaps XMMWORD [wk(1)], xmm4 ; tmp3
movaps XMMWORD [wk(0)], xmm0 ; tmp2
; -- Odd part
movaps xmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]
movaps xmm3, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_FAST_FLOAT)]
movaps xmm5, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_FAST_FLOAT)]
movaps xmm1, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_FAST_FLOAT)]
movaps xmm4,xmm2
movaps xmm0,xmm5
addps xmm2,xmm1 ; xmm2=z11
addps xmm5,xmm3 ; xmm5=z13
subps xmm4,xmm1 ; xmm4=z12
subps xmm0,xmm3 ; xmm0=z10
movaps xmm1,xmm2
subps xmm2,xmm5
addps xmm1,xmm5 ; xmm1=tmp7
mulps xmm2,[GOTOFF(ebx,PD_1_414)] ; xmm2=tmp11
movaps xmm3,xmm0
addps xmm0,xmm4
mulps xmm0,[GOTOFF(ebx,PD_1_847)] ; xmm0=z5
mulps xmm3,[GOTOFF(ebx,PD_M2_613)] ; xmm3=(z10 * -2.613125930)
mulps xmm4,[GOTOFF(ebx,PD_1_082)] ; xmm4=(z12 * 1.082392200)
addps xmm3,xmm0 ; xmm3=tmp12
subps xmm4,xmm0 ; xmm4=tmp10
; -- Final output stage
subps xmm3,xmm1 ; xmm3=tmp6
movaps xmm5,xmm6
movaps xmm0,xmm7
addps xmm6,xmm1 ; xmm6=data0=(00 10 20 30)
addps xmm7,xmm3 ; xmm7=data1=(01 11 21 31)
subps xmm5,xmm1 ; xmm5=data7=(07 17 27 37)
subps xmm0,xmm3 ; xmm0=data6=(06 16 26 36)
subps xmm2,xmm3 ; xmm2=tmp5
movaps xmm1,[GOTOFF(ebx,PD_RNDINT_MAGIC)] ; xmm1=[PD_RNDINT_MAGIC]
pcmpeqd xmm3,xmm3
psrld xmm3,WORD_BIT ; xmm3={0xFFFF 0x0000 0xFFFF 0x0000 ..}
addps xmm6,xmm1 ; xmm6=roundint(data0/8)=(00 ** 10 ** 20 ** 30 **)
addps xmm7,xmm1 ; xmm7=roundint(data1/8)=(01 ** 11 ** 21 ** 31 **)
addps xmm0,xmm1 ; xmm0=roundint(data6/8)=(06 ** 16 ** 26 ** 36 **)
addps xmm5,xmm1 ; xmm5=roundint(data7/8)=(07 ** 17 ** 27 ** 37 **)
pand xmm6,xmm3 ; xmm6=(00 -- 10 -- 20 -- 30 --)
pslld xmm7,WORD_BIT ; xmm7=(-- 01 -- 11 -- 21 -- 31)
pand xmm0,xmm3 ; xmm0=(06 -- 16 -- 26 -- 36 --)
pslld xmm5,WORD_BIT ; xmm5=(-- 07 -- 17 -- 27 -- 37)
por xmm6,xmm7 ; xmm6=(00 01 10 11 20 21 30 31)
por xmm0,xmm5 ; xmm0=(06 07 16 17 26 27 36 37)
movaps xmm1, XMMWORD [wk(0)] ; xmm1=tmp2
movaps xmm3, XMMWORD [wk(1)] ; xmm3=tmp3
addps xmm4,xmm2 ; xmm4=tmp4
movaps xmm7,xmm1
movaps xmm5,xmm3
addps xmm1,xmm2 ; xmm1=data2=(02 12 22 32)
addps xmm3,xmm4 ; xmm3=data4=(04 14 24 34)
subps xmm7,xmm2 ; xmm7=data5=(05 15 25 35)
subps xmm5,xmm4 ; xmm5=data3=(03 13 23 33)
movaps xmm2,[GOTOFF(ebx,PD_RNDINT_MAGIC)] ; xmm2=[PD_RNDINT_MAGIC]
pcmpeqd xmm4,xmm4
psrld xmm4,WORD_BIT ; xmm4={0xFFFF 0x0000 0xFFFF 0x0000 ..}
addps xmm3,xmm2 ; xmm3=roundint(data4/8)=(04 ** 14 ** 24 ** 34 **)
addps xmm7,xmm2 ; xmm7=roundint(data5/8)=(05 ** 15 ** 25 ** 35 **)
addps xmm1,xmm2 ; xmm1=roundint(data2/8)=(02 ** 12 ** 22 ** 32 **)
addps xmm5,xmm2 ; xmm5=roundint(data3/8)=(03 ** 13 ** 23 ** 33 **)
pand xmm3,xmm4 ; xmm3=(04 -- 14 -- 24 -- 34 --)
pslld xmm7,WORD_BIT ; xmm7=(-- 05 -- 15 -- 25 -- 35)
pand xmm1,xmm4 ; xmm1=(02 -- 12 -- 22 -- 32 --)
pslld xmm5,WORD_BIT ; xmm5=(-- 03 -- 13 -- 23 -- 33)
por xmm3,xmm7 ; xmm3=(04 05 14 15 24 25 34 35)
por xmm1,xmm5 ; xmm1=(02 03 12 13 22 23 32 33)
movdqa xmm2,[GOTOFF(ebx,PB_CENTERJSAMP)] ; xmm2=[PB_CENTERJSAMP]
packsswb xmm6,xmm3 ; xmm6=(00 01 10 11 20 21 30 31 04 05 14 15 24 25 34 35)
packsswb xmm1,xmm0 ; xmm1=(02 03 12 13 22 23 32 33 06 07 16 17 26 27 36 37)
paddb xmm6,xmm2
paddb xmm1,xmm2
movdqa xmm4,xmm6 ; transpose coefficients(phase 2)
punpcklwd xmm6,xmm1 ; xmm6=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)
punpckhwd xmm4,xmm1 ; xmm4=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)
movdqa xmm7,xmm6 ; transpose coefficients(phase 3)
punpckldq xmm6,xmm4 ; xmm6=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)
punpckhdq xmm7,xmm4 ; xmm7=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)
pshufd xmm5,xmm6,0x4E ; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)
pshufd xmm3,xmm7,0x4E ; xmm3=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)
pushpic ebx ; save GOT address
mov edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]
mov ebx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]
movq _MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm6
movq _MMWORD [ebx+eax*SIZEOF_JSAMPLE], xmm7
mov edx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]
mov ebx, JSAMPROW [edi+3*SIZEOF_JSAMPROW]
movq _MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm5
movq _MMWORD [ebx+eax*SIZEOF_JSAMPLE], xmm3
poppic ebx ; restore GOT address
add esi, byte 4*SIZEOF_FAST_FLOAT ; wsptr
add edi, byte 4*SIZEOF_JSAMPROW
dec ecx ; ctr
jnz near .rowloop
pop edi
pop esi
; pop edx ; need not be preserved
; pop ecx ; need not be preserved
pop ebx
mov esp,ebp ; esp <- aligned ebp
pop esp ; esp <- original ebp
pop ebp
ret
%endif ; JIDCT_FLT_SSE_SSE2_SUPPORTED
%endif ; DCT_FLOAT_SUPPORTED
|
// MEGA65 DMA test using memset
// Appendix J in https://mega.scryptos.com/sharefolder-link/MEGA/MEGA65+filehost/Docs/MEGA65-Book_draft.pdf
/// @file
/// Functions for using the F018 DMA for very fast copying or filling of memory
/// @file
/// MEGA65 Registers and Constants
/// @file
/// The MOS 6526 Complex Interface Adapter (CIA)
///
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.cpu _45gs02
// MEGA65 platform PRG executable starting in MEGA65 mode.
.file [name="dma-test5.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$2001]
.segmentdef Code [start=$2017]
.segmentdef Data [startAfter="Code"]
.segment Basic
.byte $0a, $20, $0a, $00, $fe, $02, $20, $30, $00 // 10 BANK 0
.byte $15, $20, $14, $00, $9e, $20 // 20 SYS
.text toIntString(main) // NNNN
.byte $00, $00, $00 //
/// DMA command fill
.const DMA_COMMAND_FILL = 3
.const OFFSET_STRUCT_F018_DMAGIC_EN018B = 3
.const OFFSET_STRUCT_DMA_LIST_F018B_COUNT = 1
.const OFFSET_STRUCT_DMA_LIST_F018B_SRC = 3
.const OFFSET_STRUCT_DMA_LIST_F018B_DEST = 6
.const OFFSET_STRUCT_F018_DMAGIC_ADDRMB = 4
.const OFFSET_STRUCT_F018_DMAGIC_ADDRBANK = 2
.const OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = 1
/// DMAgic F018 Controller
.label DMA = $d700
/// Default address of screen character matrix
.label DEFAULT_SCREEN = $800
.segment Code
main: {
// memoryRemap(0,0,0)
// Map memory to BANK 0 : 0x00XXXX - giving access to I/O
jsr memoryRemap
// memset_dma(DEFAULT_SCREEN, '*', 80*10)
// Fill screen up using DMA
jsr memset_dma
// }
rts
}
// Remap some of the eight 8K memory blocks in the 64K address space of the 6502 to point somewhere else in the first 1MB memory space of the MEGA65.
// After the remapping the CPU will access the mapped memory whenever it uses instructions that access a remapped block.
// See section 2.3.4 in http://www.zimmers.net/cbmpics/cbm/c65/c65manual.txt for a description of the CPU memory remapper of the C65.
// remapBlocks: Indicates which 8K blocks of the 6502 address space to remap. Each bit represents one 8K block
// - bit 0 Memory block $0000-$1fff. Use constant MEMORYBLOCK_0000.
// - bit 1 Memory block $2000-$3fff. Use constant MEMORYBLOCK_2000.
// - bit 2 Memory block $4000-$5fff. Use constant MEMORYBLOCK_4000.
// - bit 3 Memory block $6000-$7fff. Use constant MEMORYBLOCK_6000.
// - bit 4 Memory block $8000-$9fff. Use constant MEMORYBLOCK_8000.
// - bit 5 Memory block $a000-$bfff. Use constant MEMORYBLOCK_A000.
// - bit 6 Memory block $c000-$dfff. Use constant MEMORYBLOCK_C000.
// - bit 7 Memory block $e000-$ffff. Use constant MEMORYBLOCK_E000.
// lowerPageOffset: Offset that will be added to any remapped blocks in the lower 32K of memory (block 0-3).
// The offset is a page offset (meaning it is multiplied by 0x100). Only the lower 12bits of the passed value is used.
// - If block 0 ($0000-$1fff) is remapped it will point to lowerPageOffset*$100.
// - If block 1 ($2000-$3fff) is remapped it will point to lowerPageOffset*$100 + $2000.
// - If block 2 ($4000-$5fff) is remapped it will point to lowerPageOffset*$100 + $4000.
// - If block 3 ($6000-$7fff) is remapped it will point to lowerPageOffset*$100 + $6000.
// upperPageOffset: Offset that will be added to any remapped blocks in the upper 32K of memory (block 4-7).
// The offset is a page offset (meaning it is multiplied by 0x100). Only the lower 12bits of the passed value is used.
// - If block 4 ($8000-$9fff) is remapped it will point to upperPageOffset*$100 + $8000
// - If block 5 ($a000-$bfff) is remapped it will point to upperPageOffset*$100 + $a000.
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
// void memoryRemap(char remapBlocks, unsigned int lowerPageOffset, unsigned int upperPageOffset)
memoryRemap: {
.label aVal = 5
.label xVal = 4
.label yVal = 3
.label zVal = 2
// char aVal = BYTE0(lowerPageOffset)
// lower blocks offset page low
ldz #0
stz.z aVal
// char xVal = (remapBlocks << 4) | (BYTE1(lowerPageOffset) & 0xf)
// lower blocks to map + lower blocks offset high nibble
stz.z xVal
// char yVal = BYTE0(upperPageOffset)
// upper blocks offset page
stz.z yVal
// char zVal = (remapBlocks & 0xf0) | (BYTE1(upperPageOffset) & 0xf)
// upper blocks to map + upper blocks offset page high nibble
stz.z zVal
// asm
lda aVal
ldx xVal
ldy yVal
map
eom
// }
rts
}
// Fill a memory block within the first 64K memory space using MEGA65 DMagic DMA
// Fills the values of num bytes at the destination with a single byte value.
// - dest The destination address (within the MB and bank)
// - fill The char to fill with
// - num The number of bytes to copy
// void memset_dma(void *dest, char fill, unsigned int num)
memset_dma: {
.const fill = '*'
.const num = $50*$a
.label dest = DEFAULT_SCREEN
// char dmaMode = DMA->EN018B
// Remember current F018 A/B mode
ldx DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B
// memset_dma_command.count = num
// Set up command
lda #<num
sta memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT
lda #>num
sta memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT+1
// memset_dma_command.src = (char*)fill
lda #<fill
sta memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC
lda #>fill
sta memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC+1
// memset_dma_command.dest = dest
lda #<dest
sta memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_DEST
lda #>dest
sta memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_DEST+1
// DMA->EN018B = 1
// Set F018B mode
ldz #1
stz DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B
// DMA->ADDRMB = 0
// Set address of DMA list
ldz #0
stz DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB
// DMA->ADDRBANK = 0
stz DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK
// DMA-> ADDRMSB = BYTE1(&memset_dma_command)
ldz #>memset_dma_command
stz DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB
// DMA-> ADDRLSBTRIG = BYTE0(&memset_dma_command)
// Trigger the DMA (without option lists)
ldz #<memset_dma_command
stz DMA
// DMA->EN018B = dmaMode
// Re-enable F018A mode
stx DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B
// }
rts
}
.segment Data
// DMA list entry for filling data
memset_dma_command: .byte DMA_COMMAND_FILL
.word 0, 0
.byte 0
.word 0
.byte 0, 0
.word 0
|
.file "floats_punned.c"
.section .tdata
REG_BANK:
.dword 0
.dword 0
.dword 0
.dword 0
.dword 0
.dword 0
.dword 0
.dword 0
.text
.section .rodata
.align 3
.LC3:
.string "Floating ops"
.align 3
.LC4:
.string "Addition: %lu\n"
.align 3
.LC5:
.string "Subtraction: %lu\n"
.align 3
.LC6:
.string "Multiplication: %lu\n"
.align 3
.LC7:
.string "Divistion: %lu\n"
.align 3
.LC8:
.string "Multiply-Add: %lu\n"
.align 3
.LC9:
.string "Multiply-Subtract: %lu\n"
.align 3
.LC10:
.string "Negative Multiply-Subtract: %lu\n"
.align 3
.LC11:
.string "Negative Multiply-Add: %lu\n"
.align 3
.LC12:
.string "FNegate: %lu\n"
.align 3
.LC13:
.string "Square Root: %lu \n"
.text
.align 2
.global main
.type main, %function
main:
la x21, REG_BANK
# stp x29, x30, [sp, -48]!
sd x8, -48(sp)
sd ra, -40(sp)
addi sp, sp, -48 # writeback
# add x29, sp, 0
addi x8, sp, 0
# adrp x0, .LC0
lui x10, %hi(.LC0)
# add x0, x0, :lo12:.LC0
add x10, x10, %lo(.LC0)
# ldr d0, [x0]
fld f10, 0(x10)
# str d0, [x29, 16]
fsd f10, 16(x8)
# adrp x0, .LC1
lui x10, %hi(.LC1)
# add x0, x0, :lo12:.LC1
add x10, x10, %lo(.LC1)
# ldr d0, [x0]
fld f10, 0(x10)
# str d0, [x29, 24]
fsd f10, 24(x8)
# adrp x0, .LC2
lui x10, %hi(.LC2)
# add x0, x0, :lo12:.LC2
add x10, x10, %lo(.LC2)
# ldr d0, [x0]
fld f10, 0(x10)
# str d0, [x29, 32]
fsd f10, 32(x8)
# adrp x0, .LC3
lui x10, %hi(.LC3)
# add x0, x0, :lo12:.LC3
add x10, x10, %lo(.LC3)
# bl puts
call puts
# ldr d1, [x29, 16]
fld f11, 16(x8)
# ldr d0, [x29, 24]
fld f10, 24(x8)
# fadd d0, d1, d0
fadd.d f10, f11, f10
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC4
lui x10, %hi(.LC4)
# add x0, x0, :lo12:.LC4
add x10, x10, %lo(.LC4)
# bl printf
call printf
# ldr d1, [x29, 16]
fld f11, 16(x8)
# ldr d0, [x29, 24]
fld f10, 24(x8)
# fsub d0, d1, d0
fsub.d f10, f11, f10
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC5
lui x10, %hi(.LC5)
# add x0, x0, :lo12:.LC5
add x10, x10, %lo(.LC5)
# bl printf
call printf
# ldr d1, [x29, 16]
fld f11, 16(x8)
# ldr d0, [x29, 24]
fld f10, 24(x8)
# fmul d0, d1, d0
fmul.d f10, f11, f10
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC6
lui x10, %hi(.LC6)
# add x0, x0, :lo12:.LC6
add x10, x10, %lo(.LC6)
# bl printf
call printf
# ldr d1, [x29, 16]
fld f11, 16(x8)
# ldr d0, [x29, 24]
fld f10, 24(x8)
# fdiv d0, d1, d0
fdiv.d f10, f11, f10
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC7
lui x10, %hi(.LC7)
# add x0, x0, :lo12:.LC7
add x10, x10, %lo(.LC7)
# bl printf
call printf
# ldr x0, [x29, 16]
ld x10, 16(x8)
# ldr x1, [x29, 24]
ld x11, 24(x8)
# ldr x2, [x29, 32]
ld x12, 32(x8)
# fmov d0, x0
fmv.d.x f10, x10
# fmov d1, x1
fmv.d.x f11, x11
# fmov d2, x2
fmv.d.x f12, x12
#APP
# fmadd d0, d0, d1, d2
fmadd.d f10, f10, f11, f12
#NO_APP
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC8
lui x10, %hi(.LC8)
# add x0, x0, :lo12:.LC8
add x10, x10, %lo(.LC8)
# bl printf
call printf
# ldr x0, [x29, 16]
ld x10, 16(x8)
# ldr x1, [x29, 24]
ld x11, 24(x8)
# ldr x2, [x29, 32]
ld x12, 32(x8)
# fmov d0, x0
fmv.d.x f10, x10
# fmov d1, x1
fmv.d.x f11, x11
# fmov d2, x2
fmv.d.x f12, x12
#APP
# fmsub d0, d0, d1, d2
fnmsub.d f10, f10, f11, f12
#NO_APP
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC9
lui x10, %hi(.LC9)
# add x0, x0, :lo12:.LC9
add x10, x10, %lo(.LC9)
# bl printf
call printf
# ldr x0, [x29, 16]
ld x10, 16(x8)
# ldr x1, [x29, 24]
ld x11, 24(x8)
# ldr x2, [x29, 32]
ld x12, 32(x8)
# fmov d0, x0
fmv.d.x f10, x10
# fmov d1, x1
fmv.d.x f11, x11
# fmov d2, x2
fmv.d.x f12, x12
#APP
# fnmsub d0, d0, d1, d2
fmsub.d f10, f10, f11, f12
#NO_APP
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC10
lui x10, %hi(.LC10)
# add x0, x0, :lo12:.LC10
add x10, x10, %lo(.LC10)
# bl printf
call printf
# ldr x0, [x29, 16]
ld x10, 16(x8)
# ldr x1, [x29, 24]
ld x11, 24(x8)
# ldr x2, [x29, 32]
ld x12, 32(x8)
# fmov d0, x0
fmv.d.x f10, x10
# fmov d1, x1
fmv.d.x f11, x11
# fmov d2, x2
fmv.d.x f12, x12
#APP
# fnmadd d0, d0, d1, d2
fnmadd.d f10, f10, f11, f12
#NO_APP
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC11
lui x10, %hi(.LC11)
# add x0, x0, :lo12:.LC11
add x10, x10, %lo(.LC11)
# bl printf
call printf
# ldr x0, [x29, 16]
ld x10, 16(x8)
# fmov d0, x0
fmv.d.x f10, x10
#APP
# fneg d0, d0
fneg.d f10, f10
#NO_APP
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC12
lui x10, %hi(.LC12)
# add x0, x0, :lo12:.LC12
add x10, x10, %lo(.LC12)
# bl printf
call printf
# ldr x0, [x29, 16]
ld x10, 16(x8)
# fmov d0, x0
fmv.d.x f10, x10
#APP
# fsqrt d0, d0
fsqrt.d f10, f10
#NO_APP
# str d0, [x29, 40]
fsd f10, 40(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# adrp x0, .LC13
lui x10, %hi(.LC13)
# add x0, x0, :lo12:.LC13
add x10, x10, %lo(.LC13)
# bl printf
call printf
# mov w0, 0
li x10, 0
# ldp x29, x30, [sp], 48
ld x8, 0(sp)
ld ra, 8(sp)
addi sp, sp, 48 # writeback
# ret
ret
.size main, .-main
.section .rodata
.align 3
.LC0:
.word 3786389468
.word 1086860557
.align 3
.LC1:
.word 1154487209
.word 1083394040
.align 3
.LC2:
.word 2684622566
.word 1085280571
.text
.ident "GCC: (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0"
.section .note.GNU-stack,"",@progbits
|
CONFIG_SCREEN_EXTRA_BANK_NUMBER = CURRENT_BANK_NUMBER
#include "game/logic/game_states/config_screen_extra_bank.built.asm"
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncat_73a.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805.string.label.xml
Template File: sources-sink-73a.tmpl.cpp
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: Allocate using new[] and set data pointer to a small buffer
* GoodSource: Allocate using new[] and set data pointer to a large buffer
* Sinks: ncat
* BadSink : Copy string to data using strncat
* Flow Variant: 73 Data flow: data passed in a list from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <list>
#include <wchar.h>
using namespace std;
namespace CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncat_73
{
#ifndef OMITBAD
/* bad function declaration */
void badSink(list<char *> dataList);
void bad()
{
char * data;
list<char *> dataList;
data = NULL;
/* FLAW: Allocate using new[] and point data to a small buffer that is smaller than the large buffer used in the sinks */
data = new char[50];
data[0] = '\0'; /* null terminate */
/* Put data in a list */
dataList.push_back(data);
dataList.push_back(data);
dataList.push_back(data);
badSink(dataList);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* good function declarations */
/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSink(list<char *> dataList);
static void goodG2B()
{
char * data;
list<char *> dataList;
data = NULL;
/* FIX: Allocate using new[] and point data to a large buffer that is at least as large as the large buffer used in the sink */
data = new char[100];
data[0] = '\0'; /* null terminate */
/* Put data in a list */
dataList.push_back(data);
dataList.push_back(data);
dataList.push_back(data);
goodG2BSink(dataList);
}
void good()
{
goodG2B();
}
#endif /* OMITGOOD */
} /* close namespace */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
using namespace CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncat_73; /* so that we can use good and bad easily */
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
// push constant 111
@111
D=A
@SP
A=M
M=D
@SP
M=M+1
// push constant 333
@333
D=A
@SP
A=M
M=D
@SP
M=M+1
// push constant 888
@888
D=A
@SP
A=M
M=D
@SP
M=M+1
// pop static 8
@SP
AM=M-1
D=M
@StaticTest.8
M=D
// pop static 3
@SP
AM=M-1
D=M
@StaticTest.3
M=D
// pop static 1
@SP
AM=M-1
D=M
@StaticTest.1
M=D
// push static 3
@StaticTest.3
D=M
@SP
A=M
M=D
@SP
M=M+1
// push static 1
@StaticTest.1
D=M
@SP
A=M
M=D
@SP
M=M+1
// sub
@R0
AM=M-1
D=M
A=A-1
M=M-D
// push static 8
@StaticTest.8
D=M
@SP
A=M
M=D
@SP
M=M+1
// add
@R0
AM=M-1
D=M
A=A-1
M=D+M
|
/*
* Copyright (c) David Connet. All Rights Reserved.
*
* License: See License.txt
*/
/**
* @file
* @brief Test string util functions
* @author David Connet
*
* Revision History
* 2018-12-16 Convert to fmt.
* 2017-11-09 Convert from UnitTest++ to Catch
* 2015-11-27 Remove WIN32 ifdef from tests.
* 2008-06-29 Created
*/
#include "stdafx.h"
#include "TestLib.h"
#include "ARBCommon/ARBMisc.h"
#include "ARBCommon/StringUtil.h"
#include "fmt/printf.h"
#include <algorithm>
#include <locale>
#ifdef __WXMSW__
#include <wx/msw/msvcrt.h>
#endif
TEST_CASE("String")
{
SECTION("Convert_ToWide")
{
if (!g_bMicroTest)
{
std::string s("narrow");
std::wstring s1 = StringUtil::stringW(s);
REQUIRE(L"narrow" == s1);
#if defined(__WXWINDOWS__)
wxString s2 = StringUtil::stringWX(s);
REQUIRE(L"narrow" == s2);
#endif
}
}
SECTION("Convert_ToNarrow")
{
if (!g_bMicroTest)
{
std::wstring s(L"wide");
std::string s1 = StringUtil::stringA(s);
REQUIRE("wide" == s1);
#if defined(__WXWINDOWS__)
wxString s2 = StringUtil::stringWX(s);
REQUIRE(L"wide" == s2);
#endif
}
}
// We know this will fail using wcstombs.
SECTION("Convert_Multi")
{
if (!g_bMicroTest)
{
// http://www.ftrain.com/unicode/#65275
wchar_t w
= 0xFEFB; // In courier new, Arabic Ligature Lam With Alef Isolated Form (see 'Character Map' program)
std::wstring s(1, w);
std::string s2 = StringUtil::stringA(s);
REQUIRE(s.length() == 1u);
// MBCS: 0, UTF8: 3
REQUIRE(s2.length() == 3u);
}
}
SECTION("Convert_Multi2")
{
if (!g_bMicroTest)
{
// http://www.ftrain.com/unicode/#247
wchar_t w = 0x00f7; // Division sign
std::wstring s(1, w);
std::string s2 = StringUtil::stringA(s);
REQUIRE(s.length() == 1u);
// MBCS: 1, UTF8: 2
REQUIRE(s2.length() > 0u);
}
}
SECTION("AtolGoodData")
{
if (!g_bMicroTest)
{
std::wstring s1(L"123");
long a1 = StringUtil::ToCLong(s1);
REQUIRE(a1 == 123);
REQUIRE(StringUtil::ToCLong(s1, a1));
}
}
SECTION("AtolBadData")
{
if (!g_bMicroTest)
{
std::wstring s2(L"12-3");
long a2 = StringUtil::ToCLong(s2);
REQUIRE(a2 == 12);
REQUIRE(!StringUtil::ToCLong(s2, a2));
REQUIRE(a2 == 12);
REQUIRE(!StringUtil::ToCLong(s2, a2, true));
REQUIRE(a2 == 12);
}
}
SECTION("AtodGoodData")
{
if (!g_bMicroTest)
{
std::wstring s1(L"12.3");
double a1 = StringUtil::ToCDouble(s1);
REQUIRE(a1 == 12.3);
REQUIRE(StringUtil::ToCDouble(s1, a1));
}
}
SECTION("AtodBadData")
{
if (!g_bMicroTest)
{
std::wstring s2(L"1.3-12");
double a2;
REQUIRE(!StringUtil::ToCDouble(s2, a2));
REQUIRE(a2 == 1.3);
}
}
SECTION("AtodUS")
{
if (!g_bMicroTest)
{
#if defined(__WXWINDOWS__) && !USE_CRT
wxLocale locale(wxLANGUAGE_ENGLISH_US, wxLOCALE_DONT_LOAD_DEFAULT);
#else
CLocaleWrapper locale(LC_NUMERIC, "english-us");
#endif
std::wstring s1(L"12.3");
double a1 = StringUtil::ToDouble(s1);
REQUIRE(a1 == 12.3);
std::wstring s2(L"1.3-12");
double a2;
bool bParsed = StringUtil::ToDouble(s2, a2);
REQUIRE(a2 == 1.3);
REQUIRE(!bParsed);
}
}
SECTION("AtodFR")
{
if (!g_bMicroTest)
{
#if defined(__WXWINDOWS__) && !USE_CRT
wxLocale locale(wxLANGUAGE_FRENCH, wxLOCALE_DONT_LOAD_DEFAULT);
#else
CLocaleWrapper locale(LC_NUMERIC, "french");
#endif
std::wstring s1(L"12,3");
double a1 = StringUtil::ToDouble(s1);
REQUIRE(a1 == 12.3);
std::wstring s2(L"1,3-12");
double a2;
bool bParsed = StringUtil::ToDouble(s2, a2);
REQUIRE(a2 == 1.3);
REQUIRE(!bParsed);
}
}
SECTION("AtodFR2")
{
if (!g_bMicroTest)
{
// Even in French, I want to have "." separators parse properly.
#if defined(__WXWINDOWS__) && !USE_CRT
wxLocale locale(wxLANGUAGE_FRENCH, wxLOCALE_DONT_LOAD_DEFAULT);
#else
CLocaleWrapper locale(LC_NUMERIC, "french");
#endif
std::wstring s1(L"12.3");
double a1 = StringUtil::ToDouble(s1);
REQUIRE(a1 == 12.3);
}
}
SECTION("ReplaceA")
{
if (!g_bMicroTest)
{
std::string s("This is a test");
std::string s2 = StringUtil::Replace(s, "is a", "");
REQUIRE("This test" == s2);
s2 = StringUtil::Replace(s2, " test", "good");
REQUIRE("This good" == s2);
}
}
SECTION("ReplaceW")
{
if (!g_bMicroTest)
{
std::wstring s(L"This is a test");
std::wstring s2 = StringUtil::Replace(s, L"is a", L"");
REQUIRE(L"This test" == s2);
s2 = StringUtil::Replace(s2, L" test", L"good");
REQUIRE(L"This good" == s2);
}
}
SECTION("Formatting")
{
if (!g_bMicroTest)
{
REQUIRE(L"two one" == fmt::sprintf(L"%2$s %1$s", L"one", L"two"));
REQUIRE(L"two one" == fmt::format(L"{1} {0}", L"one", L"two"));
REQUIRE(L" " == fmt::format(L"{:{}}", L" ", 4));
REQUIRE(L"000 " == fmt::format(L"{:0>{}}", L" ", 4));
}
}
SECTION("Trim")
{
if (!g_bMicroTest)
{
std::wstring str(L" xyx ");
REQUIRE(StringUtil::Trim(str) == L"xyx");
REQUIRE(StringUtil::TrimLeft(str) == L"xyx ");
REQUIRE(StringUtil::TrimRight(str) == L" xyx");
}
}
SECTION("TrimChar")
{
if (!g_bMicroTest)
{
std::wstring str(L"\"xyx\"");
REQUIRE(StringUtil::Trim(str, '"') == L"xyx");
REQUIRE(StringUtil::TrimLeft(str, '"') == L"xyx\"");
REQUIRE(StringUtil::TrimRight(str, '"') == L"\"xyx");
}
}
SECTION("Sort")
{
if (!g_bMicroTest)
{
if (StringUtil::CanCompareDigits())
{
std::vector<std::wstring> items;
items.push_back(L"1a");
items.push_back(L"10a");
items.push_back(L"2a");
std::stable_sort(items.begin(), items.end(), [](std::wstring const& one, std::wstring const& two) {
return StringUtil::CompareNoCase(one, two) < 0;
});
REQUIRE(items[0] == L"1a");
REQUIRE(items[1] == L"2a");
REQUIRE(items[2] == L"10a");
}
}
}
SECTION("Sort2")
{
if (!g_bMicroTest)
{
if (StringUtil::CanCompareDigits())
{
std::vector<std::wstring> items;
items.push_back(L"bob");
items.push_back(L"Bob");
items.push_back(L"Aa");
items.push_back(L"2a");
items.push_back(L"a");
std::stable_sort(items.begin(), items.end(), [](std::wstring const& one, std::wstring const& two) {
return StringUtil::CompareNoCase(one, two) < 0;
});
REQUIRE(items[0] == L"2a");
REQUIRE(items[1] == L"a");
REQUIRE(items[2] == L"Aa");
// Case insensitive - so these should be same order as inserted
REQUIRE(items[3] == L"bob");
REQUIRE(items[4] == L"Bob");
}
}
}
SECTION("Sort3")
{
if (!g_bMicroTest)
{
if (StringUtil::CanCompareDigits())
{
std::vector<std::wstring> items;
items.push_back(L"Bob");
items.push_back(L"bob");
items.push_back(L"Aa");
items.push_back(L"2a");
items.push_back(L"a");
// Note: Ignore case simply means "bob" == "Bob".
// It does not mean that lower case sorts before (or after) upper case.
std::stable_sort(items.begin(), items.end(), [](std::wstring const& one, std::wstring const& two) {
return StringUtil::CompareNoCase(one, two) < 0;
});
REQUIRE(items[0] == L"2a");
REQUIRE(items[1] == L"a");
REQUIRE(items[2] == L"Aa");
// Case insensitive - so these should be same order as inserted
REQUIRE(items[3] == L"Bob");
REQUIRE(items[4] == L"bob");
}
}
}
}
|
mov r1, .0
log r1
mul r1, .0
out r1
clr r1
log r1
add r1, .0
out r1
|
;
;
; ZX Maths Routines
;
; 11/03/08 - Stefano Bodrato
;
; $Id: pi.asm,v 1.3 2015/01/19 01:32:57 pauloscustodio Exp $
;
;double pi()
;Number in FA..
IF FORzx
INCLUDE "zxfp.def"
ELSE
INCLUDE "81fp.def"
ENDIF
PUBLIC pi
EXTERN stkequ
.pi
rst ZXFP_BEGIN_CALC
defb ZXFP_STK_PI_D_2
defb ZXFP_DUPLICATE
defb ZXFP_ADDITION ; PI/2 + PI/2
defb ZXFP_END_CALC
jp stkequ
|
// Copyright 2015 Esri.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <QGuiApplication>
#include <QQuickView>
#include <QUrl>
#include <QCoreApplication>
#include <QDir>
#include <QQmlEngine>
#define STRINGIZE(x) #x
#define QUOTE(x) STRINGIZE(x)
int main(int argc, char *argv[])
{
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
app.setApplicationName("VectorTiledLayerUrl - QML");
// Use of Esri location services, including basemaps and geocoding,
// requires authentication using either an ArcGIS identity or an API Key.
// 1. ArcGIS identity: An ArcGIS named user account that is a member of an
// organization in ArcGIS Online or ArcGIS Enterprise.
// 2. API key: A permanent key that gives your application access to Esri
// location services. Visit your ArcGIS Developers Dashboard create a new
// API keys or access an existing API key.
const QString apiKey = QStringLiteral("");
if (apiKey.isEmpty())
{
qWarning() << "Use of Esri location services, including basemaps, requires"
"you to authenticate with an ArcGIS identity or set the API Key property.";
}
else
{
QCoreApplication::instance()->setProperty("Esri.ArcGISRuntime.apiKey", apiKey);
}
// Set the source
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
// Add the import Path
view.engine()->addImportPath(QDir(QCoreApplication::applicationDirPath()).filePath("qml"));
QString arcGISRuntimeImportPath = QUOTE(ARCGIS_RUNTIME_IMPORT_PATH);
#if defined(LINUX_PLATFORM_REPLACEMENT)
// on some linux platforms the string 'linux' is replaced with 1
// fix the replacement paths which were created
QString replaceString = QUOTE(LINUX_PLATFORM_REPLACEMENT);
arcGISRuntimeImportPath = arcGISRuntimeImportPath.replace(replaceString, "linux", Qt::CaseSensitive);
#endif
// Add the Runtime and Extras path
view.engine()->addImportPath(arcGISRuntimeImportPath);
// Set the source
view.setSource(QUrl("qrc:/Samples/Layers/VectorTiledLayerUrl/VectorTiledLayerUrl.qml"));
view.show();
return app.exec();
}
|
// Assembler: KickAssembler v4.19
BasicUpstart2(main)
.var irq_line_top = $10 - 1
//.var top_lines = $21
.var top_lines = $21
//.var irq_line_top = $20 - 1
//.var top_lines = $08
.var irq_line_bottom = 312 - 64
.var music = LoadSid("/home/methos/Music/HVSC69/MUSICIANS/0-9/20CC/van_Santen_Edwin/Blackmail_Tune_1.sid")
main:
// fill first row to see if wobble effect is correctly implemented
ldx #$00
lda #1
!l:
sta $0400,x
inx
cpx #40
bne !l-
lda #0
jsr music.init
sei // Setup interrupts
lda #$35 // Disable KERNAL and BASIC ROM
sta $01 // Enable all RAM
lda #<irq_top // Setup IRQ vector
sta $fffe
lda #>irq_top
sta $ffff
lda #%00011011 // Load screen control:
// Vertical scroll : 3
// Screen height : 25 rows
// Screen : ON
// Mode : TEXT
// Extended background: OFF
sta $d011 // Set screen control
lda #irq_line_top
sta $d012
lda #$01 // Enable mask
sta $d01a // IRQ interrupt ON
lda #%01111111 // Load interrupt control CIA 1:
// Timer A underflow : OFF
// Timer B underflow : OFF
// TOD : OFF
// Serial shift reg. : OFF
// Pos. edge FLAG pin: OFF
sta $dc0d // Set interrupt control CIA 1
sta $dd0d // Set interrupt control CIA 2
lda $dc0d // Clear pending interrupts CIA 1
lda $dd0d // Clear pending interrupts CIA 2
lda #$00
sta $dc0e
lda #$01
sta $d019 // Acknowledge pending interrupts
cli // Start firing interrupts
jmp *
.align $100
// Use double IRQ for stable raster.
// We have spent at least 7 cycles for invoking this IRQ and we may
// have up to 7 cycles jitter.
irq_top:
// 0, 14
pha // 3, 10-17
txa // 2, 12-19
pha // 3, 15-22
tya // 2, 17-24
pha // 3, 20-27
lda #<irq_top_wedge // 2, 22-29 Daisy chain double IRQ for stable raster
sta $fffe // 4, 26-33
lda #>irq_top_wedge // 2, 28-35
sta $ffff // 4, 32-39
inc $d012 // 6, 38-45 Trigger wedge IRQ on next line.
lda #$01 // 2, 40-47 Acknowledge IRQ
sta $d019 // 4, 44-51
tsx // 2, 46-53
cli // 2, 48-55
.for (var i=0; i<8; i++) {
nop // 2*8, 64-71
}
irq_top_wedge:
// Now our second IRQ gets invoked.
// We have spent either 7 or 8 cycles.
// 7, 8
txs // 2, 9-10
ldx #$08 // 2, 11-12
dex // \ 8*5-1 = 39, 50-51
bne *-1 // /
bit $ea // 3, 53-54
lda $d012 // 4, 57-58
cmp $d012 // 4, 61-62
beq *+2 // Jitter is stored in zero flag.
// Stable raster line after this instruction.
ldx #0
!l:
lda raster_tbl,x // 4, 4
sta $d020 // 4, 8
jsr delay2 // 6+6+6+6, 32
jsr delay // 6+6, 44
inc dummy // 6, 50
nop
nop
inx // 2, 56
cpx top_counter // 4, 60
bne !l- // 3, 63
// check if wobble logic should run
cpx #top_lines // 2, 2
beq wobble // 2/3, 4/5
ldx wobble_timer
inx
cpx #4
bne !l+
ldx #0
inc top_counter
!l:
stx wobble_timer
!done:
ldy #14
sty $d020
lda #<irq_bottom // Restore first IRQ for stable raster
sta $fffe
lda #>irq_bottom
sta $ffff
lda #irq_line_bottom // Restore raster line
sta $d012
inc $d019 // Finally, acknowledge IRQ
pla
tay
pla
tax
pla
rti
wobble_timer:
.byte 0
// raster line: irq_line_top + 1 + top_lines == 49
wobble:
// spent cycles from last check: 5
// 49: NORMAL LINE
ldx wobble_pos // 2, 7
lda wobble_tbl, x // 4, 47
sta $d016 // 4, 51
jsr delay2 // 24, 31
jsr delay // 12, 43
txa // 2, 53
inx // 2, 55
and #$20 // 2, 57
tax // 2, 59
nop
nop
// 50: NORMAL LINE
jsr delay2 // 24, 32
jsr delay // 12, 44
lda wobble_tbl, x // 4, 4
sta $d016 // 4, 8
lda #7
sta $d020
txa
inx
and #$20
tax // 2, 58
bit $ea
nop
// 51: BAD LINE
lda wobble_tbl, x // 4, 4
sta $d016 // 4, 8
txa // 2, 10
inx // 2, 12
and #$20 // 2, 14
tax // 2, 16
nop
nop
lda #$c8
sta $d016
lda #14
sta $d020
// increment wobble position
ldx wobble_pos
inx
cpx #$20
bne !l+
ldx #0
!l:
stx wobble_pos
jmp !done-
delay2:
jsr delay
delay:
rts
irq_bottom:
pha
txa
pha
tya
pha
lda #<irq_top
sta $fffe
lda #>irq_top
sta $ffff
lda #irq_line_top
sta $d012
inc $d019
//jsr music.play
pla
tay
pla
tax
pla
rti
raster_tbl:
.for (var i=0; i<top_lines; i++) {
//.byte i + 2
.byte 6
}
dummy:
.byte 0
top_counter:
.byte 1
middle_counter:
.byte 0
.align $20
wobble_tbl:
.fill $20, round($c8 + 3 + 3 * sin(toRadians(i * 360 / $20)))
wobble_pos:
.byte 0
// MUSIC
* = music.location "music"
.fill music.size, music.getData(i)
.print "music_init = $" + toHexString(music.init)
.print "music_play = $" + toHexString(music.play)
|
#include "editaddressdialog.h"
#include "ui_editaddressdialog.h"
#include "addresstablemodel.h"
#include "dialogwindowflags.h"
#include "guiutil.h"
#include <QDataWidgetMapper>
#include <QMessageBox>
EditAddressDialog::EditAddressDialog(Mode mode, QWidget *parent) :
QDialog(parent, DIALOGWINDOWHINTS),
ui(new Ui::EditAddressDialog), mapper(0), mode(mode), model(0)
{
ui->setupUi(this);
GUIUtil::setupAddressWidget(ui->addressEdit, this);
switch(mode)
{
case NewReceivingAddress:
setWindowTitle(tr("New receiving address"));
ui->addressEdit->setEnabled(false);
break;
case NewSendingAddress:
setWindowTitle(tr("New sending address"));
break;
case EditReceivingAddress:
setWindowTitle(tr("Edit receiving address"));
ui->addressEdit->setEnabled(false);
break;
case EditSendingAddress:
setWindowTitle(tr("Edit sending address"));
break;
}
mapper = new QDataWidgetMapper(this);
mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
}
EditAddressDialog::~EditAddressDialog()
{
delete ui;
}
void EditAddressDialog::setModel(AddressTableModel *model)
{
this->model = model;
if(!model)
return;
mapper->setModel(model);
mapper->addMapping(ui->labelEdit, AddressTableModel::Label);
mapper->addMapping(ui->addressEdit, AddressTableModel::Address);
}
void EditAddressDialog::loadRow(int row)
{
mapper->setCurrentIndex(row);
}
bool EditAddressDialog::saveCurrentRow()
{
if(!model)
return false;
switch(mode)
{
case NewReceivingAddress:
case NewSendingAddress:
address = model->addRow(
mode == NewSendingAddress ? AddressTableModel::Send : AddressTableModel::Receive,
ui->labelEdit->text(),
ui->addressEdit->text());
break;
case EditReceivingAddress:
case EditSendingAddress:
if(mapper->submit())
{
address = ui->addressEdit->text();
}
break;
}
return !address.isEmpty();
}
void EditAddressDialog::accept()
{
if(!model)
return;
if(!saveCurrentRow())
{
switch(model->getEditStatus())
{
case AddressTableModel::OK:
// Failed with unknown reason. Just reject.
break;
case AddressTableModel::NO_CHANGES:
// No changes were made during edit operation. Just reject.
break;
case AddressTableModel::INVALID_ADDRESS:
QMessageBox::warning(this, windowTitle(),
tr("The entered address \"%1\" is not a valid 42 address.").arg(ui->addressEdit->text()),
QMessageBox::Ok, QMessageBox::Ok);
break;
case AddressTableModel::DUPLICATE_ADDRESS:
QMessageBox::warning(this, windowTitle(),
tr("The entered address \"%1\" is already in the address book.").arg(ui->addressEdit->text()),
QMessageBox::Ok, QMessageBox::Ok);
break;
case AddressTableModel::WALLET_UNLOCK_FAILURE:
QMessageBox::critical(this, windowTitle(),
tr("Could not unlock wallet."),
QMessageBox::Ok, QMessageBox::Ok);
break;
case AddressTableModel::KEY_GENERATION_FAILURE:
QMessageBox::critical(this, windowTitle(),
tr("New key generation failed."),
QMessageBox::Ok, QMessageBox::Ok);
break;
}
return;
}
QDialog::accept();
}
QString EditAddressDialog::getAddress() const
{
return address;
}
void EditAddressDialog::setAddress(const QString &address)
{
this->address = address;
ui->addressEdit->setText(address);
}
|
; A186416: a(n) = binomial(2n,n)^4/(n+1)^3.
; Submitted by Jon Maiga
; 1,2,48,2500,192080,18670176,2125170432,270968717448,37634544090000,5588044012339360,875419364366134016,143310129125665075392,24338673855047938317568,4264316875814353400000000,767401591466550107174400000,141345980472409642279275210000,26569505644587874058090478570000
mov $1,$0
mul $0,2
bin $0,$1
add $1,1
mov $2,$0
div $2,$1
pow $2,3
mul $2,$0
mov $0,$2
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r15
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x68ed, %rsi
lea addresses_D_ht+0xc385, %rdi
nop
nop
nop
nop
nop
xor %r15, %r15
mov $13, %rcx
rep movsb
nop
nop
sub $34146, %r10
lea addresses_normal_ht+0x155e5, %rdx
inc %r15
mov (%rdx), %rcx
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_UC_ht+0x97b5, %rdi
nop
nop
add %r12, %r12
mov (%rdi), %r15d
nop
nop
sub %r15, %r15
lea addresses_WC_ht+0x4b32, %rsi
nop
nop
nop
sub $505, %rcx
movb (%rsi), %r10b
nop
nop
nop
sub %rdx, %rdx
lea addresses_A_ht+0x1a801, %rsi
lea addresses_UC_ht+0x1e385, %rdi
nop
nop
nop
nop
nop
inc %r11
mov $62, %rcx
rep movsl
nop
nop
nop
nop
nop
and %r10, %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r15
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r8
push %r9
push %rbx
// Faulty Load
lea addresses_WC+0x175e5, %r9
nop
inc %r13
movb (%r9), %r8b
lea oracles, %r9
and $0xff, %r8
shlq $12, %r8
mov (%r9,%r8,1), %r8
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'same': True, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
; A072262: a(n) = 4*a(n-1) + 1, a(1)=11.
; 11,45,181,725,2901,11605,46421,185685,742741,2970965,11883861,47535445,190141781,760567125,3042268501,12169074005,48676296021,194705184085,778820736341,3115282945365,12461131781461,49844527125845
mov $1,4
pow $1,$0
div $1,3
mul $1,34
add $1,11
|
/*
* This file is part of the Camera Streaming Daemon
*
* Copyright (C) 2017 Intel Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stream_builder_custom.h"
#include "stream_custom.h"
static StreamBuilderCustom stream_builder;
std::vector<Stream *> StreamBuilderCustom::build_streams(const ConfFile &conf)
{
std::vector<Stream *> streams;
streams.push_back(new StreamCustom());
return streams;
}
|
; LEDs.asm
; Runs on MSP432
; Capt Steven Beyer
; September 9, 2019
; Code to activate LED on P6.7. This code accompanies the Lab08_LED_Switchesmain.c
;
.thumb
.text
.align 2
.global LED_Init
.global LED_Off
.global LED_On
.global LED_Toggle
.global LED_Oscillate
; function to initialize P6.7
LED_Init: .asmfunc
LDR R1, P6SEL0
LDRB R0, [R1]
BIC R0, R0, #0x80 ; GPIO
STRB R0, [R1]
LDR R1, P6SEL1
LDRB R0, [R1]
BIC R0, R0, #0x80
STRB R0, [R1] ; GPIO
LDR R1, P6DIR
LDRB R0, [R1]
ORR R0, R0, #0x80 ; output
STRB R0, [R1]
BX LR
.endasmfunc
; function to turn off P6.7
LED_Off: .asmfunc
LDR R1, P6OUT
LDRB R0, [R1] ; 8-bit read
BIC R0, R0, #0x80 ; turn off
STRB R0, [R1]
BX LR
.endasmfunc
; function to turn on P6.7
LED_On: .asmfunc
LDR R1, P6OUT
LDRB R0, [R1] ; 8-bit read
ORR R0, R0, #0x80 ; turn on
STRB R0, [R1]
BX LR
.endasmfunc
; function to toggle P6.7
LED_Toggle: .asmfunc
LDR R1, P6OUT
LDRB R0, [R1] ; 8-bit read
EOR R0, R0, #0x80 ; toggle bits
STRB R0, [R1] ; 8-bit write
BX LR
.endasmfunc
; function to continuously toggle P6.7 every half second
; use a loop as a timer
LED_Oscillate: .asmfunc
switch BL LED_Toggle ; toggle LEDs
MOV R1, #0 ; [R1] = 0
pause ADD R1, R1, #1 ; [R1] += 1
LDR R2, DELAY ; R2 = DELAY
CMP R2, R1 ; [R2] =? [R1]
BNE pause ; If R2 != 0, then loop to increment counter again
B switch ; If R2 <= 0, then done counting and toggle
.endasmfunc
; addresses for Port 6 registers
.align 4
P6SEL0 .word 0x40004C4B
P6SEL1 .word 0x40004C4D
P6DIR .word 0x40004C45
P6OUT .word 0x40004C43
DELAY .word 05300000
.end
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include <cinttypes>
#include <cstdlib>
#include <limits>
#include <string>
#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h"
namespace quic {
std::string QuicTime::Delta::ToDebuggingValue() const {
const int64_t one_ms = 1000;
const int64_t one_s = 1000 * one_ms;
int64_t absolute_value = std::abs(time_offset_);
// For debugging purposes, always display the value with the highest precision
// available.
if (absolute_value > one_s && absolute_value % one_s == 0) {
return QuicStringPrintf("%" PRId64 "s", time_offset_ / one_s);
}
if (absolute_value > one_ms && absolute_value % one_ms == 0) {
return QuicStringPrintf("%" PRId64 "ms", time_offset_ / one_ms);
}
return QuicStringPrintf("%" PRId64 "us", time_offset_);
}
uint64_t QuicWallTime::ToUNIXSeconds() const {
return microseconds_ / 1000000;
}
uint64_t QuicWallTime::ToUNIXMicroseconds() const {
return microseconds_;
}
bool QuicWallTime::IsAfter(QuicWallTime other) const {
return microseconds_ > other.microseconds_;
}
bool QuicWallTime::IsBefore(QuicWallTime other) const {
return microseconds_ < other.microseconds_;
}
bool QuicWallTime::IsZero() const {
return microseconds_ == 0;
}
QuicTime::Delta QuicWallTime::AbsoluteDifference(QuicWallTime other) const {
uint64_t d;
if (microseconds_ > other.microseconds_) {
d = microseconds_ - other.microseconds_;
} else {
d = other.microseconds_ - microseconds_;
}
if (d > static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) {
d = std::numeric_limits<int64_t>::max();
}
return QuicTime::Delta::FromMicroseconds(d);
}
QuicWallTime QuicWallTime::Add(QuicTime::Delta delta) const {
uint64_t microseconds = microseconds_ + delta.ToMicroseconds();
if (microseconds < microseconds_) {
microseconds = std::numeric_limits<uint64_t>::max();
}
return QuicWallTime(microseconds);
}
// TODO(ianswett) Test this.
QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const {
uint64_t microseconds = microseconds_ - delta.ToMicroseconds();
if (microseconds > microseconds_) {
microseconds = 0;
}
return QuicWallTime(microseconds);
}
} // namespace quic
|
; void in_MouseKempSetPos(uint xcoord, uint ycoord)
; 09.2005 aralbrec
PUBLIC in_MouseKempSetPos
EXTERN in_MouseKempSetPos_callee
EXTERN CDISP_IN_MOUSEKEMPSETPOS_CALLEE
.in_MouseKempSetPos
pop de
pop bc
pop hl
push hl
push bc
push de
jp in_MouseKempSetPos_callee + CDISP_IN_MOUSEKEMPSETPOS_CALLEE
|
; Calculate string length
; Compile with: nasm -f elf strlem.asm
; Linked with (-m elf_i386 for x86_64): ld -m elf_i386 -o strlen strlen.o
section .data
hello_str db 'Xxxxx, xxxxx xxx xxxxx!', 0xa ; new line char. at the end
str4 db 'dupa!'
section .text
global _start
_start:
mov ebx, str4 ; move adress of string to EBX
mov eax, ebx
check_char:
cmp byte[ebx], 0 ; compare the byte(char) pointed to by ECX at
; this address against zero
je check_end
inc ebx
jmp check_char
check_end:
sub ebx, eax
; return string length to OS
mov eax, 1 ; ebx is already set to string length
int 0x80
|
%define ARCH_AARCH64 0
%define ARCH_ALPHA 0
%define ARCH_ARM 0
%define ARCH_AVR32 0
%define ARCH_AVR32_AP 0
%define ARCH_AVR32_UC 0
%define ARCH_BFIN 0
%define ARCH_IA64 0
%define ARCH_M68K 0
%define ARCH_MIPS 0
%define ARCH_MIPS64 0
%define ARCH_PARISC 0
%define ARCH_PPC 0
%define ARCH_PPC64 0
%define ARCH_S390 0
%define ARCH_SH4 0
%define ARCH_SPARC 0
%define ARCH_SPARC64 0
%define ARCH_TILEGX 0
%define ARCH_TILEPRO 0
%define ARCH_TOMI 0
%define ARCH_X86 1
%define ARCH_X86_32 1
%define ARCH_X86_64 0
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
%define HAVE_SETEND 0
%define HAVE_ALTIVEC 0
%define HAVE_DCBZL 0
%define HAVE_LDBRX 0
%define HAVE_POWER8 0
%define HAVE_PPC4XX 0
%define HAVE_VSX 0
%define HAVE_AESNI 1
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
%define HAVE_FMA3 1
%define HAVE_FMA4 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
%define HAVE_SSE2 1
%define HAVE_SSE3 1
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
%define HAVE_XOP 1
%define HAVE_CPUNOP 1
%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPS64R2 0
%define HAVE_MIPS32R6 0
%define HAVE_MIPS64R6 0
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
%define HAVE_LOONGSON2 1
%define HAVE_LOONGSON3 1
%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
%define HAVE_SETEND_EXTERNAL 0
%define HAVE_ALTIVEC_EXTERNAL 0
%define HAVE_DCBZL_EXTERNAL 0
%define HAVE_LDBRX_EXTERNAL 0
%define HAVE_POWER8_EXTERNAL 0
%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_VSX_EXTERNAL 0
%define HAVE_AESNI_EXTERNAL 1
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
%define HAVE_SSE2_EXTERNAL 1
%define HAVE_SSE3_EXTERNAL 1
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
%define HAVE_XOP_EXTERNAL 1
%define HAVE_CPUNOP_EXTERNAL 0
%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPS64R2_EXTERNAL 0
%define HAVE_MIPS32R6_EXTERNAL 0
%define HAVE_MIPS64R6_EXTERNAL 0
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
%define HAVE_SETEND_INLINE 0
%define HAVE_ALTIVEC_INLINE 0
%define HAVE_DCBZL_INLINE 0
%define HAVE_LDBRX_INLINE 0
%define HAVE_POWER8_INLINE 0
%define HAVE_PPC4XX_INLINE 0
%define HAVE_VSX_INLINE 0
%define HAVE_AESNI_INLINE 1
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
%define HAVE_SSE2_INLINE 1
%define HAVE_SSE3_INLINE 1
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
%define HAVE_XOP_INLINE 1
%define HAVE_CPUNOP_INLINE 0
%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPS64R2_INLINE 0
%define HAVE_MIPS32R6_INLINE 0
%define HAVE_MIPS64R6_INLINE 0
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 0
%define HAVE_FAST_CLZ 1
%define HAVE_FAST_CMOV 0
%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCAL_ALIGNED_16 1
%define HAVE_LOCAL_ALIGNED_32 1
%define HAVE_SIMD_ALIGN_16 1
%define HAVE_ATOMICS_GCC 1
%define HAVE_ATOMICS_SUNCC 0
%define HAVE_ATOMICS_WIN32 0
%define HAVE_ATOMIC_CAS_PTR 0
%define HAVE_ATOMIC_COMPARE_EXCHANGE 1
%define HAVE_MACHINE_RW_BARRIER 0
%define HAVE_MEMORYBARRIER 0
%define HAVE_MM_EMPTY 0
%define HAVE_RDTSC 0
%define HAVE_SARESTART 1
%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_CABS 1
%define HAVE_CEXP 1
%define HAVE_INLINE_ASM 1
%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
%define HAVE_ALSA_ASOUNDLIB_H 0
%define HAVE_ALTIVEC_H 0
%define HAVE_ARPA_INET_H 0
%define HAVE_ASM_TYPES_H 1
%define HAVE_CDIO_PARANOIA_H 0
%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
%define HAVE_DEV_IC_BT8XX_H 0
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
%define HAVE_ES2_GL_H 0
%define HAVE_GSM_H 0
%define HAVE_IO_H 0
%define HAVE_MACH_MACH_TIME_H 0
%define HAVE_MACHINE_IOCTL_BT848_H 0
%define HAVE_MACHINE_IOCTL_METEOR_H 0
%define HAVE_MALLOC_H 1
%define HAVE_OPENJPEG_2_1_OPENJPEG_H 0
%define HAVE_OPENJPEG_2_0_OPENJPEG_H 0
%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_OPENGL_GL3_H 0
%define HAVE_POLL_H 1
%define HAVE_SNDIO_H 0
%define HAVE_SOUNDCARD_H 0
%define HAVE_SYS_MMAN_H 1
%define HAVE_SYS_PARAM_H 1
%define HAVE_SYS_RESOURCE_H 1
%define HAVE_SYS_SELECT_H 1
%define HAVE_SYS_SOUNDCARD_H 1
%define HAVE_SYS_TIME_H 1
%define HAVE_SYS_UN_H 1
%define HAVE_SYS_VIDEOIO_H 0
%define HAVE_TERMIOS_H 1
%define HAVE_UDPLITE_H 0
%define HAVE_UNISTD_H 1
%define HAVE_VALGRIND_VALGRIND_H 0
%define HAVE_WINDOWS_H 0
%define HAVE_WINSOCK2_H 0
%define HAVE_INTRINSICS_NEON 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
%define HAVE_HYPOT 1
%define HAVE_ISINF 1
%define HAVE_ISNAN 1
%define HAVE_LDEXPF 1
%define HAVE_LLRINT 1
%define HAVE_LLRINTF 1
%define HAVE_LOG2 1
%define HAVE_LOG2F 1
%define HAVE_LOG10F 1
%define HAVE_LRINT 1
%define HAVE_LRINTF 1
%define HAVE_POWF 1
%define HAVE_RINT 1
%define HAVE_ROUND 1
%define HAVE_ROUNDF 1
%define HAVE_SINF 1
%define HAVE_TRUNC 1
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
%define HAVE_ARC4RANDOM 0
%define HAVE_CLOCK_GETTIME 1
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
%define HAVE_DLOPEN 1
%define HAVE_FCNTL 1
%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
%define HAVE_GETOPT 1
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
%define HAVE_GLXGETPROCADDRESS 0
%define HAVE_GMTIME_R 1
%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 1
%define HAVE_MKSTEMP 1
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
%define HAVE_PEEKNAMEDPIPE 0
%define HAVE_POSIX_MEMALIGN 1
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
%define HAVE_STRERROR_R 1
%define HAVE_SYSCONF 1
%define HAVE_SYSCTL 1
%define HAVE_USLEEP 1
%define HAVE_UTGETOSTYPEFROMSTRING 0
%define HAVE_VIRTUALALLOC 0
%define HAVE_WGLGETPROCADDRESS 0
%define HAVE_PTHREADS 1
%define HAVE_OS2THREADS 0
%define HAVE_W32THREADS 0
%define HAVE_AS_DN_DIRECTIVE 0
%define HAVE_AS_FUNC 0
%define HAVE_AS_OBJECT_ARCH 0
%define HAVE_ASM_MOD_Q 0
%define HAVE_ATTRIBUTE_MAY_ALIAS 1
%define HAVE_ATTRIBUTE_PACKED 1
%define HAVE_EBP_AVAILABLE 1
%define HAVE_EBX_AVAILABLE 0
%define HAVE_GNU_AS 0
%define HAVE_GNU_WINDRES 0
%define HAVE_IBM_ASM 0
%define HAVE_INLINE_ASM_LABELS 1
%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_RSYNC_CONTIMEOUT 1
%define HAVE_SYMVER_ASM_LABEL 0
%define HAVE_SYMVER_GNU_ASM 1
%define HAVE_VFP_ARGS 0
%define HAVE_XFORM_ASM 0
%define HAVE_XMM_CLOBBERS 0
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
%define HAVE_STRUCT_POLLFD 0
%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
%define HAVE_STRUCT_SOCKADDR_IN6 0
%define HAVE_STRUCT_SOCKADDR_SA_LEN 0
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
%define HAVE_ATOMICS_NATIVE 1
%define HAVE_DOS_PATHS 0
%define HAVE_DXVA2API_COBJ 0
%define HAVE_DXVA2_LIB 0
%define HAVE_WINRT 0
%define HAVE_LIBC_MSVCRT 0
%define HAVE_LIBDC1394_1 0
%define HAVE_LIBDC1394_2 0
%define HAVE_MAKEINFO 1
%define HAVE_MAKEINFO_HTML 1
%define HAVE_PERL 1
%define HAVE_POD2MAN 1
%define HAVE_SDL 0
%define HAVE_SECTION_DATA_REL_RO 1
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
%define HAVE_VAAPI_X11 0
%define HAVE_VDPAU_X11 0
%define HAVE_XLIB 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_ENCODERS 0
%define CONFIG_HWACCELS 0
%define CONFIG_PARSERS 1
%define CONFIG_INDEVS 0
%define CONFIG_OUTDEVS 0
%define CONFIG_FILTERS 0
%define CONFIG_DEMUXERS 1
%define CONFIG_MUXERS 0
%define CONFIG_PROTOCOLS 0
%define CONFIG_DOC 0
%define CONFIG_HTMLPAGES 0
%define CONFIG_MANPAGES 0
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
%define CONFIG_QSVDEC_EXAMPLE 0
%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CHROMAPRINT 0
%define CONFIG_CRYSTALHD 0
%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
%define CONFIG_LADSPA 0
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
%define CONFIG_LIBDC1394 0
%define CONFIG_LIBDCADEC 0
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBFRIBIDI 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
%define CONFIG_LIBNUT 0
%define CONFIG_LIBOPENCORE_AMRNB 0
%define CONFIG_LIBOPENCORE_AMRWB 0
%define CONFIG_LIBOPENCV 0
%define CONFIG_LIBOPENH264 0
%define CONFIG_LIBOPENJPEG 0
%define CONFIG_LIBOPUS 0
%define CONFIG_LIBPULSE 0
%define CONFIG_LIBQUVI 0
%define CONFIG_LIBRTMP 0
%define CONFIG_LIBRUBBERBAND 0
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
%define CONFIG_LIBV4L2 0
%define CONFIG_LIBVIDSTAB 0
%define CONFIG_LIBVO_AACENC 0
%define CONFIG_LIBVO_AMRWBENC 0
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXCB 0
%define CONFIG_LIBXCB_SHM 0
%define CONFIG_LIBXCB_SHAPE 0
%define CONFIG_LIBXCB_XFIXES 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZIMG 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_LZMA 0
%define CONFIG_MMAL 0
%define CONFIG_NETCDF 0
%define CONFIG_NVENC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_SCHANNEL 0
%define CONFIG_SDL 0
%define CONFIG_SECURETRANSPORT 0
%define CONFIG_X11GRAB 0
%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
%define CONFIG_FTRAPV 0
%define CONFIG_GRAY 0
%define CONFIG_HARDCODED_TABLES 0
%define CONFIG_RUNTIME_CPUDETECT 1
%define CONFIG_SAFE_BITSTREAM_READER 1
%define CONFIG_SHARED 0
%define CONFIG_SMALL 0
%define CONFIG_STATIC 1
%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_D3D11VA 0
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
%define CONFIG_AVFORMAT 1
%define CONFIG_AVRESAMPLE 0
%define CONFIG_AVUTIL 1
%define CONFIG_POSTPROC 0
%define CONFIG_SWRESAMPLE 0
%define CONFIG_SWSCALE 0
%define CONFIG_FFPLAY 0
%define CONFIG_FFPROBE 0
%define CONFIG_FFSERVER 0
%define CONFIG_FFMPEG 0
%define CONFIG_DCT 1
%define CONFIG_DWT 0
%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAAN 1
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
%define CONFIG_PIXELUTILS 0
%define CONFIG_NETWORK 0
%define CONFIG_RDFT 1
%define CONFIG_FONTCONFIG 0
%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
%define CONFIG_POD2MAN 1
%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
%define CONFIG_VALGRIND_BACKTRACE 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
%define CONFIG_AUDIODSP 0
%define CONFIG_BLOCKDSP 0
%define CONFIG_BSWAPDSP 0
%define CONFIG_CABAC 1
%define CONFIG_DIRAC_PARSE 1
%define CONFIG_DVPROFILE 0
%define CONFIG_EXIF 0
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
%define CONFIG_G722DSP 0
%define CONFIG_GOLOMB 1
%define CONFIG_GPLV3 0
%define CONFIG_H263DSP 0
%define CONFIG_H264CHROMA 1
%define CONFIG_H264DSP 1
%define CONFIG_H264PRED 1
%define CONFIG_H264QPEL 1
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
%define CONFIG_HUFFYUVDSP 0
%define CONFIG_HUFFYUVENCDSP 0
%define CONFIG_IDCTDSP 0
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 1
%define CONFIG_INTRAX8 0
%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
%define CONFIG_QSVDEC 0
%define CONFIG_QSVENC 0
%define CONFIG_RANGECODER 0
%define CONFIG_RIFFDEC 1
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 1
%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 1
%define CONFIG_TEXTUREDSP 0
%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_VP56DSP 0
%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
%define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
%define CONFIG_MOV2TEXTSUB_BSF 0
%define CONFIG_NOISE_BSF 0
%define CONFIG_REMOVE_EXTRADATA_BSF 0
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
%define CONFIG_APNG_DECODER 0
%define CONFIG_ASV1_DECODER 0
%define CONFIG_ASV2_DECODER 0
%define CONFIG_AURA_DECODER 0
%define CONFIG_AURA2_DECODER 0
%define CONFIG_AVRP_DECODER 0
%define CONFIG_AVRN_DECODER 0
%define CONFIG_AVS_DECODER 0
%define CONFIG_AVUI_DECODER 0
%define CONFIG_AYUV_DECODER 0
%define CONFIG_BETHSOFTVID_DECODER 0
%define CONFIG_BFI_DECODER 0
%define CONFIG_BINK_DECODER 0
%define CONFIG_BMP_DECODER 0
%define CONFIG_BMV_VIDEO_DECODER 0
%define CONFIG_BRENDER_PIX_DECODER 0
%define CONFIG_C93_DECODER 0
%define CONFIG_CAVS_DECODER 0
%define CONFIG_CDGRAPHICS_DECODER 0
%define CONFIG_CDXL_DECODER 0
%define CONFIG_CINEPAK_DECODER 0
%define CONFIG_CLJR_DECODER 0
%define CONFIG_CLLC_DECODER 0
%define CONFIG_COMFORTNOISE_DECODER 0
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
%define CONFIG_DPX_DECODER 0
%define CONFIG_DSICINVIDEO_DECODER 0
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
%define CONFIG_EATGV_DECODER 0
%define CONFIG_EATQI_DECODER 0
%define CONFIG_EIGHTBPS_DECODER 0
%define CONFIG_EIGHTSVX_EXP_DECODER 0
%define CONFIG_EIGHTSVX_FIB_DECODER 0
%define CONFIG_ESCAPE124_DECODER 0
%define CONFIG_ESCAPE130_DECODER 0
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
%define CONFIG_FLV_DECODER 0
%define CONFIG_FOURXM_DECODER 0
%define CONFIG_FRAPS_DECODER 0
%define CONFIG_FRWU_DECODER 0
%define CONFIG_G2M_DECODER 0
%define CONFIG_GIF_DECODER 0
%define CONFIG_H261_DECODER 0
%define CONFIG_H263_DECODER 0
%define CONFIG_H263I_DECODER 0
%define CONFIG_H263P_DECODER 0
%define CONFIG_H264_DECODER 1
%define CONFIG_H264_CRYSTALHD_DECODER 0
%define CONFIG_H264_MMAL_DECODER 0
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
%define CONFIG_HUFFYUV_DECODER 0
%define CONFIG_IDCIN_DECODER 0
%define CONFIG_IFF_ILBM_DECODER 0
%define CONFIG_INDEO2_DECODER 0
%define CONFIG_INDEO3_DECODER 0
%define CONFIG_INDEO4_DECODER 0
%define CONFIG_INDEO5_DECODER 0
%define CONFIG_INTERPLAY_VIDEO_DECODER 0
%define CONFIG_JPEG2000_DECODER 0
%define CONFIG_JPEGLS_DECODER 0
%define CONFIG_JV_DECODER 0
%define CONFIG_KGV1_DECODER 0
%define CONFIG_KMVC_DECODER 0
%define CONFIG_LAGARITH_DECODER 0
%define CONFIG_LOCO_DECODER 0
%define CONFIG_MDEC_DECODER 0
%define CONFIG_MIMIC_DECODER 0
%define CONFIG_MJPEG_DECODER 0
%define CONFIG_MJPEGB_DECODER 0
%define CONFIG_MMVIDEO_DECODER 0
%define CONFIG_MOTIONPIXELS_DECODER 0
%define CONFIG_MPEG_XVMC_DECODER 0
%define CONFIG_MPEG1VIDEO_DECODER 0
%define CONFIG_MPEG2VIDEO_DECODER 0
%define CONFIG_MPEG4_DECODER 0
%define CONFIG_MPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MPEG4_VDPAU_DECODER 0
%define CONFIG_MPEGVIDEO_DECODER 0
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_MMAL_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
%define CONFIG_MSMPEG4V2_DECODER 0
%define CONFIG_MSMPEG4V3_DECODER 0
%define CONFIG_MSRLE_DECODER 0
%define CONFIG_MSS1_DECODER 0
%define CONFIG_MSS2_DECODER 0
%define CONFIG_MSVIDEO1_DECODER 0
%define CONFIG_MSZH_DECODER 0
%define CONFIG_MTS2_DECODER 0
%define CONFIG_MVC1_DECODER 0
%define CONFIG_MVC2_DECODER 0
%define CONFIG_MXPEG_DECODER 0
%define CONFIG_NUV_DECODER 0
%define CONFIG_PAF_VIDEO_DECODER 0
%define CONFIG_PAM_DECODER 0
%define CONFIG_PBM_DECODER 0
%define CONFIG_PCX_DECODER 0
%define CONFIG_PGM_DECODER 0
%define CONFIG_PGMYUV_DECODER 0
%define CONFIG_PICTOR_DECODER 0
%define CONFIG_PNG_DECODER 0
%define CONFIG_PPM_DECODER 0
%define CONFIG_PRORES_DECODER 0
%define CONFIG_PRORES_LGPL_DECODER 0
%define CONFIG_PTX_DECODER 0
%define CONFIG_QDRAW_DECODER 0
%define CONFIG_QPEG_DECODER 0
%define CONFIG_QTRLE_DECODER 0
%define CONFIG_R10K_DECODER 0
%define CONFIG_R210_DECODER 0
%define CONFIG_RAWVIDEO_DECODER 0
%define CONFIG_RL2_DECODER 0
%define CONFIG_ROQ_DECODER 0
%define CONFIG_RPZA_DECODER 0
%define CONFIG_RSCC_DECODER 0
%define CONFIG_RV10_DECODER 0
%define CONFIG_RV20_DECODER 0
%define CONFIG_RV30_DECODER 0
%define CONFIG_RV40_DECODER 0
%define CONFIG_S302M_DECODER 0
%define CONFIG_SANM_DECODER 0
%define CONFIG_SCREENPRESSO_DECODER 0
%define CONFIG_SDX2_DPCM_DECODER 0
%define CONFIG_SGI_DECODER 0
%define CONFIG_SGIRLE_DECODER 0
%define CONFIG_SMACKER_DECODER 0
%define CONFIG_SMC_DECODER 0
%define CONFIG_SMVJPEG_DECODER 0
%define CONFIG_SNOW_DECODER 0
%define CONFIG_SP5X_DECODER 0
%define CONFIG_SUNRAST_DECODER 0
%define CONFIG_SVQ1_DECODER 0
%define CONFIG_SVQ3_DECODER 0
%define CONFIG_TARGA_DECODER 0
%define CONFIG_TARGA_Y216_DECODER 0
%define CONFIG_TDSC_DECODER 0
%define CONFIG_THEORA_DECODER 1
%define CONFIG_THP_DECODER 0
%define CONFIG_TIERTEXSEQVIDEO_DECODER 0
%define CONFIG_TIFF_DECODER 0
%define CONFIG_TMV_DECODER 0
%define CONFIG_TRUEMOTION1_DECODER 0
%define CONFIG_TRUEMOTION2_DECODER 0
%define CONFIG_TSCC_DECODER 0
%define CONFIG_TSCC2_DECODER 0
%define CONFIG_TXD_DECODER 0
%define CONFIG_ULTI_DECODER 0
%define CONFIG_UTVIDEO_DECODER 0
%define CONFIG_V210_DECODER 0
%define CONFIG_V210X_DECODER 0
%define CONFIG_V308_DECODER 0
%define CONFIG_V408_DECODER 0
%define CONFIG_V410_DECODER 0
%define CONFIG_VB_DECODER 0
%define CONFIG_VBLE_DECODER 0
%define CONFIG_VC1_DECODER 0
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
%define CONFIG_VC1_MMAL_DECODER 0
%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
%define CONFIG_WEBP_DECODER 0
%define CONFIG_WMV1_DECODER 0
%define CONFIG_WMV2_DECODER 0
%define CONFIG_WMV3_DECODER 0
%define CONFIG_WMV3_CRYSTALHD_DECODER 0
%define CONFIG_WMV3_VDPAU_DECODER 0
%define CONFIG_WMV3IMAGE_DECODER 0
%define CONFIG_WNV1_DECODER 0
%define CONFIG_XAN_WC3_DECODER 0
%define CONFIG_XAN_WC4_DECODER 0
%define CONFIG_XBM_DECODER 0
%define CONFIG_XFACE_DECODER 0
%define CONFIG_XL_DECODER 0
%define CONFIG_XWD_DECODER 0
%define CONFIG_Y41P_DECODER 0
%define CONFIG_YOP_DECODER 0
%define CONFIG_YUV4_DECODER 0
%define CONFIG_ZERO12V_DECODER 0
%define CONFIG_ZEROCODEC_DECODER 0
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 1
%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
%define CONFIG_AMRWB_DECODER 0
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
%define CONFIG_DSD_LSBF_DECODER 0
%define CONFIG_DSD_MSBF_DECODER 0
%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_DSS_SP_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
%define CONFIG_FFWAVESYNTH_DECODER 0
%define CONFIG_FLAC_DECODER 0
%define CONFIG_G723_1_DECODER 0
%define CONFIG_G729_DECODER 0
%define CONFIG_GSM_DECODER 0
%define CONFIG_GSM_MS_DECODER 0
%define CONFIG_IAC_DECODER 0
%define CONFIG_IMC_DECODER 0
%define CONFIG_INTERPLAY_ACM_DECODER 0
%define CONFIG_MACE3_DECODER 0
%define CONFIG_MACE6_DECODER 0
%define CONFIG_METASOUND_DECODER 0
%define CONFIG_MLP_DECODER 0
%define CONFIG_MP1_DECODER 0
%define CONFIG_MP1FLOAT_DECODER 0
%define CONFIG_MP2_DECODER 0
%define CONFIG_MP2FLOAT_DECODER 0
%define CONFIG_MP3_DECODER 1
%define CONFIG_MP3FLOAT_DECODER 0
%define CONFIG_MP3ADU_DECODER 0
%define CONFIG_MP3ADUFLOAT_DECODER 0
%define CONFIG_MP3ON4_DECODER 0
%define CONFIG_MP3ON4FLOAT_DECODER 0
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
%define CONFIG_ON2AVC_DECODER 0
%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
%define CONFIG_RA_144_DECODER 0
%define CONFIG_RA_288_DECODER 0
%define CONFIG_RALF_DECODER 0
%define CONFIG_SHORTEN_DECODER 0
%define CONFIG_SIPR_DECODER 0
%define CONFIG_SMACKAUD_DECODER 0
%define CONFIG_SONIC_DECODER 0
%define CONFIG_TAK_DECODER 0
%define CONFIG_TRUEHD_DECODER 0
%define CONFIG_TRUESPEECH_DECODER 0
%define CONFIG_TTA_DECODER 0
%define CONFIG_TWINVQ_DECODER 0
%define CONFIG_VMDAUDIO_DECODER 0
%define CONFIG_VORBIS_DECODER 1
%define CONFIG_WAVPACK_DECODER 0
%define CONFIG_WMALOSSLESS_DECODER 0
%define CONFIG_WMAPRO_DECODER 0
%define CONFIG_WMAV1_DECODER 0
%define CONFIG_WMAV2_DECODER 0
%define CONFIG_WMAVOICE_DECODER 0
%define CONFIG_WS_SND1_DECODER 0
%define CONFIG_XMA1_DECODER 0
%define CONFIG_XMA2_DECODER 0
%define CONFIG_PCM_ALAW_DECODER 1
%define CONFIG_PCM_BLURAY_DECODER 0
%define CONFIG_PCM_DVD_DECODER 0
%define CONFIG_PCM_F32BE_DECODER 0
%define CONFIG_PCM_F32LE_DECODER 1
%define CONFIG_PCM_F64BE_DECODER 0
%define CONFIG_PCM_F64LE_DECODER 0
%define CONFIG_PCM_LXF_DECODER 0
%define CONFIG_PCM_MULAW_DECODER 1
%define CONFIG_PCM_S8_DECODER 0
%define CONFIG_PCM_S8_PLANAR_DECODER 0
%define CONFIG_PCM_S16BE_DECODER 1
%define CONFIG_PCM_S16BE_PLANAR_DECODER 0
%define CONFIG_PCM_S16LE_DECODER 1
%define CONFIG_PCM_S16LE_PLANAR_DECODER 0
%define CONFIG_PCM_S24BE_DECODER 1
%define CONFIG_PCM_S24DAUD_DECODER 0
%define CONFIG_PCM_S24LE_DECODER 1
%define CONFIG_PCM_S24LE_PLANAR_DECODER 0
%define CONFIG_PCM_S32BE_DECODER 0
%define CONFIG_PCM_S32LE_DECODER 1
%define CONFIG_PCM_S32LE_PLANAR_DECODER 0
%define CONFIG_PCM_U8_DECODER 1
%define CONFIG_PCM_U16BE_DECODER 0
%define CONFIG_PCM_U16LE_DECODER 0
%define CONFIG_PCM_U24BE_DECODER 0
%define CONFIG_PCM_U24LE_DECODER 0
%define CONFIG_PCM_U32BE_DECODER 0
%define CONFIG_PCM_U32LE_DECODER 0
%define CONFIG_PCM_ZORK_DECODER 0
%define CONFIG_INTERPLAY_DPCM_DECODER 0
%define CONFIG_ROQ_DPCM_DECODER 0
%define CONFIG_SOL_DPCM_DECODER 0
%define CONFIG_XAN_DPCM_DECODER 0
%define CONFIG_ADPCM_4XM_DECODER 0
%define CONFIG_ADPCM_ADX_DECODER 0
%define CONFIG_ADPCM_AFC_DECODER 0
%define CONFIG_ADPCM_AICA_DECODER 0
%define CONFIG_ADPCM_CT_DECODER 0
%define CONFIG_ADPCM_DTK_DECODER 0
%define CONFIG_ADPCM_EA_DECODER 0
%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
%define CONFIG_ADPCM_EA_R1_DECODER 0
%define CONFIG_ADPCM_EA_R2_DECODER 0
%define CONFIG_ADPCM_EA_R3_DECODER 0
%define CONFIG_ADPCM_EA_XAS_DECODER 0
%define CONFIG_ADPCM_G722_DECODER 0
%define CONFIG_ADPCM_G726_DECODER 0
%define CONFIG_ADPCM_G726LE_DECODER 0
%define CONFIG_ADPCM_IMA_AMV_DECODER 0
%define CONFIG_ADPCM_IMA_APC_DECODER 0
%define CONFIG_ADPCM_IMA_DK3_DECODER 0
%define CONFIG_ADPCM_IMA_DK4_DECODER 0
%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
%define CONFIG_ADPCM_IMA_ISS_DECODER 0
%define CONFIG_ADPCM_IMA_OKI_DECODER 0
%define CONFIG_ADPCM_IMA_QT_DECODER 0
%define CONFIG_ADPCM_IMA_RAD_DECODER 0
%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
%define CONFIG_ADPCM_IMA_WAV_DECODER 0
%define CONFIG_ADPCM_IMA_WS_DECODER 0
%define CONFIG_ADPCM_MS_DECODER 0
%define CONFIG_ADPCM_PSX_DECODER 0
%define CONFIG_ADPCM_SBPRO_2_DECODER 0
%define CONFIG_ADPCM_SBPRO_3_DECODER 0
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
%define CONFIG_DVBSUB_DECODER 0
%define CONFIG_DVDSUB_DECODER 0
%define CONFIG_JACOSUB_DECODER 0
%define CONFIG_MICRODVD_DECODER 0
%define CONFIG_MOVTEXT_DECODER 0
%define CONFIG_MPL2_DECODER 0
%define CONFIG_PGSSUB_DECODER 0
%define CONFIG_PJS_DECODER 0
%define CONFIG_REALTEXT_DECODER 0
%define CONFIG_SAMI_DECODER 0
%define CONFIG_SRT_DECODER 0
%define CONFIG_STL_DECODER 0
%define CONFIG_SUBRIP_DECODER 0
%define CONFIG_SUBVIEWER_DECODER 0
%define CONFIG_SUBVIEWER1_DECODER 0
%define CONFIG_TEXT_DECODER 0
%define CONFIG_VPLAYER_DECODER 0
%define CONFIG_WEBVTT_DECODER 0
%define CONFIG_XSUB_DECODER 0
%define CONFIG_LIBCELT_DECODER 0
%define CONFIG_LIBDCADEC_DECODER 0
%define CONFIG_LIBFDK_AAC_DECODER 0
%define CONFIG_LIBGSM_DECODER 0
%define CONFIG_LIBGSM_MS_DECODER 0
%define CONFIG_LIBILBC_DECODER 0
%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
%define CONFIG_LIBOPENJPEG_DECODER 0
%define CONFIG_LIBOPUS_DECODER 0
%define CONFIG_LIBSCHROEDINGER_DECODER 0
%define CONFIG_LIBSPEEX_DECODER 0
%define CONFIG_LIBUTVIDEO_DECODER 0
%define CONFIG_LIBVORBIS_DECODER 0
%define CONFIG_LIBVPX_VP8_DECODER 0
%define CONFIG_LIBVPX_VP9_DECODER 0
%define CONFIG_LIBZVBI_TELETEXT_DECODER 0
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACM_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
%define CONFIG_ADF_DEMUXER 0
%define CONFIG_ADP_DEMUXER 0
%define CONFIG_ADS_DEMUXER 0
%define CONFIG_ADX_DEMUXER 0
%define CONFIG_AEA_DEMUXER 0
%define CONFIG_AFC_DEMUXER 0
%define CONFIG_AIFF_DEMUXER 0
%define CONFIG_AMR_DEMUXER 0
%define CONFIG_ANM_DEMUXER 0
%define CONFIG_APC_DEMUXER 0
%define CONFIG_APE_DEMUXER 0
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
%define CONFIG_AVI_DEMUXER 0
%define CONFIG_AVISYNTH_DEMUXER 0
%define CONFIG_AVR_DEMUXER 0
%define CONFIG_AVS_DEMUXER 0
%define CONFIG_BETHSOFTVID_DEMUXER 0
%define CONFIG_BFI_DEMUXER 0
%define CONFIG_BINTEXT_DEMUXER 0
%define CONFIG_BINK_DEMUXER 0
%define CONFIG_BIT_DEMUXER 0
%define CONFIG_BMV_DEMUXER 0
%define CONFIG_BFSTM_DEMUXER 0
%define CONFIG_BRSTM_DEMUXER 0
%define CONFIG_BOA_DEMUXER 0
%define CONFIG_C93_DEMUXER 0
%define CONFIG_CAF_DEMUXER 0
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DCSTR_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DSS_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
%define CONFIG_DV_DEMUXER 0
%define CONFIG_DVBSUB_DEMUXER 0
%define CONFIG_DXA_DEMUXER 0
%define CONFIG_EA_DEMUXER 0
%define CONFIG_EA_CDATA_DEMUXER 0
%define CONFIG_EAC3_DEMUXER 0
%define CONFIG_EPAF_DEMUXER 0
%define CONFIG_FFM_DEMUXER 0
%define CONFIG_FFMETADATA_DEMUXER 0
%define CONFIG_FILMSTRIP_DEMUXER 0
%define CONFIG_FLAC_DEMUXER 0
%define CONFIG_FLIC_DEMUXER 0
%define CONFIG_FLV_DEMUXER 0
%define CONFIG_LIVE_FLV_DEMUXER 0
%define CONFIG_FOURXM_DEMUXER 0
%define CONFIG_FRM_DEMUXER 0
%define CONFIG_FSB_DEMUXER 0
%define CONFIG_G722_DEMUXER 0
%define CONFIG_G723_1_DEMUXER 0
%define CONFIG_G729_DEMUXER 0
%define CONFIG_GENH_DEMUXER 0
%define CONFIG_GIF_DEMUXER 0
%define CONFIG_GSM_DEMUXER 0
%define CONFIG_GXF_DEMUXER 0
%define CONFIG_H261_DEMUXER 0
%define CONFIG_H263_DEMUXER 0
%define CONFIG_H264_DEMUXER 0
%define CONFIG_HEVC_DEMUXER 0
%define CONFIG_HLS_DEMUXER 0
%define CONFIG_HNM_DEMUXER 0
%define CONFIG_ICO_DEMUXER 0
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
%define CONFIG_ISS_DEMUXER 0
%define CONFIG_IV8_DEMUXER 0
%define CONFIG_IVF_DEMUXER 0
%define CONFIG_IVR_DEMUXER 0
%define CONFIG_JACOSUB_DEMUXER 0
%define CONFIG_JV_DEMUXER 0
%define CONFIG_LMLM4_DEMUXER 0
%define CONFIG_LOAS_DEMUXER 0
%define CONFIG_LRC_DEMUXER 0
%define CONFIG_LVF_DEMUXER 0
%define CONFIG_LXF_DEMUXER 0
%define CONFIG_M4V_DEMUXER 0
%define CONFIG_MATROSKA_DEMUXER 1
%define CONFIG_MGSTS_DEMUXER 0
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 1
%define CONFIG_MP3_DEMUXER 1
%define CONFIG_MPC_DEMUXER 0
%define CONFIG_MPC8_DEMUXER 0
%define CONFIG_MPEGPS_DEMUXER 0
%define CONFIG_MPEGTS_DEMUXER 0
%define CONFIG_MPEGTSRAW_DEMUXER 0
%define CONFIG_MPEGVIDEO_DEMUXER 0
%define CONFIG_MPJPEG_DEMUXER 0
%define CONFIG_MPL2_DEMUXER 0
%define CONFIG_MPSUB_DEMUXER 0
%define CONFIG_MSF_DEMUXER 0
%define CONFIG_MSNWC_TCP_DEMUXER 0
%define CONFIG_MTV_DEMUXER 0
%define CONFIG_MV_DEMUXER 0
%define CONFIG_MVI_DEMUXER 0
%define CONFIG_MXF_DEMUXER 0
%define CONFIG_MXG_DEMUXER 0
%define CONFIG_NC_DEMUXER 0
%define CONFIG_NISTSPHERE_DEMUXER 0
%define CONFIG_NSV_DEMUXER 0
%define CONFIG_NUT_DEMUXER 0
%define CONFIG_NUV_DEMUXER 0
%define CONFIG_OGG_DEMUXER 1
%define CONFIG_OMA_DEMUXER 0
%define CONFIG_PAF_DEMUXER 0
%define CONFIG_PCM_ALAW_DEMUXER 0
%define CONFIG_PCM_MULAW_DEMUXER 0
%define CONFIG_PCM_F64BE_DEMUXER 0
%define CONFIG_PCM_F64LE_DEMUXER 0
%define CONFIG_PCM_F32BE_DEMUXER 0
%define CONFIG_PCM_F32LE_DEMUXER 0
%define CONFIG_PCM_S32BE_DEMUXER 0
%define CONFIG_PCM_S32LE_DEMUXER 0
%define CONFIG_PCM_S24BE_DEMUXER 0
%define CONFIG_PCM_S24LE_DEMUXER 0
%define CONFIG_PCM_S16BE_DEMUXER 0
%define CONFIG_PCM_S16LE_DEMUXER 0
%define CONFIG_PCM_S8_DEMUXER 0
%define CONFIG_PCM_U32BE_DEMUXER 0
%define CONFIG_PCM_U32LE_DEMUXER 0
%define CONFIG_PCM_U24BE_DEMUXER 0
%define CONFIG_PCM_U24LE_DEMUXER 0
%define CONFIG_PCM_U16BE_DEMUXER 0
%define CONFIG_PCM_U16LE_DEMUXER 0
%define CONFIG_PCM_U8_DEMUXER 0
%define CONFIG_PJS_DEMUXER 0
%define CONFIG_PMP_DEMUXER 0
%define CONFIG_PVA_DEMUXER 0
%define CONFIG_PVF_DEMUXER 0
%define CONFIG_QCP_DEMUXER 0
%define CONFIG_R3D_DEMUXER 0
%define CONFIG_RAWVIDEO_DEMUXER 0
%define CONFIG_REALTEXT_DEMUXER 0
%define CONFIG_REDSPARK_DEMUXER 0
%define CONFIG_RL2_DEMUXER 0
%define CONFIG_RM_DEMUXER 0
%define CONFIG_ROQ_DEMUXER 0
%define CONFIG_RPL_DEMUXER 0
%define CONFIG_RSD_DEMUXER 0
%define CONFIG_RSO_DEMUXER 0
%define CONFIG_RTP_DEMUXER 0
%define CONFIG_RTSP_DEMUXER 0
%define CONFIG_SAMI_DEMUXER 0
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
%define CONFIG_SLN_DEMUXER 0
%define CONFIG_SMACKER_DEMUXER 0
%define CONFIG_SMJPEG_DEMUXER 0
%define CONFIG_SMUSH_DEMUXER 0
%define CONFIG_SOL_DEMUXER 0
%define CONFIG_SOX_DEMUXER 0
%define CONFIG_SPDIF_DEMUXER 0
%define CONFIG_SRT_DEMUXER 0
%define CONFIG_STR_DEMUXER 0
%define CONFIG_STL_DEMUXER 0
%define CONFIG_SUBVIEWER1_DEMUXER 0
%define CONFIG_SUBVIEWER_DEMUXER 0
%define CONFIG_SUP_DEMUXER 0
%define CONFIG_SVAG_DEMUXER 0
%define CONFIG_SWF_DEMUXER 0
%define CONFIG_TAK_DEMUXER 0
%define CONFIG_TEDCAPTIONS_DEMUXER 0
%define CONFIG_THP_DEMUXER 0
%define CONFIG_THREEDOSTR_DEMUXER 0
%define CONFIG_TIERTEXSEQ_DEMUXER 0
%define CONFIG_TMV_DEMUXER 0
%define CONFIG_TRUEHD_DEMUXER 0
%define CONFIG_TTA_DEMUXER 0
%define CONFIG_TXD_DEMUXER 0
%define CONFIG_TTY_DEMUXER 0
%define CONFIG_V210_DEMUXER 0
%define CONFIG_V210X_DEMUXER 0
%define CONFIG_VAG_DEMUXER 0
%define CONFIG_VC1_DEMUXER 0
%define CONFIG_VC1T_DEMUXER 0
%define CONFIG_VIVO_DEMUXER 0
%define CONFIG_VMD_DEMUXER 0
%define CONFIG_VOBSUB_DEMUXER 0
%define CONFIG_VOC_DEMUXER 0
%define CONFIG_VPK_DEMUXER 0
%define CONFIG_VPLAYER_DEMUXER 0
%define CONFIG_VQF_DEMUXER 0
%define CONFIG_W64_DEMUXER 0
%define CONFIG_WAV_DEMUXER 1
%define CONFIG_WC3_DEMUXER 0
%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
%define CONFIG_WEBVTT_DEMUXER 0
%define CONFIG_WSAUD_DEMUXER 0
%define CONFIG_WSVQA_DEMUXER 0
%define CONFIG_WTV_DEMUXER 0
%define CONFIG_WVE_DEMUXER 0
%define CONFIG_WV_DEMUXER 0
%define CONFIG_XA_DEMUXER 0
%define CONFIG_XBIN_DEMUXER 0
%define CONFIG_XMV_DEMUXER 0
%define CONFIG_XVAG_DEMUXER 0
%define CONFIG_XWMA_DEMUXER 0
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
%define CONFIG_LIBGME_DEMUXER 0
%define CONFIG_LIBMODPLUG_DEMUXER 0
%define CONFIG_LIBNUT_DEMUXER 0
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_APNG_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
%define CONFIG_AVRP_ENCODER 0
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
%define CONFIG_DPX_ENCODER 0
%define CONFIG_DVVIDEO_ENCODER 0
%define CONFIG_FFV1_ENCODER 0
%define CONFIG_FFVHUFF_ENCODER 0
%define CONFIG_FLASHSV_ENCODER 0
%define CONFIG_FLASHSV2_ENCODER 0
%define CONFIG_FLV_ENCODER 0
%define CONFIG_GIF_ENCODER 0
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
%define CONFIG_LJPEG_ENCODER 0
%define CONFIG_MJPEG_ENCODER 0
%define CONFIG_MPEG1VIDEO_ENCODER 0
%define CONFIG_MPEG2VIDEO_ENCODER 0
%define CONFIG_MPEG4_ENCODER 0
%define CONFIG_MSMPEG4V2_ENCODER 0
%define CONFIG_MSMPEG4V3_ENCODER 0
%define CONFIG_MSVIDEO1_ENCODER 0
%define CONFIG_PAM_ENCODER 0
%define CONFIG_PBM_ENCODER 0
%define CONFIG_PCX_ENCODER 0
%define CONFIG_PGM_ENCODER 0
%define CONFIG_PGMYUV_ENCODER 0
%define CONFIG_PNG_ENCODER 0
%define CONFIG_PPM_ENCODER 0
%define CONFIG_PRORES_ENCODER 0
%define CONFIG_PRORES_AW_ENCODER 0
%define CONFIG_PRORES_KS_ENCODER 0
%define CONFIG_QTRLE_ENCODER 0
%define CONFIG_R10K_ENCODER 0
%define CONFIG_R210_ENCODER 0
%define CONFIG_RAWVIDEO_ENCODER 0
%define CONFIG_ROQ_ENCODER 0
%define CONFIG_RV10_ENCODER 0
%define CONFIG_RV20_ENCODER 0
%define CONFIG_S302M_ENCODER 0
%define CONFIG_SGI_ENCODER 0
%define CONFIG_SNOW_ENCODER 0
%define CONFIG_SUNRAST_ENCODER 0
%define CONFIG_SVQ1_ENCODER 0
%define CONFIG_TARGA_ENCODER 0
%define CONFIG_TIFF_ENCODER 0
%define CONFIG_UTVIDEO_ENCODER 0
%define CONFIG_V210_ENCODER 0
%define CONFIG_V308_ENCODER 0
%define CONFIG_V408_ENCODER 0
%define CONFIG_V410_ENCODER 0
%define CONFIG_WRAPPED_AVFRAME_ENCODER 0
%define CONFIG_WMV1_ENCODER 0
%define CONFIG_WMV2_ENCODER 0
%define CONFIG_XBM_ENCODER 0
%define CONFIG_XFACE_ENCODER 0
%define CONFIG_XWD_ENCODER 0
%define CONFIG_Y41P_ENCODER 0
%define CONFIG_YUV4_ENCODER 0
%define CONFIG_ZLIB_ENCODER 0
%define CONFIG_ZMBV_ENCODER 0
%define CONFIG_AAC_ENCODER 0
%define CONFIG_AC3_ENCODER 0
%define CONFIG_AC3_FIXED_ENCODER 0
%define CONFIG_ALAC_ENCODER 0
%define CONFIG_DCA_ENCODER 0
%define CONFIG_EAC3_ENCODER 0
%define CONFIG_FLAC_ENCODER 0
%define CONFIG_G723_1_ENCODER 0
%define CONFIG_MP2_ENCODER 0
%define CONFIG_MP2FIXED_ENCODER 0
%define CONFIG_NELLYMOSER_ENCODER 0
%define CONFIG_RA_144_ENCODER 0
%define CONFIG_SONIC_ENCODER 0
%define CONFIG_SONIC_LS_ENCODER 0
%define CONFIG_TTA_ENCODER 0
%define CONFIG_VORBIS_ENCODER 0
%define CONFIG_WAVPACK_ENCODER 0
%define CONFIG_WMAV1_ENCODER 0
%define CONFIG_WMAV2_ENCODER 0
%define CONFIG_PCM_ALAW_ENCODER 0
%define CONFIG_PCM_F32BE_ENCODER 0
%define CONFIG_PCM_F32LE_ENCODER 0
%define CONFIG_PCM_F64BE_ENCODER 0
%define CONFIG_PCM_F64LE_ENCODER 0
%define CONFIG_PCM_MULAW_ENCODER 0
%define CONFIG_PCM_S8_ENCODER 0
%define CONFIG_PCM_S8_PLANAR_ENCODER 0
%define CONFIG_PCM_S16BE_ENCODER 0
%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
%define CONFIG_PCM_S16LE_ENCODER 0
%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
%define CONFIG_PCM_S24BE_ENCODER 0
%define CONFIG_PCM_S24DAUD_ENCODER 0
%define CONFIG_PCM_S24LE_ENCODER 0
%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
%define CONFIG_PCM_S32BE_ENCODER 0
%define CONFIG_PCM_S32LE_ENCODER 0
%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
%define CONFIG_PCM_U8_ENCODER 0
%define CONFIG_PCM_U16BE_ENCODER 0
%define CONFIG_PCM_U16LE_ENCODER 0
%define CONFIG_PCM_U24BE_ENCODER 0
%define CONFIG_PCM_U24LE_ENCODER 0
%define CONFIG_PCM_U32BE_ENCODER 0
%define CONFIG_PCM_U32LE_ENCODER 0
%define CONFIG_ROQ_DPCM_ENCODER 0
%define CONFIG_ADPCM_ADX_ENCODER 0
%define CONFIG_ADPCM_G722_ENCODER 0
%define CONFIG_ADPCM_G726_ENCODER 0
%define CONFIG_ADPCM_IMA_QT_ENCODER 0
%define CONFIG_ADPCM_IMA_WAV_ENCODER 0
%define CONFIG_ADPCM_MS_ENCODER 0
%define CONFIG_ADPCM_SWF_ENCODER 0
%define CONFIG_ADPCM_YAMAHA_ENCODER 0
%define CONFIG_SSA_ENCODER 0
%define CONFIG_ASS_ENCODER 0
%define CONFIG_DVBSUB_ENCODER 0
%define CONFIG_DVDSUB_ENCODER 0
%define CONFIG_MOVTEXT_ENCODER 0
%define CONFIG_SRT_ENCODER 0
%define CONFIG_SUBRIP_ENCODER 0
%define CONFIG_TEXT_ENCODER 0
%define CONFIG_WEBVTT_ENCODER 0
%define CONFIG_XSUB_ENCODER 0
%define CONFIG_LIBFAAC_ENCODER 0
%define CONFIG_LIBFDK_AAC_ENCODER 0
%define CONFIG_LIBGSM_ENCODER 0
%define CONFIG_LIBGSM_MS_ENCODER 0
%define CONFIG_LIBILBC_ENCODER 0
%define CONFIG_LIBMP3LAME_ENCODER 0
%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
%define CONFIG_LIBOPENJPEG_ENCODER 0
%define CONFIG_LIBOPUS_ENCODER 0
%define CONFIG_LIBSCHROEDINGER_ENCODER 0
%define CONFIG_LIBSHINE_ENCODER 0
%define CONFIG_LIBSPEEX_ENCODER 0
%define CONFIG_LIBTHEORA_ENCODER 0
%define CONFIG_LIBTWOLAME_ENCODER 0
%define CONFIG_LIBUTVIDEO_ENCODER 0
%define CONFIG_LIBVO_AACENC_ENCODER 0
%define CONFIG_LIBVO_AMRWBENC_ENCODER 0
%define CONFIG_LIBVORBIS_ENCODER 0
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
%define CONFIG_LIBOPENH264_ENCODER 0
%define CONFIG_H264_QSV_ENCODER 0
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
%define CONFIG_HEVC_QSV_ENCODER 0
%define CONFIG_LIBKVAZAAR_ENCODER 0
%define CONFIG_MPEG2_QSV_ENCODER 0
%define CONFIG_ACOMPRESSOR_FILTER 0
%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEMPHASIS_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AGATE_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
%define CONFIG_ANEQUALIZER_FILTER 0
%define CONFIG_ANULL_FILTER 0
%define CONFIG_APAD_FILTER 0
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_APULSATOR_FILTER 0
%define CONFIG_AREALTIME_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
%define CONFIG_ASETPTS_FILTER 0
%define CONFIG_ASETRATE_FILTER 0
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASYNCTS_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
%define CONFIG_ATRIM_FILTER 0
%define CONFIG_AZMQ_FILTER 0
%define CONFIG_BANDPASS_FILTER 0
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_COMPENSATIONDELAY_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
%define CONFIG_LADSPA_FILTER 0
%define CONFIG_LOWPASS_FILTER 0
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
%define CONFIG_RUBBERBAND_FILTER 0
%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SIDECHAINGATE_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_SOFALIZER_FILTER 0
%define CONFIG_STEREOTOOLS_FILTER 0
%define CONFIG_STEREOWIDEN_FILTER 0
%define CONFIG_TREBLE_FILTER 0
%define CONFIG_TREMOLO_FILTER 0
%define CONFIG_VIBRATO_FILTER 0
%define CONFIG_VOLUME_FILTER 0
%define CONFIG_VOLUMEDETECT_FILTER 0
%define CONFIG_AEVALSRC_FILTER 0
%define CONFIG_ANOISESRC_FILTER 0
%define CONFIG_ANULLSRC_FILTER 0
%define CONFIG_FLITE_FILTER 0
%define CONFIG_SINE_FILTER 0
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
%define CONFIG_BLACKFRAME_FILTER 0
%define CONFIG_BLEND_FILTER 0
%define CONFIG_BOXBLUR_FILTER 0
%define CONFIG_CHROMAKEY_FILTER 0
%define CONFIG_CODECVIEW_FILTER 0
%define CONFIG_COLORBALANCE_FILTER 0
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COPY_FILTER 0
%define CONFIG_COVER_RECT_FILTER 0
%define CONFIG_CROP_FILTER 0
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
%define CONFIG_DILATION_FILTER 0
%define CONFIG_DISPLACE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
%define CONFIG_FIELD_FILTER 0
%define CONFIG_FIELDMATCH_FILTER 0
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FIND_RECT_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
%define CONFIG_GEQ_FILTER 0
%define CONFIG_GRADFUN_FILTER 0
%define CONFIG_HALDCLUT_FILTER 0
%define CONFIG_HFLIP_FILTER 0
%define CONFIG_HISTEQ_FILTER 0
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
%define CONFIG_LENSCORRECTION_FILTER 0
%define CONFIG_LUT3D_FILTER 0
%define CONFIG_LUT_FILTER 0
%define CONFIG_LUTRGB_FILTER 0
%define CONFIG_LUTYUV_FILTER 0
%define CONFIG_MASKEDMERGE_FILTER 0
%define CONFIG_MCDEINT_FILTER 0
%define CONFIG_MERGEPLANES_FILTER 0
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
%define CONFIG_PAD_FILTER 0
%define CONFIG_PALETTEGEN_FILTER 0
%define CONFIG_PALETTEUSE_FILTER 0
%define CONFIG_PERMS_FILTER 0
%define CONFIG_PERSPECTIVE_FILTER 0
%define CONFIG_PHASE_FILTER 0
%define CONFIG_PIXDESCTEST_FILTER 0
%define CONFIG_PP_FILTER 0
%define CONFIG_PP7_FILTER 0
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
%define CONFIG_RANDOM_FILTER 0
%define CONFIG_REALTIME_FILTER 0
%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SELECTIVECOLOR_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
%define CONFIG_SETDAR_FILTER 0
%define CONFIG_SETFIELD_FILTER 0
%define CONFIG_SETPTS_FILTER 0
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
%define CONFIG_SHOWPALETTE_FILTER 0
%define CONFIG_SHUFFLEFRAMES_FILTER 0
%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SIGNALSTATS_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
%define CONFIG_SWAPUV_FILTER 0
%define CONFIG_TBLEND_FILTER 0
%define CONFIG_TELECINE_FILTER 0
%define CONFIG_THUMBNAIL_FILTER 0
%define CONFIG_TILE_FILTER 0
%define CONFIG_TINTERLACE_FILTER 0
%define CONFIG_TRANSPOSE_FILTER 0
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
%define CONFIG_ZSCALE_FILTER 0
%define CONFIG_ALLRGB_FILTER 0
%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
%define CONFIG_HALDCLUTSRC_FILTER 0
%define CONFIG_LIFE_FILTER 0
%define CONFIG_MANDELBROT_FILTER 0
%define CONFIG_MPTESTSRC_FILTER 0
%define CONFIG_NULLSRC_FILTER 0
%define CONFIG_RGBTESTSRC_FILTER 0
%define CONFIG_SMPTEBARS_FILTER 0
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_TESTSRC2_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
%define CONFIG_ADRAWGRAPH_FILTER 0
%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
%define CONFIG_H264_QSV_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
%define CONFIG_HEVC_QSV_HWACCEL 0
%define CONFIG_HEVC_VAAPI_HWACCEL 0
%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_MMAL_HWACCEL 0
%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
%define CONFIG_VC1_MMAL_HWACCEL 0
%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_VP9_D3D11VA_HWACCEL 0
%define CONFIG_VP9_DXVA2_HWACCEL 0
%define CONFIG_VP9_VAAPI_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DECKLINK_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
%define CONFIG_X11GRAB_INDEV 0
%define CONFIG_X11GRAB_XCB_INDEV 0
%define CONFIG_LIBCDIO_INDEV 0
%define CONFIG_LIBDC1394_INDEV 0
%define CONFIG_A64_MUXER 0
%define CONFIG_AC3_MUXER 0
%define CONFIG_ADTS_MUXER 0
%define CONFIG_ADX_MUXER 0
%define CONFIG_AIFF_MUXER 0
%define CONFIG_AMR_MUXER 0
%define CONFIG_APNG_MUXER 0
%define CONFIG_ASF_MUXER 0
%define CONFIG_ASS_MUXER 0
%define CONFIG_AST_MUXER 0
%define CONFIG_ASF_STREAM_MUXER 0
%define CONFIG_AU_MUXER 0
%define CONFIG_AVI_MUXER 0
%define CONFIG_AVM2_MUXER 0
%define CONFIG_BIT_MUXER 0
%define CONFIG_CAF_MUXER 0
%define CONFIG_CAVSVIDEO_MUXER 0
%define CONFIG_CRC_MUXER 0
%define CONFIG_DASH_MUXER 0
%define CONFIG_DATA_MUXER 0
%define CONFIG_DAUD_MUXER 0
%define CONFIG_DIRAC_MUXER 0
%define CONFIG_DNXHD_MUXER 0
%define CONFIG_DTS_MUXER 0
%define CONFIG_DV_MUXER 0
%define CONFIG_EAC3_MUXER 0
%define CONFIG_F4V_MUXER 0
%define CONFIG_FFM_MUXER 0
%define CONFIG_FFMETADATA_MUXER 0
%define CONFIG_FILMSTRIP_MUXER 0
%define CONFIG_FLAC_MUXER 0
%define CONFIG_FLV_MUXER 0
%define CONFIG_FRAMECRC_MUXER 0
%define CONFIG_FRAMEMD5_MUXER 0
%define CONFIG_G722_MUXER 0
%define CONFIG_G723_1_MUXER 0
%define CONFIG_GIF_MUXER 0
%define CONFIG_GXF_MUXER 0
%define CONFIG_H261_MUXER 0
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
%define CONFIG_IMAGE2_MUXER 0
%define CONFIG_IMAGE2PIPE_MUXER 0
%define CONFIG_IPOD_MUXER 0
%define CONFIG_IRCAM_MUXER 0
%define CONFIG_ISMV_MUXER 0
%define CONFIG_IVF_MUXER 0
%define CONFIG_JACOSUB_MUXER 0
%define CONFIG_LATM_MUXER 0
%define CONFIG_LRC_MUXER 0
%define CONFIG_M4V_MUXER 0
%define CONFIG_MD5_MUXER 0
%define CONFIG_MATROSKA_MUXER 0
%define CONFIG_MATROSKA_AUDIO_MUXER 0
%define CONFIG_MICRODVD_MUXER 0
%define CONFIG_MJPEG_MUXER 0
%define CONFIG_MLP_MUXER 0
%define CONFIG_MMF_MUXER 0
%define CONFIG_MOV_MUXER 0
%define CONFIG_MP2_MUXER 0
%define CONFIG_MP3_MUXER 0
%define CONFIG_MP4_MUXER 0
%define CONFIG_MPEG1SYSTEM_MUXER 0
%define CONFIG_MPEG1VCD_MUXER 0
%define CONFIG_MPEG1VIDEO_MUXER 0
%define CONFIG_MPEG2DVD_MUXER 0
%define CONFIG_MPEG2SVCD_MUXER 0
%define CONFIG_MPEG2VIDEO_MUXER 0
%define CONFIG_MPEG2VOB_MUXER 0
%define CONFIG_MPEGTS_MUXER 0
%define CONFIG_MPJPEG_MUXER 0
%define CONFIG_MXF_MUXER 0
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_MXF_OPATOM_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
%define CONFIG_PCM_ALAW_MUXER 0
%define CONFIG_PCM_MULAW_MUXER 0
%define CONFIG_PCM_F64BE_MUXER 0
%define CONFIG_PCM_F64LE_MUXER 0
%define CONFIG_PCM_F32BE_MUXER 0
%define CONFIG_PCM_F32LE_MUXER 0
%define CONFIG_PCM_S32BE_MUXER 0
%define CONFIG_PCM_S32LE_MUXER 0
%define CONFIG_PCM_S24BE_MUXER 0
%define CONFIG_PCM_S24LE_MUXER 0
%define CONFIG_PCM_S16BE_MUXER 0
%define CONFIG_PCM_S16LE_MUXER 0
%define CONFIG_PCM_S8_MUXER 0
%define CONFIG_PCM_U32BE_MUXER 0
%define CONFIG_PCM_U32LE_MUXER 0
%define CONFIG_PCM_U24BE_MUXER 0
%define CONFIG_PCM_U24LE_MUXER 0
%define CONFIG_PCM_U16BE_MUXER 0
%define CONFIG_PCM_U16LE_MUXER 0
%define CONFIG_PCM_U8_MUXER 0
%define CONFIG_PSP_MUXER 0
%define CONFIG_RAWVIDEO_MUXER 0
%define CONFIG_RM_MUXER 0
%define CONFIG_ROQ_MUXER 0
%define CONFIG_RSO_MUXER 0
%define CONFIG_RTP_MUXER 0
%define CONFIG_RTP_MPEGTS_MUXER 0
%define CONFIG_RTSP_MUXER 0
%define CONFIG_SAP_MUXER 0
%define CONFIG_SEGMENT_MUXER 0
%define CONFIG_STREAM_SEGMENT_MUXER 0
%define CONFIG_SINGLEJPEG_MUXER 0
%define CONFIG_SMJPEG_MUXER 0
%define CONFIG_SMOOTHSTREAMING_MUXER 0
%define CONFIG_SOX_MUXER 0
%define CONFIG_SPX_MUXER 0
%define CONFIG_SPDIF_MUXER 0
%define CONFIG_SRT_MUXER 0
%define CONFIG_SWF_MUXER 0
%define CONFIG_TEE_MUXER 0
%define CONFIG_TG2_MUXER 0
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
%define CONFIG_W64_MUXER 0
%define CONFIG_WAV_MUXER 0
%define CONFIG_WEBM_MUXER 0
%define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
%define CONFIG_WEBM_CHUNK_MUXER 0
%define CONFIG_WEBP_MUXER 0
%define CONFIG_WEBVTT_MUXER 0
%define CONFIG_WTV_MUXER 0
%define CONFIG_WV_MUXER 0
%define CONFIG_YUV4MPEGPIPE_MUXER 0
%define CONFIG_CHROMAPRINT_MUXER 0
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
%define CONFIG_SNDIO_OUTDEV 0
%define CONFIG_V4L2_OUTDEV 0
%define CONFIG_XV_OUTDEV 0
%define CONFIG_AAC_PARSER 1
%define CONFIG_AAC_LATM_PARSER 0
%define CONFIG_AC3_PARSER 0
%define CONFIG_ADX_PARSER 0
%define CONFIG_BMP_PARSER 0
%define CONFIG_CAVSVIDEO_PARSER 0
%define CONFIG_COOK_PARSER 0
%define CONFIG_DCA_PARSER 0
%define CONFIG_DIRAC_PARSER 0
%define CONFIG_DNXHD_PARSER 0
%define CONFIG_DPX_PARSER 0
%define CONFIG_DVBSUB_PARSER 0
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
%define CONFIG_H264_PARSER 1
%define CONFIG_HEVC_PARSER 0
%define CONFIG_MJPEG_PARSER 0
%define CONFIG_MLP_PARSER 0
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 1
%define CONFIG_MPEGVIDEO_PARSER 0
%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
%define CONFIG_RV40_PARSER 0
%define CONFIG_TAK_PARSER 0
%define CONFIG_VC1_PARSER 0
%define CONFIG_VORBIS_PARSER 1
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
%define CONFIG_CRYPTO_PROTOCOL 0
%define CONFIG_DATA_PROTOCOL 0
%define CONFIG_FFRTMPCRYPT_PROTOCOL 0
%define CONFIG_FFRTMPHTTP_PROTOCOL 0
%define CONFIG_FILE_PROTOCOL 0
%define CONFIG_FTP_PROTOCOL 0
%define CONFIG_GOPHER_PROTOCOL 0
%define CONFIG_HLS_PROTOCOL 0
%define CONFIG_HTTP_PROTOCOL 0
%define CONFIG_HTTPPROXY_PROTOCOL 0
%define CONFIG_HTTPS_PROTOCOL 0
%define CONFIG_ICECAST_PROTOCOL 0
%define CONFIG_MMSH_PROTOCOL 0
%define CONFIG_MMST_PROTOCOL 0
%define CONFIG_MD5_PROTOCOL 0
%define CONFIG_PIPE_PROTOCOL 0
%define CONFIG_RTMP_PROTOCOL 0
%define CONFIG_RTMPE_PROTOCOL 0
%define CONFIG_RTMPS_PROTOCOL 0
%define CONFIG_RTMPT_PROTOCOL 0
%define CONFIG_RTMPTE_PROTOCOL 0
%define CONFIG_RTMPTS_PROTOCOL 0
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_SCHANNEL_PROTOCOL 0
%define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
%define CONFIG_TLS_GNUTLS_PROTOCOL 0
%define CONFIG_TLS_OPENSSL_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
%define CONFIG_UDPLITE_PROTOCOL 0
%define CONFIG_UNIX_PROTOCOL 0
%define CONFIG_LIBRTMP_PROTOCOL 0
%define CONFIG_LIBRTMPE_PROTOCOL 0
%define CONFIG_LIBRTMPS_PROTOCOL 0
%define CONFIG_LIBRTMPT_PROTOCOL 0
%define CONFIG_LIBRTMPTE_PROTOCOL 0
%define CONFIG_LIBSSH_PROTOCOL 0
%define CONFIG_LIBSMBCLIENT_PROTOCOL 0
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xbef2, %r9
nop
nop
nop
nop
nop
sub %r12, %r12
movw $0x6162, (%r9)
nop
nop
nop
nop
add %r12, %r12
lea addresses_D_ht+0x1b872, %rsi
lea addresses_normal_ht+0x15532, %rdi
nop
nop
nop
nop
sub $39330, %rax
mov $55, %rcx
rep movsl
nop
nop
nop
dec %r12
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %rax
push %rdx
push %rsi
// Faulty Load
mov $0x3ef6d0000000132, %rdx
clflush (%rdx)
nop
nop
nop
nop
nop
cmp %r12, %r12
movups (%rdx), %xmm1
vpextrq $0, %xmm1, %r14
lea oracles, %r11
and $0xff, %r14
shlq $12, %r14
mov (%r11,%r14,1), %r14
pop %rsi
pop %rdx
pop %rax
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 6}}
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': True}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
;/*!
; @file
;
; @ingroup fapi
;
; @brief DosReallocHuge DOS wrapper
;
; (c) osFree Project 2018, <http://www.osFree.org>
; for licence see licence.txt in root directory, or project website
;
; This is Family API implementation for DOS, used with BIND tools
; to link required API
;
; @author Yuri Prokushev (yuri.prokushev@gmail.com)
;
;*/
.8086
; Helpers
INCLUDE helpers.inc
_TEXT SEGMENT DWORD PUBLIC 'CODE' USE16
@PROLOG DOS16RREALLOCHUGE
NumSeg DW ?
Size_ DW ?
Selector DW ?
@START DOS16RREALLOCHUGE
; code here
@EPILOG DOS16RREALLOCHUGE
_TEXT ENDS
END
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1248a, %rbp
xor %rax, %rax
vmovups (%rbp), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %r9
and %rbp, %rbp
lea addresses_A_ht+0x17a1e, %rsi
lea addresses_UC_ht+0x1e42, %rdi
clflush (%rsi)
nop
nop
nop
nop
xor %r12, %r12
mov $36, %rcx
rep movsw
nop
nop
nop
nop
nop
add %rbp, %rbp
lea addresses_UC_ht+0x11c10, %rsi
lea addresses_WT_ht+0x11d8e, %rdi
sub %r10, %r10
mov $78, %rcx
rep movsb
nop
dec %r9
lea addresses_A_ht+0x1d662, %rsi
lea addresses_WC_ht+0x97d2, %rdi
xor %r10, %r10
mov $5, %rcx
rep movsb
nop
inc %rdi
lea addresses_UC_ht+0x14d02, %rsi
lea addresses_WT_ht+0x15e42, %rdi
nop
nop
nop
nop
nop
xor %rbp, %rbp
mov $43, %rcx
rep movsq
nop
nop
nop
nop
sub $48581, %rsi
lea addresses_A_ht+0xd0c2, %rsi
lea addresses_UC_ht+0xa542, %rdi
cmp $15931, %r10
mov $60, %rcx
rep movsl
add $41839, %r12
lea addresses_WC_ht+0x9ec2, %rax
nop
nop
nop
nop
nop
and $29903, %rsi
mov $0x6162636465666768, %r10
movq %r10, %xmm4
and $0xffffffffffffffc0, %rax
movaps %xmm4, (%rax)
nop
nop
nop
nop
nop
cmp $37255, %rbp
lea addresses_A_ht+0x596e, %rcx
nop
nop
and $47739, %rbp
movw $0x6162, (%rcx)
nop
nop
and $36757, %r12
lea addresses_WT_ht+0xfe42, %r10
nop
nop
nop
and $14380, %r12
movl $0x61626364, (%r10)
nop
nop
and $20674, %r12
lea addresses_WT_ht+0x1702, %rcx
cmp %rsi, %rsi
movl $0x61626364, (%rcx)
nop
nop
nop
cmp $22013, %r9
lea addresses_normal_ht+0x98a2, %rdi
nop
nop
nop
nop
add %r9, %r9
mov (%rdi), %ecx
nop
nop
nop
nop
xor $6934, %rsi
lea addresses_normal_ht+0xe902, %rsi
lea addresses_UC_ht+0x194c2, %rdi
nop
nop
sub $49378, %r12
mov $50, %rcx
rep movsw
nop
nop
nop
nop
add %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r8
push %r9
push %rax
push %rbx
push %rdx
// Store
mov $0x35b8d70000000402, %rax
nop
nop
nop
sub %rdx, %rdx
movl $0x51525354, (%rax)
nop
nop
sub %r9, %r9
// Store
lea addresses_A+0xd75a, %r9
nop
nop
and %r11, %r11
movw $0x5152, (%r9)
add $31547, %rdx
// Store
lea addresses_D+0x17ec2, %r11
nop
nop
nop
nop
nop
dec %r14
mov $0x5152535455565758, %r9
movq %r9, %xmm6
movups %xmm6, (%r11)
xor $41059, %rbx
// Faulty Load
lea addresses_D+0x17ec2, %r11
sub %r8, %r8
movb (%r11), %r14b
lea oracles, %r8
and $0xff, %r14
shlq $12, %r14
mov (%r8,%r14,1), %r14
pop %rdx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_NC', 'size': 4, 'AVXalign': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 16, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': True, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 11, 'NT': False, 'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'58': 206}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
; A130806: Period 6: 1,4,3,-1,-4,-3.
; 1,4,3,-1,-4,-3,1,4,3,-1,-4,-3,1,4,3,-1,-4,-3,1,4,3,-1,-4,-3,1,4,3,-1,-4,-3,1,4,3,-1,-4,-3,1,4,3,-1,-4,-3,1,4,3,-1,-4,-3,1,4,3
mov $1,1
mov $2,3
lpb $0
sub $0,1
add $1,$2
sub $2,$1
lpe
|
TITLE: hw6.asm
INCLUDE Irvine32.inc
ClearEAX textequ <mov eax, 0>
ClearEBX textequ <mov ebx, 0>
ClearECX textequ <mov ecx, 0>
ClearEDX textequ <mov edx, 0>
ClearESI textequ <mov esi, 0>
ClearEDI textequ <mov edi, 0>
maxLength = 51d
.data
phrase BYTE maxLength DUP(0)
phraseLength BYTE 0
phraseSet BYTE 0
phrasePrompt byte 'Please enter a phrase (50 characters or less): ',0
key BYTE maxLength DUP(0)
keyLength BYTE 0
keySet BYTE 0
keyPrompt byte 'Please enter a key (50 characters or less): ',0
errorMessage byte 'You have entered an invalid option. Please try again.', 0Ah, 0Dh, 0h
invalidMessage byte 'Please enter both a key and a phrase before attempting to encrypt/decrypt.', 0ah, 0dh, 0
userChoice byte 0
.code
main PROC
call ClearRegisters
startHere:
mov edx, offset phrase
mov al, phraseSet
call DisplayMainMenu
call ReadHex
mov userChoice, al
opt1:
; Get a phrase from the user, then format it
cmp userChoice, 1
jne opt2
call clrscr
mov edx, offset phrase
mov eax, offset phrasePrompt
mov ebx, offset phraseLength
call EnterString
call ChangeCase
call LettersOnly
mov phraseSet, 1
jmp starthere
opt2:
; Get a key from the user
cmp userChoice, 2
jne opt3
call clrscr
mov edx, offset key
mov eax, offset keyPrompt
mov ebx, offset keyLength
call EnterString
mov keySet, 1
jmp startHere
opt3:
; Encrypt phrase
cmp userChoice, 3
jne opt4
; If either the phrase or key has not been set, this option is invalid
cmp phraseSet, 0
je invalid
cmp keySet, 0
je invalid
mov edx, offset phrase
mov eax, offset key
movzx ecx, [phraseLength]
mov bl, [keyLength]
mov bh, 1
call EncryptDecrypt
jmp startHere
opt4:
; Decrypt phrase
cmp userChoice, 4
jne opt5
; If either the phrase or key has not been set, this option is invalid
cmp phraseSet, 0
je invalid
cmp keySet, 0
je invalid
mov edx, offset phrase
mov eax, offset key
movzx ecx, [phraseLength]
mov bl, [keyLength]
mov bh, 0
call EncryptDecrypt
jmp startHere
opt5:
cmp userChoice, 5
jne oops
jmp quit
oops:
push edx
mov edx, offset errormessage
call writestring
call waitmsg
pop edx
jmp starthere
invalid:
push edx
mov edx, offset invalidmessage
call writestring
call waitmsg
pop edx
jmp starthere
quit:
exit
main ENDP
ChangeCase proc
; Description: Converts all lowercase letters in string to uppercase
;
; Receives:
; EDX: Offset of string array
; EBX: Length of string array
;
; Returns:
; EDX: String array with converted letters, if any
push esi
push eax
push ecx
clearESI
movzx ecx, byte ptr [ebx]
letterLoop:
mov al, byte ptr [edx+esi]
cmp al, 'a'
jb keepgoing
cmp al, 'z'
ja keepgoing
sub al, 20h
mov byte ptr [edx+esi], al
keepgoing:
inc esi
loop letterLoop
pop ecx
pop eax
pop esi
ret
ChangeCase endp
EncryptDecrypt proc
; Description:
; Shifts characters in a phrase an amount specified in a key
; Or alerts the user if no key is set.
;
; Receives:
; EDX: Offset of phrase to shift
; EAX: Offset of key to use
; ECX: Length of phrase
; BL: Length of key
; BH: 1 if Encyrpting, 0 if decrypting
;
; Returns:
; EDX: Encrypted phrase
.data
theKeyLength byte 0
keyIndex byte 0
phraseIndex byte 0
currentLetter byte 0
encrypt byte 0
.code
mov keyIndex, 0
mov phraseIndex, 0
push esi
mov theKeyLength, bl
dec theKeyLength
mov encrypt, bh
mov ebx, 0
eLoop:
; Get the current key letter
movzx esi, [keyIndex]
mov bl, [eax+esi]
push eax
; Store key letter
mov al, bl
; Get key letter modulo 26d
mov ah, 26
call Modulo
; Shift current phrase letter by modulus result
movzx esi, [phraseIndex]
mov al, [edx + esi]
; Check to see if we're encrypting
cmp encrypt, 0
jne doShift
; If we're decrypting, make shift amount negative
neg ah
doShift:
call CipherShiftChar
; Store result of shift back into phrase string
mov [edx + esi], al
; Now we'll check if we have to wrap around to beginning of key
mov al, keyIndex
cmp al, theKeyLength
jne continue
mov keyIndex, -1 ; Reset keyIndex
continue:
inc keyIndex
inc phraseIndex
pop eax
loop eloop
pop esi
ret
EncryptDecrypt endp
LettersOnly proc
; Description: Removes all non-letter characters from string
;
; Receives:
; EDX: offset of string array
;
; Returns:
; EDX: offset of string array
; EBX: new length of string
push eax
push esi
push edx
push ebx
clearESI
clearEAX
L1:
; Move current element into al
mov al, byte ptr [edx + esi]
; Test if current element is NOT a capital letter
cmp al, 41h
jb notLetter
cmp al, 5bh
jb letter
letter:
; If current element IS letter:
; Move element into element at ah
movzx ebx, ah
; Make current element 0
mov byte ptr [edx + esi], 0
; Move letter into new position
mov byte ptr [edx + ebx], al
; Increment ah so we get a new valid position
inc ah
jmp keepgoing
notLetter:
; If current element is NOT a letter:
; Make current element 0
mov byte ptr [edx + esi], 0
keepgoing:
inc esi
LOOP L1
complete:
pop ebx
mov byte ptr [ebx], ah ; Return length of string
pop edx
pop esi
pop eax
ret
LettersOnly endp
EnterString proc
; Description:
; Displays a prompt and receives a string from the user
;
; Receives:
; EAX: The offset of the prompt string
; EDX: The offset of the byte array to store the string in.
; Must have 50 elements.
; EBX: The offset of the length of string
;
; Returns:
; EDX: string from user
; EBX: length of string
;
; Requires:
; Array must have 50 elements
.data
errorMsg byte "You haven't entered anything, please try again.",0
.code
start:
call ClearString
push eax
push edx ; saving the address of the string
xchg edx, eax ; flip string offsets
call writestring
xchg edx, eax ; flip them back
mov ecx, maxLength
call readstring
mov byte ptr [ebx], al ;//length of user entered string, now in thestringlen
cmp byte ptr [ebx], 0
jne continue
call clrscr
mov edx, offset errorMsg
call writestring
call crlf
call waitmsg
call clrscr
pop edx
pop eax
jmp start
continue:
pop edx
pop eax
ret
EnterString endp
ClearRegisters Proc
; Description:
; Clears the registers EAX, EBX, ECX, EDX, ESI, EDI
;
; Requires:
; Nothing
;
; Returns:
; Nothing, but all registers will be cleared.
cleareax
clearebx
clearecx
clearedx
clearesi
clearedi
ret
ClearRegisters ENDP
DisplayMainMenu proc
; Description:
; Displays the main menu
;
; Receives:
; AL: 1 if phrase is entered already, 0 if no phrase has been entered.
; EDX: Offset of phrase
;
; Returns: Nothing
.data
Menuprompt1 byte 'MAIN MENU', 0Ah, 0Dh,0
Menuprompt2 byte '1. Enter a phrase', 0Ah, 0Dh,
'2. Enter a key',0Ah, 0Dh,
'3. Encrypt phrase',0Ah, 0Dh,
'4. Decrypt phrase',0Ah, 0Dh,
'5. Exit ',0Ah, 0Dh, 0h
phraseDisplay1 byte 'Current phrase: ',0
seperator byte '==========', 0Ah, 0Dh, 0
.code
call clrscr
push edx
; Display main menu
mov edx, offset menuprompt1
call WriteString
mov edx, offset seperator
call writeString
; If there's a phrase, display it
cmp al, 1
jne continue
mov edx, offset phrasedisplay1
call WriteString
pop edx
call Printit
push edx
call crlf
mov edx, offset seperator
call WriteString
continue:
mov edx, offset menuprompt2
call WriteString
pop edx
ret
DisplayMainMenu endp
CipherShiftChar proc
; Description:
; Shifts a character through the alphabet by a pre-determined
; number of spaces. Wraps around to beginning if necessary.
; To shift a character to the left, pass in a negative number
; To shift a character to the right, pass in a positive number
;
; Receives:
; AH: Number of places to shift character.
; AL: Character to shift.
;
; Returns:
; AL: Shifted character
add al, ah
cmp al, '@'
ja next
add al, 1ah
next:
cmp al, '['
jb continue
sub al, 1ah
continue:
ret
CipherShiftChar endp
Modulo proc
; Description:
; Performs a Modulo operation on an integer
;
; Receives:
; AH: Divisor
; AL: Dividend
;
; Returns:
; AH: Result
.data
divisor BYTE 0
.code
mov divisor, ah
mov ah, 0
div divisor
ret
Modulo endp
Printit proc
; Description:
; Outputs a string in the format ***** ***** *****,
; where each * represent a subsequent character in the
; string.
;
; Receives:
; EDX: Offset of string
;
; Returns:
; Nothing
;
; Requires:
; String length must be 50
push esi
push ecx
push ax ; AL will contain current character
; AH will contain a counter used to determine when to output a space character
mov esi, 0
mov ax, 0
mov ecx, 50
printLoop:
mov al, [edx + esi]
call WriteChar
inc ah
cmp ah, 5 ; If counter is 4, we output a null character and reset counter
jne continue
mov ax, 0 ; Set both counter and character to output to '0'
call WriteChar
continue:
inc esi
loop printLoop
pop ax
pop ecx
pop esi
ret
Printit endp
ClearString proc
; Description:
; Clears a string
;
; Receives:
; EDX: Offset of string
; EBX: Offset of size of string
;
; Requires:
; String must have max length of 50
push ecx
push esi
mov esi, 0
mov ecx, 50
clearLoop:
mov byte ptr [edx + esi], 0
inc esi
loop clearLoop
pop esi
pop ecx
ret
ClearString endp
END main |
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <ios>
// class ios_base
// ios_base& right(ios_base& str);
#include <ios>
#include <streambuf>
#include <cassert>
struct testbuf : public std::streambuf {};
int main()
{
testbuf sb;
std::ios ios(&sb);
std::ios_base& r = std::right(ios);
assert(&r == &ios);
assert(ios.flags() & std::ios::right);
}
|
; A152984: Absolute values of A152864.
; 1,2,3,3,5,3,7,4,7,5,11,1,13,7,9,5,17,2,19,3,13,11,23,5,21,13,17,5,29,5,31,6,21,17,25,11,37,19,25,3,41,5,43,9,17,23,47,19,43,12,33,11,53,5,41,1,37,29,59,37,61,31,27,7,49,5,67,15,45,3,71,40,73,37,31,17,61,5,79,17
cal $0,152864 ; Deficiency of n, plus the number of proper divisors of n: a(n) = 2n - sigma(n) + d(n) - 1.
gcd $0,0
mov $1,$0
|
;
; CPC bank loader, after @iratahack
;
EXTERN __DATA_END_tail
EXTERN __BANK_0_END_tail
EXTERN __BANK_1_END_tail
EXTERN __BANK_2_END_tail
EXTERN __BANK_3_END_tail
EXTERN __BANK_4_END_tail
EXTERN __BANK_5_END_tail
EXTERN __BANK_6_END_tail
EXTERN __BANK_7_END_tail
; Turn off tape messages
ld a,0
call cas_noisy
ld hl,__crt_loader_filename
find_ext:
ld a,(hl)
cp '.'
inc hl
jr nz,find_ext
inc hl
ld (extension),hl
; This may well contain the loading screen
ld hl,CRT_ORG_BANK_3
ld de,__BANK_3_END_tail - CRT_ORG_BANK_3
ld bc, $33c0 ;bank port, extension
call loadbank
; Probably part of the program as loaded, so not expected to be used
ld hl,CRT_ORG_BANK_0
ld de,__BANK_0_END_tail - CRT_ORG_BANK_0
ld bc,$30c0 ;Bank 0
call loadbank
ld hl,CRT_ORG_BANK_1
ld de,__BANK_1_END_tail - CRT_ORG_BANK_1
ld bc,$31c0 ;Bank 1
call loadbank
ld hl,CRT_ORG_BANK_4
ld de,__BANK_4_END_tail - CRT_ORG_BANK_4
ld bc,$34c4 ;Bank 4
call loadbank
ld hl,CRT_ORG_BANK_5
ld de,__BANK_5_END_tail - CRT_ORG_BANK_5
ld bc,$35c5 ;Bank 5
call loadbank
ld hl,CRT_ORG_BANK_6
ld de,__BANK_6_END_tail - CRT_ORG_BANK_6
ld bc,$36c6 ;Bank 6
call loadbank
ld hl,CRT_ORG_BANK_7
ld de,__BANK_7_END_tail - CRT_ORG_BANK_7
ld bc,$37c7 ;Bank 7
call loadbank
; Load bank2 into screen memory and copy across
; Loading into page2 will clobber ROM vectors
ld hl,49152
ld de,__BANK_2_END_tail - CRT_ORG_BANK_2
ld a,d
or e
ret z
ld bc,$32c0 ;Bank 2
call loadbank
di
ld hl,49152
ld de,$8000
ld bc,__BANK_2_END_tail - CRT_ORG_BANK_2
ldir
ret
; hl = address
; de = length
; c = bank page, b = extension character
loadbank:
ld a,d
or e
ret z
push hl
ld hl,(extension)
ld (hl),b
; Page in the bank
ld b,$7F ;gate array address
out (c),c
ld hl,__crt_loader_filename
call printit
pop de ;de = address to load
ld hl,__crt_loader_filename ;hl = filename
push hl
ld b,0
; Figure out length of filename
get_length:
ld a,(hl)
and a
jr z,length_found
inc hl
inc b
jr get_length
length_found:
pop hl
call cas_in_open ; Load address returned in DE
ex de, hl
call cas_in_direct
call cas_in_close
ld bc,$7fc0
out (c),c
ret
printit:
ld a, (hl)
inc hl
or a
ret z
call txt_output
jr printit
; Populated by appmake
PUBLIC __crt_loader_filename
extension:
defw 0
__crt_loader_filename:
defs 16
|
;
; Galaksija libraries
;
;--------------------------------------------------------------
; Text scrollup.
; Doesn't directly set the current cursor position
;--------------------------------------------------------------
;
; $Id: scrolluptxt.asm $
;
;----------------------------------------------------------------
SECTION code_clib
PUBLIC scrolluptxt
PUBLIC _scrolluptxt
scrolluptxt:
_scrolluptxt:
ld hl,$2800
push hl
ld de,32
add hl,de
pop de
ld bc,32*15
ldir
ld a,32
ld b,a
blankline:
ld (de),a
inc de
djnz blankline
ret
|
; A211958: Number of lower triangular n X n arrays colored with integers 0 upwards introduced in row major order, with no element equal to any diagonal or antidiagonal neighbor, and containing the value n(n+1)/2-2.
; 0,3,12,37,90,186,343,582,927,1405,2046,2883,3952,5292,6945,8956,11373,14247,17632,21585,26166,31438,37467,44322,52075,60801,70578,81487,93612,107040,121861,138168,156057,175627,196980,220221,245458,272802,302367,334270,368631,405573,445222,487707,533160,581716,633513,688692,747397,809775,875976,946153,1020462,1099062,1182115,1269786,1362243,1459657,1562202,1670055,1783396,1902408,2027277,2158192,2295345,2438931,2589148,2746197,2910282,3081610,3260391,3446838,3641167,3843597
add $0,2
mov $1,$0
mul $0,3
bin $1,2
trn $1,2
bin $1,2
add $1,$0
mov $0,$1
sub $0,6
|
/**********************************************************************
Audacity: A Digital Audio Editor
PrefsDialog.cpp
Joshua Haberman
James Crook
*******************************************************************//**
\class PrefsDialog
\brief Dialog that shows the current PrefsPanel in a tabbed divider.
*//*******************************************************************/
#include "../Audacity.h" // for USE_* macros
#include "PrefsDialog.h"
#include "../Experimental.h"
#include <wx/app.h>
#include <wx/setup.h> // for wxUSE_* macros
#include <wx/defs.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/event.h>
#include <wx/font.h>
#include <wx/gdicmn.h>
#include <wx/intl.h>
#include <wx/listbox.h>
#include <wx/sizer.h>
#include <wx/listbook.h>
#include <wx/treebook.h>
#include <wx/treectrl.h>
#include "../AudioIOBase.h"
#include "../Prefs.h"
#include "../ShuttleGui.h"
#include "BatchPrefs.h"
#include "DevicePrefs.h"
#include "DirectoriesPrefs.h"
#include "EffectsPrefs.h"
#include "GUIPrefs.h"
#include "ImportExportPrefs.h"
#include "KeyConfigPrefs.h"
#include "LibraryPrefs.h"
#include "MousePrefs.h"
#ifdef EXPERIMENTAL_MODULE_PREFS
#include "ModulePrefs.h"
#endif
#include "PlaybackPrefs.h"
#include "ProjectsPrefs.h"
#include "QualityPrefs.h"
#include "RecordingPrefs.h"
#include "SpectrumPrefs.h"
#include "ThemePrefs.h"
#include "TracksPrefs.h"
#include "TracksBehaviorsPrefs.h"
#include "WarningsPrefs.h"
// #include "WaveformPrefs.h"
#include "WaveformSettings.h"
#include "ExtImportPrefs.h"
#ifdef EXPERIMENTAL_MIDI_OUT
#include "MidiIOPrefs.h"
#endif
#include "../widgets/HelpSystem.h"
#if wxUSE_ACCESSIBILITY
#include "../widgets/WindowAccessible.h"
#endif
#if wxUSE_ACCESSIBILITY
#ifndef __WXMAC__
// Just an alias
using TreeCtrlAx = WindowAccessible;
#else
// utility functions
namespace {
template< typename Result, typename Fn >
Result VisitItems( const wxTreeCtrl &ctrl, Fn fn )
{
// Do preorder visit of items in the tree until satisfying a test
std::vector< wxTreeItemId > stack;
stack.push_back( ctrl.GetRootItem() );
unsigned position = 0;
while ( !stack.empty() ) {
auto itemId = stack.back();
auto pair = fn( itemId, position );
if ( pair.first )
return pair.second;
wxTreeItemIdValue cookie;
auto childId = ctrl.GetFirstChild( itemId, cookie );
if ( childId )
stack.push_back( childId );
else do {
auto &id = stack.back();
if ( !!( id = ctrl.GetNextSibling( id ) ) )
break;
} while ( stack.pop_back(), !stack.empty() );
++position;
}
return {};
}
unsigned FindItemPosition( const wxTreeCtrl &ctrl, wxTreeItemId id )
{
// Return the 1-based count of the item's position in the pre-order
// visit of the items in the tree (not counting the root item which we
// assume is a dummy that never matches id)
return VisitItems<unsigned>( ctrl,
[=]( wxTreeItemId itemId, unsigned position ){
return std::make_pair( itemId == id, position ); } );
}
wxTreeItemId FindItem( const wxTreeCtrl &ctrl, int nn )
{
// The inverse of the function above
return VisitItems<wxTreeItemId>( ctrl,
[=]( wxTreeItemId itemId, unsigned position ){
return std::make_pair( nn == position, itemId ); } );
}
}
// Define a custom class
class TreeCtrlAx final
: public WindowAccessible
{
public:
TreeCtrlAx(wxTreeCtrl * ctrl);
virtual ~ TreeCtrlAx();
wxAccStatus GetChild(int childId, wxAccessible** child) override;
wxAccStatus GetChildCount(int* childCount) override;
wxAccStatus GetDefaultAction(int childId, wxString *actionName) override;
// Returns the description for this object or a child.
wxAccStatus GetDescription(int childId, wxString *description) override;
// Gets the window with the keyboard focus.
// If childId is 0 and child is NULL, no object in
// this subhierarchy has the focus.
// If this object has the focus, child should be 'this'.
wxAccStatus GetFocus(int *childId, wxAccessible **child) override;
// Returns help text for this object or a child, similar to tooltip text.
wxAccStatus GetHelpText(int childId, wxString *helpText) override;
// Returns the keyboard shortcut for this object or child.
// Return e.g. ALT+K
wxAccStatus GetKeyboardShortcut(int childId, wxString *shortcut) override;
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
// rect is in screen coordinates.
wxAccStatus GetLocation(wxRect& rect, int elementId) override;
// Gets the name of the specified object.
wxAccStatus GetName(int childId, wxString *name) override;
// Returns a role constant.
wxAccStatus GetRole(int childId, wxAccRole *role) override;
// Gets a variant representing the selected children
// of this object.
// Acceptable values:
// - a null variant (IsNull() returns TRUE)
// - a list variant (GetType() == wxT("list"))
// - an integer representing the selected child element,
// or 0 if this object is selected (GetType() == wxT("long"))
// - a "void*" pointer to a wxAccessible child object
//wxAccStatus GetSelections(wxVariant *selections) override;
// leave unimplemented
// Returns a state constant.
wxAccStatus GetState(int childId, long* state) override;
// Returns a localized string representing the value for the object
// or child.
wxAccStatus GetValue(int childId, wxString* strValue) override;
// Navigates from fromId to toId/toObject
// wxAccStatus Navigate(wxNavDir navDir, int fromId, int* toId, wxAccessible** toObject) override;
// Modify focus or selection
wxAccStatus Select(int childId, wxAccSelectionFlags selectFlags) override;
private:
wxTreeCtrl *GetCtrl() { return static_cast<wxTreeCtrl*>( GetWindow() ); }
};
TreeCtrlAx::TreeCtrlAx( wxTreeCtrl *ctrl )
: WindowAccessible{ ctrl }
{
}
TreeCtrlAx::~TreeCtrlAx() = default;
wxAccStatus TreeCtrlAx::GetChild( int childId, wxAccessible** child )
{
if( childId == wxACC_SELF )
{
*child = this;
}
else
{
*child = NULL;
}
return wxACC_OK;
}
wxAccStatus TreeCtrlAx::GetChildCount(int* childCount)
{
auto ctrl = GetCtrl();
if (!ctrl)
return wxACC_FAIL;
*childCount = ctrl->GetCount();
return wxACC_OK;
}
wxAccStatus TreeCtrlAx::GetDefaultAction(int WXUNUSED(childId), wxString* actionName)
{
actionName->clear();
return wxACC_OK;
}
// Returns the description for this object or a child.
wxAccStatus TreeCtrlAx::GetDescription( int WXUNUSED(childId), wxString *description )
{
description->clear();
return wxACC_OK;
}
// This isn't really used yet by wxWidgets as patched by Audacity for
// Mac accessibility, as of Audacity 2.3.2, but here it is anyway, keeping the
// analogy with TrackPanelAx
wxAccStatus TreeCtrlAx::GetFocus( int *childId, wxAccessible **child )
{
auto ctrl = GetCtrl();
if (!ctrl)
return wxACC_FAIL;
auto item = ctrl->GetFocusedItem();
auto id = FindItemPosition( *ctrl, item );
*childId = id;
*child = nullptr;
return wxACC_OK;
}
// Returns help text for this object or a child, similar to tooltip text.
wxAccStatus TreeCtrlAx::GetHelpText( int WXUNUSED(childId), wxString *helpText )
{
helpText->clear();
return wxACC_OK;
}
// Returns the keyboard shortcut for this object or child.
// Return e.g. ALT+K
wxAccStatus TreeCtrlAx::GetKeyboardShortcut( int WXUNUSED(childId), wxString *shortcut )
{
shortcut->clear();
return wxACC_OK;
}
wxAccStatus TreeCtrlAx::GetLocation( wxRect& rect, int elementId )
{
auto ctrl = GetCtrl();
if (!ctrl)
return wxACC_FAIL;
if (elementId == wxACC_SELF)
rect = ctrl->GetRect();
else {
auto item = FindItem( *ctrl, elementId );
if ( !( item && ctrl->GetBoundingRect( item, rect ) ) )
return wxACC_INVALID_ARG;
}
rect.SetPosition( ctrl->GetParent()->ClientToScreen( rect.GetPosition() ) );
return wxACC_OK;
}
wxAccStatus TreeCtrlAx::GetName(int childId, wxString* name)
{
if ( childId == wxACC_SELF )
return WindowAccessible::GetName( childId, name );
else {
auto ctrl = GetCtrl();
if (!ctrl)
return wxACC_FAIL;
auto item = FindItem( *ctrl, childId );
if ( item ) {
*name = ctrl->GetItemText( item );
return wxACC_OK;
}
else
return wxACC_INVALID_ARG;
}
}
wxAccStatus TreeCtrlAx::GetRole( int childId, wxAccRole* role )
{
// Not sure if this correct, but it is analogous with what we use in
// TrackPanel
*role =
childId == wxACC_SELF ? wxROLE_SYSTEM_PANE : wxROLE_SYSTEM_STATICTEXT;
return wxACC_OK;
}
// Returns a state constant.
wxAccStatus TreeCtrlAx::GetState(int childId, long* state)
{
auto ctrl = GetCtrl();
if (!ctrl)
return wxACC_FAIL;
*state = wxACC_STATE_SYSTEM_FOCUSABLE | wxACC_STATE_SYSTEM_SELECTABLE;
if ( childId != wxACC_SELF ) {
auto item = FindItem( *ctrl, childId );
if (item) {
if( item == ctrl->GetFocusedItem() )
*state |= wxACC_STATE_SYSTEM_FOCUSED;
if( item == ctrl->GetSelection() )
*state |= wxACC_STATE_SYSTEM_SELECTED;
}
}
return wxACC_OK;
}
// Returns a localized string representing the value for the object
// or child.
wxAccStatus TreeCtrlAx::GetValue(int childId, wxString* strValue)
{
*strValue = wxString{};
return wxACC_OK;
}
//wxAccStatus TreeCtrlAx::Navigate(
// wxNavDir navDir, int fromId, int* toId, wxAccessible** toObject)
//{
// to do
//}
// Modify focus or selection
wxAccStatus TreeCtrlAx::Select(int childId, wxAccSelectionFlags selectFlags)
{
auto ctrl = GetCtrl();
if (!ctrl)
return wxACC_FAIL;
if (childId != wxACC_SELF) {
int childCount;
GetChildCount( &childCount );
if (childId > childCount)
return wxACC_FAIL;
auto item = FindItem( *ctrl, childId );
if ( item ) {
if (selectFlags == wxACC_SEL_TAKEFOCUS)
ctrl->SetFocusedItem( item );
else if (selectFlags == wxACC_SEL_TAKESELECTION)
ctrl->SelectItem( item );
else
return wxACC_NOT_IMPLEMENTED;
return wxACC_OK;
}
}
return wxACC_NOT_IMPLEMENTED;
}
#endif
#endif
// PrefsPanel might move out into its own file in due ocurse.
PluginPath PrefsPanel::GetPath(){ return BUILTIN_PREFS_PANEL_PREFIX + GetSymbol().Internal(); }
VendorSymbol PrefsPanel::GetVendor(){ return XO("Audacity");}
wxString PrefsPanel::GetVersion(){ return AUDACITY_VERSION_STRING;}
BEGIN_EVENT_TABLE(PrefsDialog, wxDialogWrapper)
EVT_BUTTON(wxID_OK, PrefsDialog::OnOK)
EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel)
EVT_BUTTON(wxID_PREVIEW, PrefsDialog::OnPreview)
EVT_BUTTON(wxID_HELP, PrefsDialog::OnHelp)
EVT_TREE_KEY_DOWN(wxID_ANY, PrefsDialog::OnTreeKeyDown) // Handles key events when tree has focus
END_EVENT_TABLE()
class wxTreebookExt final : public wxTreebook
{
public:
wxTreebookExt( wxWindow *parent,
wxWindowID id, const wxString &titlePrefix)
: wxTreebook( parent, id )
, mTitlePrefix(titlePrefix)
{;};
~wxTreebookExt(){;};
int ChangeSelection(size_t n) override;
int SetSelection(size_t n) override;
const wxString mTitlePrefix;
};
int wxTreebookExt::ChangeSelection(size_t n) {
int i = wxTreebook::ChangeSelection(n);
wxString Temp = GetPageText( n );
static_cast<wxDialog*>(GetParent())->SetTitle( Temp );
static_cast<wxDialog*>(GetParent())->SetName( Temp );
return i;
};
int wxTreebookExt::SetSelection(size_t n)
{
int i = wxTreebook::SetSelection(n);
wxString Temp = wxString(mTitlePrefix) + GetPageText( n );
static_cast<wxDialog*>(GetParent())->SetTitle( Temp );
static_cast<wxDialog*>(GetParent())->SetName( Temp );
PrefsPanel *const panel = static_cast<PrefsPanel *>(GetPage(n));
const bool showHelp = (!panel->HelpPageName().empty());
const bool showPreview = panel->ShowsPreviewButton();
wxWindow *const helpButton = wxWindow::FindWindowById(wxID_HELP, GetParent());
wxWindow *const previewButton = wxWindow::FindWindowById(wxID_PREVIEW, GetParent());
if (helpButton) {
if (showHelp) {
wxAcceleratorEntry entries[1];
#if defined(__WXMAC__)
// Is there a standard shortcut on Mac?
#else
entries[0].Set(wxACCEL_NORMAL, (int) WXK_F1, wxID_HELP);
#endif
wxAcceleratorTable accel(1, entries);
this->SetAcceleratorTable(accel);
}
else {
this->SetAcceleratorTable(wxNullAcceleratorTable);
}
const bool changed = helpButton->Show(showHelp);
if (changed)
GetParent()->Layout();
}
if (previewButton) { // might still be NULL during population
const bool changed = previewButton->Show(showPreview);
if (changed)
GetParent()->Layout();
}
return i;
}
PrefsDialog::Factories
&PrefsDialog::DefaultFactories()
{
// To do, perhaps: create this table by registration, without including each PrefsPanel
// class... and thus allowing a plug-in protocol
static PrefsNode nodes[] = {
DevicePrefsFactory,
PlaybackPrefsFactory,
RecordingPrefsFactory,
#ifdef EXPERIMENTAL_MIDI_OUT
MidiIOPrefsFactory,
#endif
QualityPrefsFactory,
GUIPrefsFactory,
// Group other page(s)
PrefsNode(TracksPrefsFactory, 2),
// WaveformPrefsFactory(),
TracksBehaviorsPrefsFactory,
SpectrumPrefsFactory(),
// Group one other page
PrefsNode(ImportExportPrefsFactory, 1),
ExtImportPrefsFactory,
#ifdef EXPERIMENTAL_OD_DATA
ProjectsPrefsFactory,
#endif
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || !defined(DISABLE_DYNAMIC_LOADING_LAME)
LibraryPrefsFactory,
#endif
DirectoriesPrefsFactory(),
WarningsPrefsFactory,
EffectsPrefsFactory,
#ifdef EXPERIMENTAL_THEME_PREFS
ThemePrefsFactory,
#endif
// &batchPrefsFactory,
KeyConfigPrefsFactory(),
MousePrefsFactory,
#ifdef EXPERIMENTAL_MODULE_PREFS
ModulePrefsFactory,
#endif
};
static Factories factories(nodes, nodes + sizeof(nodes) / sizeof(nodes[0]));
return factories;
}
PrefsDialog::PrefsDialog
(wxWindow * parent, const wxString &titlePrefix, Factories &factories)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("Audacity Preferences")),
wxDefaultPosition,
wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
, mFactories(factories)
, mTitlePrefix(titlePrefix)
{
wxASSERT(factories.size() > 0);
const bool uniquePage = (factories.size() == 1);
SetLayoutDirection(wxLayout_LeftToRight);
ShuttleGui S(this, eIsCreating);
S.StartVerticalLay(true);
{
wxASSERT(factories.size() > 0);
if (!uniquePage) {
mCategories = safenew wxTreebookExt(this, wxID_ANY, mTitlePrefix);
#if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control
mCategories->GetTreeCtrl()->SetAccessible(
safenew TreeCtrlAx(mCategories->GetTreeCtrl()));
#endif
// RJH: Prevent NVDA from reading "treeCtrl"
mCategories->GetTreeCtrl()->SetName(_("Category"));
S.StartHorizontalLay(wxALIGN_LEFT | wxEXPAND, true);
{
S.Prop(1);
S.AddWindow(mCategories, wxEXPAND);
{
typedef std::pair<int, int> IntPair;
std::vector<IntPair> stack;
int iPage = 0;
for (Factories::const_iterator it = factories.begin(), end = factories.end();
it != end; ++it, ++iPage)
{
const PrefsNode &node = *it;
const PrefsPanel::Factory &factory = node.factory;
wxWindow *const w = factory(mCategories, wxID_ANY);
if (stack.empty())
// Parameters are: AddPage(page, name, IsSelected, imageId).
mCategories->AddPage(w, w->GetName(), false, 0);
else {
IntPair &top = *stack.rbegin();
mCategories->InsertSubPage(top.first, w, w->GetName(), false, 0);
if (--top.second == 0) {
// Expand all nodes before the layout calculation
mCategories->ExpandNode(top.first, true);
stack.pop_back();
}
}
if (node.nChildren > 0)
stack.push_back(IntPair(iPage, node.nChildren));
}
}
}
S.EndHorizontalLay();
}
else {
// TODO: Look into getting rid of mUniquePage and instead
// adding into mCategories, so there is just one page in mCategories.
// And then hiding the treebook.
// Unique page, don't show the factory
const PrefsNode &node = factories[0];
const PrefsPanel::Factory &factory = node.factory;
mUniquePage = factory(this, wxID_ANY);
wxWindow * uniquePageWindow = S.Prop(1).AddWindow(mUniquePage, wxEXPAND);
// We're not in the wxTreebook, so add the accelerator here
wxAcceleratorEntry entries[1];
#if defined(__WXMAC__)
// Is there a standard shortcut on Mac?
#else
entries[0].Set(wxACCEL_NORMAL, (int) WXK_F1, wxID_HELP);
#endif
wxAcceleratorTable accel(1, entries);
uniquePageWindow->SetAcceleratorTable(accel);
}
}
S.EndVerticalLay();
S.AddStandardButtons(eOkButton | eCancelButton | ePreviewButton | eHelpButton);
static_cast<wxButton*>(wxWindow::FindWindowById(wxID_OK, this))->SetDefault();
if (mUniquePage && !mUniquePage->ShowsPreviewButton()) {
wxWindow *const previewButton =
wxWindow::FindWindowById(wxID_PREVIEW, GetParent());
previewButton->Show(false);
}
#if defined(__WXGTK__)
if (mCategories)
mCategories->GetTreeCtrl()->EnsureVisible(mCategories->GetTreeCtrl()->GetRootItem());
#endif
// mCategories->SetSizeHints(-1, -1, 790, 600); // 790 = 800 - (border * 2)
Layout();
Fit();
wxSize sz = GetSize();
// Collapse nodes only after layout so the tree is wide enough
if (mCategories)
{
int iPage = 0;
for (Factories::const_iterator it = factories.begin(), end = factories.end();
it != end; ++it, ++iPage)
mCategories->ExpandNode(iPage, it->expanded);
}
// This ASSERT was originally used to limit us to 800 x 600.
// However, the range of screen sizes and dpi of modern (2018) displays
// makes pixel dimensions an inadequate measure of usability, so
// now we only ASSERT that preferences will fit in the client display
// rectangle of the developer / tester's monitor.
// Use scrollers when necessary to ensure that preference pages will
// be fully visible.
wxRect screenRect(wxGetClientDisplayRect());
wxASSERT_MSG(sz.x <= screenRect.width && sz.y <= screenRect.height, wxT("Preferences dialog exceeds max size"));
sz.DecTo(screenRect.GetSize());
if( !mUniquePage ){
int prefWidth, prefHeight;
gPrefs->Read(wxT("/Prefs/Width"), &prefWidth, sz.x);
gPrefs->Read(wxT("/Prefs/Height"), &prefHeight, wxMax(480,sz.y));
wxSize prefSize = wxSize(prefWidth, prefHeight);
prefSize.DecTo(screenRect.GetSize());
SetSize(prefSize);
InvalidateBestSize();
Layout();
}
SetMinSize(sz);
// Center after all that resizing, but make sure it doesn't end up
// off-screen
CentreOnParent();
}
PrefsDialog::~PrefsDialog()
{
}
int PrefsDialog::ShowModal()
{
if (mCategories) {
/* long is signed, size_t is unsigned. On some platforms they are different
* lengths as well. So we must check that the stored category is both > 0
* and within the possible range of categories, making the first check on the
* _signed_ value to avoid issues when converting an unsigned one.
*/
long selected = GetPreferredPage();
if (selected < 0 || size_t(selected) >= mCategories->GetPageCount())
selected = 0; // clamp to available range of tabs
mCategories->SetSelection(selected);
}
else {
wxString Temp = mTitlePrefix + mUniquePage->GetLabel();
SetTitle(Temp);
SetName(Temp);
}
return wxDialogWrapper::ShowModal();
}
void PrefsDialog::OnCancel(wxCommandEvent & WXUNUSED(event))
{
RecordExpansionState();
if (mCategories) {
for (size_t i = 0; i < mCategories->GetPageCount(); i++) {
((PrefsPanel *)mCategories->GetPage(i))->Cancel();
}
}
else
mUniquePage->Cancel();
// Remember modified dialog size, even if cancelling.
if( !mUniquePage ){
wxSize sz = GetSize();
gPrefs->Write(wxT("/Prefs/Width"), sz.x);
gPrefs->Write(wxT("/Prefs/Height"), sz.y);
}
gPrefs->Flush();
EndModal(false);
}
PrefsPanel * PrefsDialog::GetCurrentPanel()
{
if( mCategories)
return static_cast<PrefsPanel*>(mCategories->GetCurrentPage());
else
{
wxASSERT( mUniquePage );
return mUniquePage;
}
}
void PrefsDialog::OnPreview(wxCommandEvent & WXUNUSED(event))
{
GetCurrentPanel()->Preview();
}
void PrefsDialog::OnHelp(wxCommandEvent & WXUNUSED(event))
{
wxString page = GetCurrentPanel()->HelpPageName();
HelpSystem::ShowHelp(this, page, true);
}
void PrefsDialog::ShuttleAll( ShuttleGui & S)
{
// Validate all pages first
if (mCategories) {
for (size_t i = 0; i < mCategories->GetPageCount(); i++) {
S.ResetId();
PrefsPanel *panel = (PrefsPanel *)mCategories->GetPage(i);
panel->PopulateOrExchange( S );
}
}
else
{
S.ResetId();
mUniquePage->PopulateOrExchange( S );
}
}
void PrefsDialog::OnTreeKeyDown(wxTreeEvent & event)
{
if(event.GetKeyCode() == WXK_RETURN)
OnOK(event);
else
event.Skip(); // Ensure standard behavior when enter is not pressed
}
void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event))
{
RecordExpansionState();
// Validate all pages first
if (mCategories) {
for (size_t i = 0; i < mCategories->GetPageCount(); i++) {
PrefsPanel *panel = (PrefsPanel *)mCategories->GetPage(i);
// The dialog doesn't end until all the input is valid
if (!panel->Validate()) {
mCategories->SetSelection(i);
return;
}
}
}
else {
if (!mUniquePage->Validate())
return;
}
// flush now so toolbars will know their position.
gPrefs->Flush();
if (mCategories) {
// Now apply the changes
// Reverse order - so Track Name is updated before language change
// A workaround for Bug 1661
for (int i = (int)mCategories->GetPageCount()-1; i>= 0; i--) {
PrefsPanel *panel = (PrefsPanel *)mCategories->GetPage(i);
panel->Preview();
panel->Commit();
}
}
else {
mUniquePage->Preview();
mUniquePage->Commit();
}
if( !mUniquePage ){
wxSize sz = GetSize();
gPrefs->Write(wxT("/Prefs/Width"), sz.x);
gPrefs->Write(wxT("/Prefs/Height"), sz.y);
}
gPrefs->Flush();
SavePreferredPage();
#if USE_PORTMIXER
auto gAudioIO = AudioIOBase::Get();
if (gAudioIO) {
// We cannot have opened this dialog if gAudioIO->IsAudioTokenActive(),
// per the setting of AudioIONotBusyFlag and AudioIOBusyFlag in
// AudacityProject::GetUpdateFlags().
// However, we can have an invalid audio token (so IsAudioTokenActive()
// is false), but be monitoring.
// If monitoring, have to stop the stream, so HandleDeviceChange() can work.
// We could disable the Preferences command while monitoring, i.e.,
// set AudioIONotBusyFlag/AudioIOBusyFlag according to monitoring, as well.
// Instead allow it because unlike recording, for example, monitoring
// is not clearly something that should prohibit opening prefs.
// TODO: We *could* be smarter in this method and call HandleDeviceChange()
// only when the device choices actually changed. True of lots of prefs!
// As is, we always stop monitoring before handling the device change.
if (gAudioIO->IsMonitoring())
{
gAudioIO->StopStream();
while (gAudioIO->IsBusy())
wxMilliSleep(100);
}
gAudioIO->HandleDeviceChange();
}
#endif
// PRL: Is the following concern still valid, now that prefs update is
// handled instead by delayed event processing?
// LL: wxMac can't handle recreating the menus when this dialog is still active,
// so AudacityProject::UpdatePrefs() or any of the routines it calls must
// not cause MenuCreator::RebuildMenuBar() to be executed.
wxTheApp->AddPendingEvent(wxCommandEvent{ EVT_PREFS_UPDATE });
WaveformSettings::defaults().LoadPrefs();
SpectrogramSettings::defaults().LoadPrefs();
if( IsModal() )
EndModal(true);
else
Destroy();
}
void PrefsDialog::SelectPageByName(const wxString &pageName)
{
if (mCategories) {
size_t n = mCategories->GetPageCount();
for (size_t i = 0; i < n; i++) {
if (mCategories->GetPageText(i) == pageName) {
mCategories->SetSelection(i);
return;
}
}
}
}
int PrefsDialog::GetSelectedPage() const
{
if (mCategories)
return mCategories->GetSelection();
else
return 0;
}
GlobalPrefsDialog::GlobalPrefsDialog(wxWindow * parent, Factories &factories)
: PrefsDialog(parent, _("Preferences: "), factories)
{
}
GlobalPrefsDialog::~GlobalPrefsDialog()
{
}
long GlobalPrefsDialog::GetPreferredPage()
{
long prefscat = gPrefs->Read(wxT("/Prefs/PrefsCategory"), 0L);
return prefscat;
}
void GlobalPrefsDialog::SavePreferredPage()
{
gPrefs->Write(wxT("/Prefs/PrefsCategory"), (long)GetSelectedPage());
gPrefs->Flush();
}
void PrefsDialog::RecordExpansionState()
{
// Remember expansion state of the tree control
if (mCategories)
{
int iPage = 0;
for (Factories::iterator it = mFactories.begin(), end = mFactories.end();
it != end; ++it, ++iPage)
it->expanded = mCategories->IsNodeExpanded(iPage);
}
else
mFactories[0].expanded = true;
}
PrefsPanel::~PrefsPanel()
{
}
void PrefsPanel::Cancel()
{
}
bool PrefsPanel::ShowsPreviewButton()
{
return false;
}
wxString PrefsPanel::HelpPageName()
{
return wxEmptyString;
}
#include <wx/frame.h>
#include "../Menus.h"
#include "../Project.h"
void DoReloadPreferences( AudacityProject &project )
{
{
SpectrogramSettings::defaults().LoadPrefs();
WaveformSettings::defaults().LoadPrefs();
GlobalPrefsDialog dialog(&GetProjectFrame( project ) /* parent */ );
wxCommandEvent Evt;
//dialog.Show();
dialog.OnOK(Evt);
}
// LL: Moved from PrefsDialog since wxWidgets on OSX can't deal with
// rebuilding the menus while the PrefsDialog is still in the modal
// state.
for (auto p : AllProjects{}) {
MenuManager::Get(*p).RebuildMenuBar(*p);
// TODO: The comment below suggests this workaround is obsolete.
#if defined(__WXGTK__)
// Workaround for:
//
// http://bugzilla.audacityteam.org/show_bug.cgi?id=458
//
// This workaround should be removed when Audacity updates to wxWidgets
// 3.x which has a fix.
auto &window = GetProjectFrame( *p );
wxRect r = window.GetRect();
window.SetSize(wxSize(1,1));
window.SetSize(r.GetSize());
#endif
}
}
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1ce29, %rax
nop
nop
and $62005, %rcx
mov $0x6162636465666768, %r8
movq %r8, %xmm0
vmovups %ymm0, (%rax)
nop
nop
nop
nop
nop
and $8370, %r11
lea addresses_WC_ht+0x1a7b1, %rdi
nop
nop
nop
nop
nop
and %r12, %r12
movups (%rdi), %xmm7
vpextrq $0, %xmm7, %r9
xor $39999, %rdi
lea addresses_UC_ht+0x1d409, %rax
nop
and %rcx, %rcx
mov (%rax), %r9d
nop
xor $60343, %r11
lea addresses_D_ht+0x113e1, %rax
nop
nop
and $28092, %r8
movl $0x61626364, (%rax)
nop
nop
nop
xor $10194, %r9
lea addresses_normal_ht+0xc189, %rsi
lea addresses_A_ht+0xea81, %rdi
dec %r11
mov $2, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $36671, %r9
lea addresses_A_ht+0x12e65, %rsi
lea addresses_WT_ht+0xca09, %rdi
nop
nop
nop
nop
xor $41450, %rax
mov $70, %rcx
rep movsb
nop
nop
cmp %r11, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r8
push %r9
push %rax
push %rbx
push %rdi
push %rdx
// Faulty Load
lea addresses_WC+0x14209, %rbx
add $11657, %rax
mov (%rbx), %r8
lea oracles, %r9
and $0xff, %r8
shlq $12, %r8
mov (%r9,%r8,1), %r8
pop %rdx
pop %rdi
pop %rbx
pop %rax
pop %r9
pop %r8
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
;/*++
;
;Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
;This program and the accompanying materials
;are licensed and made available under the terms and conditions of the BSD License
;which accompanies this distribution. The full text of the license may be found at
;http://opensource.org/licenses/bsd-license.php
;
;THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
;WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
;Module Name:
;
; MultU64x32.c
;
;Abstract:
;
; 64-bit Multiplication function for IA-32
;
;--*/
;---------------------------------------------------------------------------
.686
.model flat,C
.code
;---------------------------------------------------------------------------
;UINT64
;MultU64x32 (
; IN UINT64 Multiplicand,
; IN UINTN Multiplier
; )
;/*++
;
;Routine Description:
;
; This routine allows a 64 bit value to be multiplied with a 32 bit
; value returns 64bit result.
; No checking if the result is greater than 64bits
;
;Arguments:
;
; Multiplicand - multiplicand
; Multiplier - multiplier
;
;Returns:
;
; Multiplicand * Multiplier
;
;--*/
MultU64x32 PROC
mov eax, [esp + 4]; dword ptr Multiplicand[0]
mul dword ptr [esp + 0Ch] ; Multiplier
push eax
push edx
mov eax, [esp + 10h]; dword ptr Multiplicand[4]
mul dword ptr [esp + 14h]; Multiplier
;
; The value in edx stored by second multiplication overflows
; the output and should be discarded. So here we overwrite it
; with the edx value of first multiplication.
;
pop edx
add edx, eax
pop eax
ret
MultU64x32 ENDP
END
|
; A039599: Triangle formed from even-numbered columns of triangle of expansions of powers of x in terms of Chebyshev polynomials U_n(x).
; Submitted by Jon Maiga
; 1,1,1,2,3,1,5,9,5,1,14,28,20,7,1,42,90,75,35,9,1,132,297,275,154,54,11,1,429,1001,1001,637,273,77,13,1,1430,3432,3640,2548,1260,440,104,15,1,4862,11934,13260,9996,5508,2244,663,135,17,1,16796,41990,48450,38760,23256,10659,3705,950,170,19,1,58786,149226,177650,149226,95931,48279,19019,5775,1309,209,21,1,208012,534888,653752,572033,389367,211508,92092,31878,8602,1748,252,23,1,742900,1931540,2414425,2187185,1562275,904475,427570,164450,50830
lpb $0
add $2,1
sub $0,$2
mov $1,$2
lpe
add $0,$2
mul $1,2
bin $1,$0
add $0,1
mul $2,2
bin $2,$0
sub $1,$2
mov $0,$1
|
; ************************************************************************************************************
; ************************************************************************************************************
;
; 1861 Display Routine
;
; ************************************************************************************************************
; ************************************************************************************************************
Return:
ldxa ; restore DF
shl
ldxa ; restore D
ret ; restore X,P
Interrupt:
dec r2 ; [2/2] save return XP on stack
sav ; [2/4]
dec r2 ; [2/6] save D on stack
str r2 ; [2/8]
ldi screen/256 ; [2/10] set up R0.1
phi r0 ; [2/12]
ldi 0 ; [2/14] set up R0.0
plo r0
nop ; pad out cycles till rendering
nop
nop
Refresh:
glo r0 ; do four scan lines for each row
sex r2
sex r2
dec r0
plo r0
sex r2
dec r0
plo r0
sex r2
dec r0
plo r0
bn1 Refresh ; in emulator we never loop back
dec r2 ; save DF.
shrc
str r2
lri r0,timers ; point R0 to the timers.
__IRQTimerLoop:
lda r0 ; read timer value and advance
bz __IRQNextTimer ; if zero do next ?
dec r0 ; if not, decrement the counter.
smi 1
str r0
inc r0
__IRQNextTimer:
glo r0 ; do all the tiners
bnz __IRQTimerLoop
br Return |
# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
# Written By Timothy Wall
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# In addition to the permissions in the GNU General Public License, the
# Free Software Foundation gives you unlimited permission to link the
# compiled version of this file with other programs, and to distribute
# those programs without any restriction coming from the use of this
# file. (The General Public License restrictions do apply in other
# respects; for example, they cover modification of the file, and
# distribution when not linked into another program.)
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# As a special exception, if you link this library with files
# compiled with GCC to produce an executable, this does not cause
# the resulting executable to be covered by the GNU General Public License.
# This exception does not however invalidate any other reasons why
# the executable file might be covered by the GNU General Public License.
#
# This file just make a stack frame for the contents of the .fini and
# .init sections. Users may put any desired instructions in those
# sections.
.file "crti.asm"
.section ".init"
.align 16
.global _init
_init:
.prologue 14, 33
.save ar.pfs, r34
alloc r34 = ar.pfs, 0, 4, 0, 0
.vframe r35
mov r35 = r12
.save rp, r33
mov r33 = b0
.body
.section ".fini"
.align 16
.global _fini
_fini:
.prologue 14, 33
.save ar.pfs, r34
alloc r34 = ar.pfs, 0, 4, 0, 0
.vframe r35
mov r35 = r12
.save rp, r33
mov r33 = b0
.body
# end of crti.asm
|
;
; Sharp OZ family functions
;
; ported from the OZ-7xx SDK by by Alexander R. Pruss
; by Stefano Bodrato - Oct. 2003
;
;
; restore the page A000
;
;
; ------
; $Id: restore_a000.asm,v 1.1 2003/10/21 17:15:19 stefano Exp $
;
XLIB restore_a000
restore_a000:
ld a,7
out (3),a
ld a,4
out (4),a
ret
|
GLOBAL _start
SECTION .data
_start:
jmp do_call
jmp_back:
xor eax, eax
add eax, 11
pop ebx
mov [ebx+7], byte ah
xor ecx, ecx
xor edx, edx
int 0x80
do_call:
call jmp_back
shell:
db '/bin/shN'
|
; A140675: a(n) = n*(3*n + 19)/2.
; 0,11,25,42,62,85,111,140,172,207,245,286,330,377,427,480,536,595,657,722,790,861,935,1012,1092,1175,1261,1350,1442,1537,1635,1736,1840,1947,2057,2170,2286,2405,2527,2652,2780,2911,3045,3182,3322,3465,3611,3760,3912,4067,4225,4386,4550,4717,4887,5060,5236,5415,5597,5782,5970,6161,6355,6552,6752,6955,7161,7370,7582,7797,8015,8236,8460,8687,8917,9150,9386,9625,9867,10112,10360,10611,10865,11122,11382,11645,11911,12180,12452,12727,13005,13286,13570,13857,14147,14440,14736,15035,15337,15642,15950,16261,16575,16892,17212,17535,17861,18190,18522,18857,19195,19536,19880,20227,20577,20930,21286,21645,22007,22372,22740,23111,23485,23862,24242,24625,25011,25400,25792,26187,26585,26986,27390,27797,28207,28620,29036,29455,29877,30302,30730,31161,31595,32032,32472,32915,33361,33810,34262,34717,35175,35636,36100,36567,37037,37510,37986,38465,38947,39432,39920,40411,40905,41402,41902,42405,42911,43420,43932,44447,44965,45486,46010,46537,47067,47600,48136,48675,49217,49762,50310,50861,51415,51972,52532,53095,53661,54230,54802,55377,55955,56536,57120,57707,58297,58890,59486,60085,60687,61292,61900,62511,63125,63742,64362,64985,65611,66240,66872,67507,68145,68786,69430,70077,70727,71380,72036,72695,73357,74022,74690,75361,76035,76712,77392,78075,78761,79450,80142,80837,81535,82236,82940,83647,84357,85070,85786,86505,87227,87952,88680,89411,90145,90882,91622,92365,93111,93860,94612,95367
mov $1,3
mul $1,$0
add $1,19
mul $1,$0
div $1,2
|
/*-------------------------------------------------------------------------
* OpenGL Conformance Test Suite
* -----------------------------
*
* Copyright (c) 2018 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/ /*!
* \file es3cCopyTexImageConversionsTests.cpp
* \brief Tests verifying glCopyTexImage2D..
*/ /*-------------------------------------------------------------------*/
#include "es3cCopyTexImageConversionsTests.hpp"
#include "deMath.h"
#include "deSharedPtr.hpp"
#include "gluContextInfo.hpp"
#include "gluDefs.hpp"
#include "gluStrUtil.hpp"
#include "glwEnums.hpp"
#include "glwFunctions.hpp"
#include "tcuStringTemplate.hpp"
#include "tcuTestLog.hpp"
#include <cstring>
#include <limits>
#include <map>
using namespace glw;
namespace es3cts
{
// Amount of entries database should allocate for its entries upon creation.
#define N_START_CONVERSION_DATABASE_ENTRIES (32)
// Should 3D textures be used as source attachments, this field defines
// their depth. It MUST be at least 2, because the test implementation
// also uses second array (counted from one) to store the data-set information.
#define TEXTURE_DEPTH (2)
// Data set height
#define TEXTURE_HEIGHT (2)
// Data set width
#define TEXTURE_WIDTH (2)
// Defines for non color-renderable textures support
#define NUMBER_OF_ELEMENTS_IN_VEC4 (4)
#define NUMBER_OF_POINTS_TO_DRAW (TEXTURE_WIDTH * TEXTURE_HEIGHT)
#define TEXTURE_COORDINATES_ARRAY_SIZE (TEXTURE_WIDTH * TEXTURE_HEIGHT * NUMBER_OF_ELEMENTS_IN_VEC4 * sizeof(float))
#define TEXTURE_2D_SAMPLER_TYPE (0)
#define TEXTURE_3D_SAMPLER_TYPE (1)
#define TEXTURE_2D_ARRAY_SAMPLER_TYPE (2)
#define TEXTURE_CUBE_SAMPLER_TYPE (3)
#define SRC_TEXTURE_COORDS_ATTRIB_INDEX (1)
#define DST_TEXTURE_COORDS_ATTRIB_INDEX (0)
// Buffer object indices used for non color-renderable textures support.
#define COMPARISON_RESULT_BUFFER_OBJECT_INDEX (0)
#define SOURCE_TEXTURE_PIXELS_BUFFER_OBJECT_INDEX (1)
#define DESTINATION_TEXTURE_PIXELS_BUFFER_OBJECT_INDEX (2)
// Stores detailed information about:
// 1) what FBO effective internalformats can be used for glCopyTexImage2D(), assuming
// specific result texture's internalformat as passed by one of the arguments.
// 2) what internalformat the result texture object should use.
const GLenum conversionArray[] = {
/* GL_RGBA GL_RGB GL_LUMINANCE_ALPHA GL_LUMINANCE GL_ALPHA GL_R8 GL_R8_SNORM GL_RG8 GL_RG8_SNORM GL_RGB8 GL_RGB8_SNORM GL_RGB565 GL_RGBA4 GL_RGB5_A1 GL_RGBA8 GL_RGBA8_SNORM GL_RGB10_A2 GL_RGB10_A2UI GL_SRGB8 GL_SRGB8_ALPHA8 GL_R16F GL_RG16F GL_RGB16F GL_RGBA16F GL_R32F GL_RG32F GL_RGB32F GL_RGBA32F GL_R11F_G11F_B10F GL_RGB9_E5 GL_R8I GL_R8UI GL_R16I GL_R16UI GL_R32I GL_R32UI GL_RG8I GL_RG8UI GL_RG16I GL_RG16UI GL_RG32I GL_RG32UI GL_RGB8I GL_RGB8UI GL_RGB16I GL_RGB16UI GL_RGB32I GL_RGB32UI GL_RGBA8I GL_RGBA8UI GL_RGBA16I GL_RGBA16UI GL_RGBA32I GL_RGBA32UI */
/* GL_R8, */ GL_NONE, GL_NONE, GL_NONE, GL_LUMINANCE8_OES, GL_NONE, GL_R8, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RG8, */ GL_NONE, GL_NONE, GL_NONE, GL_LUMINANCE8_OES, GL_NONE, GL_R8, GL_NONE, GL_RG8, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGB8, */ GL_NONE, GL_RGB8, GL_NONE, GL_LUMINANCE8_OES, GL_NONE, GL_R8, GL_NONE, GL_RG8, GL_NONE, GL_RGB8, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGB565, */ GL_NONE, GL_RGB565, GL_NONE, GL_LUMINANCE8_OES, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB565, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGBA4, */ GL_RGBA4, GL_RGB565, GL_LUMINANCE8_ALPHA8_OES, GL_LUMINANCE8_OES, GL_ALPHA8_OES, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGBA4, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGB5_A1, */ GL_RGB5_A1, GL_RGB565, GL_LUMINANCE8_ALPHA8_OES, GL_LUMINANCE8_OES, GL_ALPHA8_OES, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB5_A1, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGBA8, */ GL_RGBA8, GL_RGB8, GL_LUMINANCE8_ALPHA8_OES, GL_LUMINANCE8_OES, GL_ALPHA8_OES, GL_R8, GL_NONE, GL_RG8, GL_NONE, GL_RGB8, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGBA8, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGB10_A2, */ GL_NONE, GL_RGB8, GL_NONE, GL_LUMINANCE8_OES, GL_ALPHA8_OES, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB10_A2, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGB10_A2UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB10_A2UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_SRGB8_ALPHA8, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_SRGB8, GL_SRGB8_ALPHA8, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_R8I, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R8I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_R8UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R8UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_R16I, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_R16UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_R32I, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_R32UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RG8I, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R8I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG8I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RG8UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R8UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG8UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RG16I, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG16I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RG16UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG16UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RG32I, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG32I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RG32UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG32UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGBA8I, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R8I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG8I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB8I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGBA8I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGBA8UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R8UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG8UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB8UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGBA8UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGBA16I, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG16I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB16I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGBA16I, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGBA16UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG16UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB16UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGBA16UI, GL_NONE, GL_NONE,
/* GL_RGBA32I, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG32I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB32I, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGBA32I, GL_NONE,
/* GL_RGBA32UI, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RG32UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGB32UI, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_RGBA32UI,
/* GL_R16F, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16F, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RG16F, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16F, GL_RG16F, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_R32F, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32F, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RG32F, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32F, GL_RG32F, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGB16F, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16F, GL_RG16F, GL_RGB16F, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGBA16F, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R16F, GL_RG16F, GL_RGB16F, GL_RGBA16F, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGB32F, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32F, GL_RG32F, GL_RGB32F, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
/* GL_RGBA32F, */ GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_R32F, GL_RG32F, GL_RGB32F, GL_RGBA32F, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE,
};
// Tells:
// 1) how many rows conversion_array uses.
// 2) what destination internalformat (NOT effective internalformat!)
// corresponds to each entry.
// NOTE: If you need to modify this array, make sure conversion-array
// is updated accordingly!
const GLenum copyTexImage2DInternalFormatOrdering[] = { GL_RGBA,
GL_RGB,
GL_LUMINANCE_ALPHA,
GL_LUMINANCE,
GL_ALPHA,
GL_R8,
GL_R8_SNORM,
GL_RG8,
GL_RG8_SNORM,
GL_RGB8,
GL_RGB8_SNORM,
GL_RGB565,
GL_RGBA4,
GL_RGB5_A1,
GL_RGBA8,
GL_RGBA8_SNORM,
GL_RGB10_A2,
GL_RGB10_A2UI,
GL_SRGB8,
GL_SRGB8_ALPHA8,
GL_R16F,
GL_RG16F,
GL_RGB16F,
GL_RGBA16F,
GL_R32F,
GL_RG32F,
GL_RGB32F,
GL_RGBA32F,
GL_R11F_G11F_B10F,
GL_RGB9_E5,
GL_R8I,
GL_R8UI,
GL_R16I,
GL_R16UI,
GL_R32I,
GL_R32UI,
GL_RG8I,
GL_RG8UI,
GL_RG16I,
GL_RG16UI,
GL_RG32I,
GL_RG32UI,
GL_RGB8I,
GL_RGB8UI,
GL_RGB16I,
GL_RGB16UI,
GL_RGB32I,
GL_RGB32UI,
GL_RGBA8I,
GL_RGBA8UI,
GL_RGBA16I,
GL_RGBA16UI,
GL_RGBA32I,
GL_RGBA32UI };
// Ordering as per Bug 9807 table for FBO effective internalformats
const GLenum fboEffectiveInternalFormatOrdering[] = {
GL_R8, GL_RG8, GL_RGB8, GL_RGB565, GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGB10_A2UI,
GL_SRGB8_ALPHA8, GL_R8I, GL_R8UI, GL_R16I, GL_R16UI, GL_R32I, GL_R32UI, GL_RG8I, GL_RG8UI,
GL_RG16I, GL_RG16UI, GL_RG32I, GL_RG32UI, GL_RGBA8I, GL_RGBA8UI, GL_RGBA16I, GL_RGBA16UI, GL_RGBA32I,
GL_RGBA32UI, GL_R16F, GL_RG16F, GL_R32F, GL_RG32F, GL_RGB16F, GL_RGBA16F, GL_RGB32F, GL_RGBA32F,
};
// Tells how channels are ordered for a particular pixel.
enum ChannelOrder
{
CHANNEL_ORDER_ABGR,
CHANNEL_ORDER_BGR,
CHANNEL_ORDER_BGRA,
CHANNEL_ORDER_R,
CHANNEL_ORDER_RG,
CHANNEL_ORDER_RGB,
CHANNEL_ORDER_RGBA,
CHANNEL_ORDER_UNKNOWN
};
// Tells how many bits and what type is used for data representation
// for a single pixel channel.
enum ChannelDataType
{
CHANNEL_DATA_TYPE_NONE = 0,
CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS,
CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS,
CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS,
CHANNEL_DATA_TYPE_UNSIGNED_BYTE_1BIT,
CHANNEL_DATA_TYPE_UNSIGNED_BYTE_2BITS,
CHANNEL_DATA_TYPE_UNSIGNED_BYTE_4BITS,
CHANNEL_DATA_TYPE_UNSIGNED_BYTE_5BITS,
CHANNEL_DATA_TYPE_UNSIGNED_BYTE_6BITS,
CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS,
CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS,
CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS,
CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS,
CHANNEL_DATA_TYPE_FLOAT
};
// Structure holding uniform locations and object IDs.
// Those values are used to support non-color-renderable texture internalformat checks.
struct NonRenderableInternalformatSupportObjects
{
GLuint comparison_result_buffer_object_id;
GLuint dst_texture_pixels_buffer_object_id;
GLint dst_2D_texture_uniform_location;
GLint dst_Cube_texture_uniform_location;
GLuint fragment_shader_object_id;
GLuint program_object_id;
GLuint src_texture_pixels_buffer_object_id;
GLint src_2D_texture_uniform_location;
GLint src_2DArray_texture_uniform_location;
GLint src_3D_texture_uniform_location;
GLint src_Cube_texture_uniform_location;
GLuint transform_feedback_object_id;
GLuint vertex_shader_object_id;
GLint channels_to_compare_uniform_location;
GLint samplers_to_use_uniform_location;
GLuint src_texture_coordinates_buffer_object_id;
GLuint dst_texture_coordinates_buffer_object_id;
};
// Structure describing contents of a channel of a single pixel.
struct ChannelData
{
// Union that allows to access the data representation
// in a data_type-friendly manner
union {
signed char signed_byte_data;
signed int signed_integer_data;
signed short signed_short_data;
unsigned char unsigned_byte_data;
unsigned int unsigned_integer_data;
unsigned short unsigned_short_data;
float float_data;
};
// Data type used for channel representation
ChannelDataType data_type;
};
// Structure describing a single pixel.
struct PixelData
{
// Alpha channel data descriptor
ChannelData alpha;
// Blue channel data descriptor
ChannelData blue;
// Green channel data descriptor
ChannelData green;
// Red channel data descriptor
ChannelData red;
// For source pixels: GL internal-format used by all channels.
// For destination pixels: GL format to be used for gl.readPixels()
// operation in order to retrieve result data
// in a matching representation.
GLenum data_internalformat;
// For source pixels: GL type used by all channels.
// For destination pixels: GL type to be used for gl.readPixels()
// operation in order to retrieve result data
// in a matching representation.
GLenum data_type;
};
// To confirm contents of data stored in non-renderable internalformat, a special shader
// is used. This type definition tells which texture() function sampler should be used
// for sampling the texture data.
enum DataSamplerType
{
DATA_SAMPLER_FLOAT,
DATA_SAMPLER_INTEGER,
DATA_SAMPLER_UNSIGNED_INTEGER,
};
// When a special shader is used to check whether the copy succeeded we need to know which
// channels will have to be compared
enum PixelCompareChannel
{
PIXEL_COMPARE_CHANNEL_R = 0x1,
PIXEL_COMPARE_CHANNEL_G = 0x2,
PIXEL_COMPARE_CHANNEL_B = 0x4,
PIXEL_COMPARE_CHANNEL_A = 0x8,
PIXEL_COMPARE_CHANNEL_RG = PIXEL_COMPARE_CHANNEL_R | PIXEL_COMPARE_CHANNEL_G,
PIXEL_COMPARE_CHANNEL_RA = PIXEL_COMPARE_CHANNEL_R | PIXEL_COMPARE_CHANNEL_A,
PIXEL_COMPARE_CHANNEL_RGB = PIXEL_COMPARE_CHANNEL_RG | PIXEL_COMPARE_CHANNEL_B,
PIXEL_COMPARE_CHANNEL_RGBA = PIXEL_COMPARE_CHANNEL_RGB | PIXEL_COMPARE_CHANNEL_A,
};
// Structure describing a single conversion rule.
//
// For more details on meaning of these fields, please refer
// to doxygen of AddEntryToConversionDatabase() and similar.
struct ConversionDatabaseEntry
{
// Reference destination data expected for bottom-left corner
PixelData dst_bottomleft_corner;
// Reference destination data expected for bottom-right corner
PixelData dst_bottomright_corner;
// Reference destination data expected for top-left corner
PixelData dst_topleft_corner;
// Reference destination data expected for top-right corner
PixelData dst_topright_corner;
// Input bottom-left corner data to be used for conversion
PixelData src_bottomleft_corner;
// Input bottom-right corner data to be used for conversion
PixelData src_bottomright_corner;
// Input top-left corner data to be used for conversion
PixelData src_topleft_corner;
// Input top-right corner data to be used for conversion
PixelData src_topright_corner;
// What are the channels that we need to compare if gl.readPixels
// can't be used to read back the data
PixelCompareChannel channels_to_compare;
};
// Structure describing contents of an opaque conversion database handle.
class ConversionDatabase
{
public:
ConversionDatabase();
~ConversionDatabase();
void initializeDatabase();
bool isTypeSupportedByGLReadPixels(GLenum type);
bool isInternalFormatCompatibleWithType(GLenum type, GLenum internalformat);
bool convertNormalizedUnsignedFixedPoint(int* src_input_rgba_bits, int* src_attachment_rgba_bits,
int* dst_attachment_rgba_bits, int* dst_output_rgba_bits, int* src_rgba,
int* dst_rgba);
PixelData getAlpha8OESPixelData(GLenum type, unsigned char alpha);
PixelData getLuminance8OESPixelData(GLenum type, unsigned char luminance);
PixelData getLuminance8Alpha8OESPixelData(GLenum type, unsigned char luminance, unsigned char alpha);
PixelData getR16IPixelData(int is_source_pixel, GLenum type, int red);
PixelData getR16UIPixelData(int is_source_pixel, GLenum type, unsigned int red);
PixelData getR32IPixelData(int is_source_pixel, GLenum type, int red);
PixelData getR32UIPixelData(int is_source_pixel, GLenum type, unsigned int red);
PixelData getR8IPixelData(int is_source_pixel, GLenum type, int red);
PixelData getR8UIPixelData(int is_source_pixel, GLenum type, unsigned int red);
PixelData getR8PixelData(int is_source_pixel, GLenum type, unsigned char red);
PixelData getRG16IPixelData(int is_source_pixel, GLenum type, int red, int green);
PixelData getRG16UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green);
PixelData getRG32IPixelData(int is_source_pixel, GLenum type, int red, int green);
PixelData getRG32UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green);
PixelData getRG8IPixelData(int is_source_pixel, GLenum type, int red, int green);
PixelData getRG8UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green);
PixelData getRG8PixelData(int is_source_pixel, GLenum type, unsigned char red, unsigned char green);
PixelData getRGB10A2PixelData(GLenum type, unsigned short red, unsigned short green, unsigned short blue,
unsigned char alpha);
PixelData getRGB10A2UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green,
unsigned int blue, unsigned int alpha);
PixelData getRGB16IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue);
PixelData getRGB16UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green,
unsigned int blue);
PixelData getRGB32IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue);
PixelData getRGB32UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green,
unsigned int blue);
PixelData getRGB5A1PixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green,
unsigned int blue, unsigned int alpha);
PixelData getRGB565PixelData(int is_source_pixel, GLenum type, int red, int green, int blue);
PixelData getRGB8PixelData(int is_source_pixel, GLenum type, unsigned char red, unsigned char green,
unsigned char blue);
PixelData getRGB8IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue);
PixelData getRGB8UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green,
unsigned int blue);
PixelData getRGBA16IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue, int alpha);
PixelData getRGBA16UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green,
unsigned int blue, unsigned int alpha);
PixelData getRGBA32IPixelData(GLenum type, int red, int green, int blue, int alpha);
PixelData getRGBA32UIPixelData(GLenum type, unsigned int red, unsigned int green, unsigned int blue,
unsigned int alpha);
PixelData getRGBA8IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue, int alpha);
PixelData getRGBA8UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green,
unsigned int blue, unsigned int alpha);
PixelData getRGBA4PixelData(int is_source_pixel, GLenum type, unsigned char red, unsigned char green,
unsigned char blue, unsigned char alpha);
PixelData getRGBA8PixelData(GLenum type, unsigned char red, unsigned char green, unsigned char blue,
unsigned char alpha);
PixelData getSRGB8Alpha8PixelData(GLenum type, unsigned char red, unsigned char green, unsigned char blue,
unsigned char alpha);
PixelData getSRGB8PixelData(int is_source_pixel, GLenum type, unsigned char red, unsigned char green,
unsigned char blue);
PixelData getR16FPixelData(int is_source_pixel, GLenum type, float red);
PixelData getR32FPixelData(int is_source_pixel, GLenum type, float red);
PixelData getRG16FPixelData(int is_source_pixel, GLenum type, float red, float green);
PixelData getRG32FPixelData(int is_source_pixel, GLenum type, float red, float green);
PixelData getRGB16FPixelData(int is_source_pixel, GLenum type, float red, float green, float blue);
PixelData getRGB32FPixelData(int is_source_pixel, GLenum type, float red, float green, float blue);
PixelData getRGBA16FPixelData(GLenum type, float red, float green, float blue, float alpha);
PixelData getRGBA32FPixelData(GLenum type, float red, float green, float blue, float alpha);
protected:
void addEntryToConversionDatabase(PixelData src_topleft, PixelData dst_topleft, PixelData src_topright,
PixelData dst_topright, PixelData src_bottomleft, PixelData dst_bottomleft,
PixelData src_bottomright, PixelData dst_bottomright,
PixelCompareChannel channels_to_compare);
void configureConversionDatabase();
public:
// An array of _conversion_database_entry instances,
// storing all known conversion rules.
std::vector<ConversionDatabaseEntry> entries;
// Amount of entries allocated in the "entries" array so far.
unsigned int n_entries_allocated;
// Amount of entries added to the "entries" array so far.
unsigned int n_entries_added;
};
ConversionDatabase::ConversionDatabase() : n_entries_allocated(0), n_entries_added(0)
{
}
ConversionDatabase::~ConversionDatabase()
{
}
/** Initializes database instance. The database will be filled by the
* function with all available conversion rules, so it is a mistake to call
* ConfigureConversionDatabase() function for a handle reported by this function.
*
* The handle should be released with ReleaseConversionDatabase() when no longer
* needed.
*
* @return Handle to the newly created conversion database.
**/
void ConversionDatabase::initializeDatabase()
{
// Return when database was initialized earlier.
if (!entries.empty())
return;
entries.resize(N_START_CONVERSION_DATABASE_ENTRIES);
n_entries_allocated = N_START_CONVERSION_DATABASE_ENTRIES;
n_entries_added = 0;
if (entries.empty())
TCU_FAIL("Out of memory while pre-allocating space for conversion database entries");
deMemset(&entries[0], DE_NULL, N_START_CONVERSION_DATABASE_ENTRIES * sizeof(ConversionDatabaseEntry));
// Add all predefined entries that the test implementation is aware of
configureConversionDatabase();
}
/** Tells whether @param type can be used for a gl.readPixels() call.
*
* @param type GL type to consider.
*
* @return true if the type should be accepted by a gl.readPixels() call,
* false otherwise.
*/
bool ConversionDatabase::isTypeSupportedByGLReadPixels(GLenum type)
{
return (type == GL_INT) || (type == GL_UNSIGNED_BYTE) || (type == GL_UNSIGNED_INT) || (type == GL_FLOAT) ||
(type == GL_HALF_FLOAT) || (type == GL_UNSIGNED_INT_2_10_10_10_REV);
}
/** Tells whether @param type can be used with @param internalformat internal format.
*
* @param type GLES type to consider.
* @param internalformat GLES internal format to consider.
*
* @return true if the type is compatible with specific internal format, false otherwise.
**/
bool ConversionDatabase::isInternalFormatCompatibleWithType(GLenum type, GLenum internalformat)
{
bool result = false;
switch (type)
{
case GL_INT:
{
result = (internalformat == GL_R8I) || (internalformat == GL_R16I) || (internalformat == GL_R32I) ||
(internalformat == GL_RG8I) || (internalformat == GL_RG16I) || (internalformat == GL_RG32I) ||
(internalformat == GL_RGB8I) || (internalformat == GL_RGB16I) || (internalformat == GL_RGB32I) ||
(internalformat == GL_RGBA8I) || (internalformat == GL_RGBA16I) || (internalformat == GL_RGBA32I);
break;
}
case GL_UNSIGNED_BYTE:
{
result = (internalformat == GL_RGB) || (internalformat == GL_RGBA) || (internalformat == GL_LUMINANCE_ALPHA) ||
(internalformat == GL_LUMINANCE) || (internalformat == GL_LUMINANCE8_OES) ||
(internalformat == GL_LUMINANCE8_ALPHA8_OES) || (internalformat == GL_ALPHA) ||
(internalformat == GL_ALPHA8_OES) || (internalformat == GL_R8) || (internalformat == GL_R8_SNORM) ||
(internalformat == GL_RG8) || (internalformat == GL_RG8_SNORM) || (internalformat == GL_RGB8) ||
(internalformat == GL_SRGB8) || (internalformat == GL_RGB565) || (internalformat == GL_RGB8_SNORM) ||
(internalformat == GL_RGBA8) || (internalformat == GL_SRGB8_ALPHA8) ||
(internalformat == GL_RGBA8_SNORM) || (internalformat == GL_RGB5_A1) || (internalformat == GL_RGBA4);
break;
}
case GL_UNSIGNED_INT:
{
result = (internalformat == GL_R8UI) || (internalformat == GL_R16UI) || (internalformat == GL_R32UI) ||
(internalformat == GL_RG8UI) || (internalformat == GL_RG16UI) || (internalformat == GL_RG32UI) ||
(internalformat == GL_RGB8UI) || (internalformat == GL_RGB10_A2UI) || (internalformat == GL_RGB16UI) ||
(internalformat == GL_RGB32UI) || (internalformat == GL_RGBA8UI) || (internalformat == GL_RGBA16UI) ||
(internalformat == GL_RGBA32UI);
break;
}
case GL_UNSIGNED_INT_2_10_10_10_REV:
{
result = (internalformat == GL_RGB10_A2) || (internalformat == GL_RGB10_A2UI);
break;
}
case GL_FLOAT:
{
result = (internalformat == GL_RGB) || (internalformat == GL_RGBA) || (internalformat == GL_R32F) ||
(internalformat == GL_RG32F) || (internalformat == GL_RGB32F) || (internalformat == GL_RGBA32F);
break;
}
case GL_HALF_FLOAT:
{
result = (internalformat == GL_RGB) || (internalformat == GL_RGBA) || (internalformat == GL_R16F) ||
(internalformat == GL_RG16F) || (internalformat == GL_RGB16F) || (internalformat == GL_RGBA16F);
break;
}
default:
{
TCU_FAIL("Unsupported type");
}
}
return result;
}
/** Converts normalized unsigned fixed-point RGBA pixel representations
* from one resolution to another, simulating the result that one would
* get if glCopyTexImage2D() call was used for a single pixel, read
* afterward with a gl.readPixels() call.
*
* @param src_input_rgba_bits Pointer to an array storing 4 integers, representing
* amount of bits per channel, as used by input data,
* that will be fed to a GL object using gl.texImage2D()
* call or similar. Cannot be NULL.
* @param src_attachment_rgba_bits Pointer to an array storing 4 integers, representing
* amount of bits per channel, as used by data storage
* of an object attached to read buffer. Cannot be NULL.
* @param dst_attachment_rgba_bits Pointer to an array storing 4 integers, representing
* amount of bits per channel, as used by data storage
* of a texture object that glCopyTexImage2D() call will
* initialize. Cannot be NULL.
* @param dst_output_rgba_bits Pointer to an array storing 4 integers, representing
* amount of bits per channel, as requested by the user
* using the gl.readPixels() call. Cannot be NULL.
* @param src_rgba Pointer to an array storing 4 values representing
* RGBA channel. It is assumed the values do not exceed
* allowed precision, described by @param src_input_rgba_bits.
* Cannot be NULL.
* @param dst_rgba Deref will be used to store result of the conversion.
* Cannot be NULL.
*
* @return 1 if successful, 0 otherwise.
* */
bool ConversionDatabase::convertNormalizedUnsignedFixedPoint(int* src_input_rgba_bits, int* src_attachment_rgba_bits,
int* dst_attachment_rgba_bits, int* dst_output_rgba_bits,
int* src_rgba, int* dst_rgba)
{
float a_f32 = 0.0f;
float b_f32 = 0.0f;
float dst_rgba_f[4] = { 0.0f };
float g_f32 = 0.0f;
float r_f32 = 0.0f;
int src_rgba_intermediate[4] = { src_rgba[0], src_rgba[1], src_rgba[2], src_rgba[3] };
// Reduce or crank up precision before casting to floats
int bit_diffs_src_intermediate[] = { abs(src_input_rgba_bits[0] - src_attachment_rgba_bits[0]),
abs(src_input_rgba_bits[1] - src_attachment_rgba_bits[1]),
abs(src_input_rgba_bits[2] - src_attachment_rgba_bits[2]),
abs(src_input_rgba_bits[3] - src_attachment_rgba_bits[3]) };
for (unsigned int n = 0; n < sizeof(bit_diffs_src_intermediate) / sizeof(bit_diffs_src_intermediate[0]); ++n)
{
float tmp = ((float)src_rgba_intermediate[n]) / ((1 << src_input_rgba_bits[n]) - 1);
if (tmp > 1.0f)
tmp = 1.0f;
tmp *= (float)((1 << src_attachment_rgba_bits[n]) - 1);
src_rgba_intermediate[n] = (int)(0.5 + tmp);
}
// The following equations correspond to equation 2.1 from ES spec 3.0.2
r_f32 = ((float)src_rgba_intermediate[0]) / (float)((1 << src_attachment_rgba_bits[0]) - 1);
g_f32 = ((float)src_rgba_intermediate[1]) / (float)((1 << src_attachment_rgba_bits[1]) - 1);
b_f32 = ((float)src_rgba_intermediate[2]) / (float)((1 << src_attachment_rgba_bits[2]) - 1);
a_f32 = ((float)src_rgba_intermediate[3]) / (float)((1 << src_attachment_rgba_bits[3]) - 1);
// Clamp to <0, 1>. Since we're dealing with unsigned ints on input, there's
// no way we could be lower than 0.
if (r_f32 > 1.0f)
r_f32 = 1.0f;
if (g_f32 > 1.0f)
g_f32 = 1.0f;
if (b_f32 > 1.0f)
b_f32 = 1.0f;
if (a_f32 > 1.0f)
a_f32 = 1.0f;
// The following equations are taken from table 4.5 & equation 2.3,
// ES spec 3.0.2
dst_rgba_f[0] = (r_f32 * (float)((1 << dst_attachment_rgba_bits[0]) - 1));
dst_rgba_f[1] = (g_f32 * (float)((1 << dst_attachment_rgba_bits[1]) - 1));
dst_rgba_f[2] = (b_f32 * (float)((1 << dst_attachment_rgba_bits[2]) - 1));
dst_rgba_f[3] = (a_f32 * (float)((1 << dst_attachment_rgba_bits[3]) - 1));
// As per spec:
//
// The conversion from a floating-point value f to the corresponding
// unsigned normalized fixed-point value c is defined by first clamping
// f to the range [0,1], then computing
//
// f' = convert_float_uint(f * (2^b-1), b) [2.3]
//
// where convert_float_uint(r,b) returns one of the two unsigned binary
// integer values with exactly b bits which are closest to the floating-point
// value r (where *rounding to nearest is preferred*)
//
// C casting truncates the remainder, so if dst_rgba_f[x] is larger than or
// equal to 0.5, we need to take a ceiling of the value.
for (unsigned int n = 0; n < 4 /* channels */; ++n)
{
if (deFloatMod(dst_rgba_f[n], 1.0f) >= 0.5f)
dst_rgba_f[n] = deFloatCeil(dst_rgba_f[n]);
}
// Expand the data or reduce its precision, depending on the type requested by the caller.
dst_rgba[0] = ((unsigned int)dst_rgba_f[0]);
dst_rgba[1] = ((unsigned int)dst_rgba_f[1]);
dst_rgba[2] = ((unsigned int)dst_rgba_f[2]);
dst_rgba[3] = ((unsigned int)dst_rgba_f[3]);
for (unsigned int n = 0; n < 4 /* channels */; ++n)
{
float tmp = ((float)dst_rgba[n]) / ((1 << dst_attachment_rgba_bits[n]) - 1);
if (tmp > 1.0f)
tmp = 1.0f;
tmp *= (float)((1 << dst_output_rgba_bits[n]) - 1);
dst_rgba[n] = (int)(0.5 + tmp);
}
return true;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_ALPHA8 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_BYTE.
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getAlpha8OESPixelData(GLenum type, unsigned char alpha)
{
PixelData result;
// Sanity checks
DE_ASSERT(type == GL_UNSIGNED_BYTE);
// Carry on
deMemset(&result, 0, sizeof(result));
result.alpha.unsigned_byte_data = alpha;
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.data_type = CHANNEL_DATA_TYPE_NONE;
result.red.data_type = CHANNEL_DATA_TYPE_NONE;
result.data_internalformat = GL_ALPHA8_OES;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_LUMINANCE8 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_BYTE.
* @param luminance Luminance value. Will get cloned to blue/green/red channels.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getLuminance8OESPixelData(GLenum type, unsigned char luminance)
{
PixelData result;
/* Sanity checks */
DE_ASSERT(type == GL_UNSIGNED_BYTE);
/* Carry on */
deMemset(&result, 0, sizeof(result));
result.alpha.unsigned_byte_data = 255;
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.unsigned_byte_data = luminance;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.green.unsigned_byte_data = luminance;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = luminance;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.data_internalformat = GL_LUMINANCE8_OES;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_LUMINANCE8_ALPHA8 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_BYTE.
* @param luminance Luminance value. Will be cloned to blue/green/red channels.
* @param alpha Alpha channel value.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getLuminance8Alpha8OESPixelData(GLenum type, unsigned char luminance, unsigned char alpha)
{
PixelData result;
/* Sanity checks */
DE_ASSERT(type == GL_UNSIGNED_BYTE);
/* Carry on */
deMemset(&result, 0, sizeof(result));
result.alpha.unsigned_byte_data = alpha;
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.unsigned_byte_data = luminance;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.green.unsigned_byte_data = luminance;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = luminance;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.data_internalformat = GL_LUMINANCE8_ALPHA8_OES;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_R16I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_SHORT for source pixels.
* 2) GL_INT for destination pixels.
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getR16IPixelData(int is_source_pixel, GLenum type, int red)
{
PixelData result;
/* Sanity checks */
if (is_source_pixel)
{
DE_ASSERT(type == GL_SHORT);
} /* if (is_source_pixel) */
else
{
DE_ASSERT(type == GL_INT);
}
/* Carry on */
deMemset(&result, 0, sizeof(result));
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.data_type = CHANNEL_DATA_TYPE_NONE;
if (is_source_pixel)
{
result.red.signed_short_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
} /* if (is_source_pixel) */
else
{
result.alpha.signed_integer_data = 1;
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
}
result.data_internalformat = GL_R16I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_R16UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_SHORT for source pixels.
* 2) GL_UNSIGNED_INT for destination pixels.
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getR16UIPixelData(int is_source_pixel, GLenum type, unsigned int red)
{
PixelData result;
/* Sanity checks */
if (is_source_pixel)
{
DE_ASSERT(type == GL_UNSIGNED_SHORT);
} /* if (is_source_pixels) */
else
{
DE_ASSERT(type == GL_UNSIGNED_INT);
}
deMemset(&result, 0, sizeof(result));
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.data_type = CHANNEL_DATA_TYPE_NONE;
if (is_source_pixel)
{
result.red.unsigned_short_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
} /* if (is_source_pixel) */
else
{
result.alpha.unsigned_integer_data = 1;
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
}
result.data_internalformat = GL_R16UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_R32I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_INT.
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getR32IPixelData(int is_source_pixel, GLenum type, int red)
{
PixelData result;
DE_ASSERT(type == GL_INT);
deMemset(&result, 0, sizeof(result));
if (!is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = 1;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
}
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.data_type = CHANNEL_DATA_TYPE_NONE;
result.red.signed_integer_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.data_internalformat = GL_R32I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_R32UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_INT.
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getR32UIPixelData(int is_source_pixel, GLenum type, unsigned int red)
{
PixelData result;
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
if (!is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = 1;
} /* if (!is_source_pixel) */
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
}
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.data_type = CHANNEL_DATA_TYPE_NONE;
result.red.unsigned_integer_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.data_internalformat = GL_R32UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_R8I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_BYTE for source pixels.
* 2) GL_INT for destination pixels.
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getR8IPixelData(int is_source_pixel, GLenum type, int red)
{
PixelData result;
// Sanity checks
if (is_source_pixel)
DE_ASSERT(type == GL_BYTE);
else
DE_ASSERT(type == GL_INT);
// Carry on
deMemset(&result, 0, sizeof(result));
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.data_type = CHANNEL_DATA_TYPE_NONE;
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.red.signed_byte_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = 1;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
}
result.data_internalformat = GL_R8I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_R8UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_BYTE for source pixels.
* 2) GL_UNSIGNED_INT for destination pixels.
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getR8UIPixelData(int is_source_pixel, GLenum type, unsigned int red)
{
PixelData result;
/* Sanity checks */
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_BYTE);
else
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.data_type = CHANNEL_DATA_TYPE_NONE;
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.red.unsigned_byte_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = 1;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
}
result.data_internalformat = GL_R8UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_R8 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must beGL_UNSIGNED_BYTE.
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getR8PixelData(int is_source_pixel, GLenum type, unsigned char red)
{
PixelData result;
DE_ASSERT(type == GL_UNSIGNED_BYTE);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.alpha.unsigned_byte_data = 255;
}
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.data_type = CHANNEL_DATA_TYPE_NONE;
result.red.unsigned_byte_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.data_internalformat = GL_R8;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RG16I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_SHORT for source pixels.
* 2) GL_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRG16IPixelData(int is_source_pixel, GLenum type, int red, int green)
{
PixelData result;
if (is_source_pixel)
{
DE_ASSERT(type == GL_SHORT);
}
else
{
DE_ASSERT(type == GL_INT);
}
deMemset(&result, 0, sizeof(result));
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.signed_short_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
result.red.signed_short_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = 1;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.green.signed_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
}
result.data_internalformat = GL_RG16I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RG16UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_SHORT for source pixels.
* 2) GL_UNSIGNED_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRG16UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_SHORT);
else
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.signed_short_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
result.red.signed_short_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = 1;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.green.unsigned_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
}
result.data_internalformat = GL_RG16UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RG32I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_INT.
* @param red Value for red channel.
* @param green Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRG32IPixelData(int is_source_pixel, GLenum type, int red, int green)
{
PixelData result;
DE_ASSERT(type == GL_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = 1;
}
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.signed_integer_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.data_internalformat = GL_RG32I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RG32UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_INT.
* @param red Value for red channel.
* @param green Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRG32UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green)
{
PixelData result;
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = 1;
}
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.unsigned_integer_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.data_internalformat = GL_RG32UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RG8I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_BYTE for source pixels.
* 2) GL_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRG8IPixelData(int is_source_pixel, GLenum type, int red, int green)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_BYTE);
else
DE_ASSERT(type == GL_INT);
deMemset(&result, 0, sizeof(result));
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.signed_byte_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
result.red.signed_byte_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
} /* if (is_source_pixel) */
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = 1;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.green.signed_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
}
result.data_internalformat = GL_RG8I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB8UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_BYTE for source pixels.
* 2) GL_UNSIGNED_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRG8UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_BYTE);
else
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.unsigned_byte_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = 1;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.green.unsigned_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
}
result.data_internalformat = GL_RG8UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RG8 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_BYTE.
* @param red Value for red channel.
* @param green Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRG8PixelData(int is_source_pixel, GLenum type, unsigned char red, unsigned char green)
{
PixelData result;
DE_ASSERT(type == GL_UNSIGNED_BYTE);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.alpha.unsigned_byte_data = 255;
}
result.blue.data_type = CHANNEL_DATA_TYPE_NONE;
result.green.unsigned_byte_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.data_internalformat = GL_RG8;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB10_A2 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_INT_2_10_10_10_REV.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB10A2PixelData(GLenum type, unsigned short red, unsigned short green,
unsigned short blue, unsigned char alpha)
{
PixelData result;
DE_ASSERT(red <= 1023);
DE_ASSERT(green <= 1023);
DE_ASSERT(blue <= 1023);
DE_ASSERT(alpha <= 3);
DE_ASSERT(type == GL_UNSIGNED_INT_2_10_10_10_REV);
deMemset(&result, 0, sizeof(result));
result.alpha.unsigned_byte_data = alpha;
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_2BITS;
result.blue.unsigned_short_data = blue;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
result.green.unsigned_short_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
result.red.unsigned_short_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
result.data_internalformat = GL_RGB10_A2;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB10A2UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_INT_2_10_10_10_REV for source pixels.
* 2) GL_UNSIGNED_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB10A2UIPixelData(int is_source_pixel, GLenum type, unsigned int red,
unsigned int green, unsigned int blue, unsigned int alpha)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_INT_2_10_10_10_REV);
else
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.unsigned_byte_data = alpha;
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_2BITS;
result.blue.unsigned_short_data = blue;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
result.green.unsigned_short_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
result.red.unsigned_short_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
}
else
{
result.alpha.unsigned_integer_data = alpha;
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.blue.unsigned_integer_data = blue;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.green.unsigned_integer_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
}
result.data_internalformat = GL_RGB10_A2UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB16I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_SHORT for source pixels.
* 2) GL_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB16IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_SHORT);
else
DE_ASSERT(type == GL_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
result.blue.signed_short_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
result.green.signed_short_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
result.red.signed_short_data = red;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = 1;
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.blue.signed_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.green.signed_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
}
result.data_internalformat = GL_RGB16I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB16UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_SHORT for source pixels.
* 2) GL_UNSIGNED_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB16UIPixelData(int is_source_pixel, GLenum type, unsigned int red,
unsigned int green, unsigned int blue)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_SHORT);
else
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
result.blue.unsigned_short_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
result.green.unsigned_short_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
result.red.unsigned_short_data = red;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.alpha.unsigned_integer_data = 1;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.blue.unsigned_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.green.unsigned_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
}
result.data_internalformat = GL_RGB16UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB32I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_INT.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB32IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue)
{
PixelData result;
DE_ASSERT(type == GL_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = 1;
}
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.blue.signed_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.green.signed_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
result.data_internalformat = GL_RGB32I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB32UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_INT.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB32UIPixelData(int is_source_pixel, GLenum type, unsigned int red,
unsigned int green, unsigned int blue)
{
PixelData result;
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = 1;
}
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.blue.unsigned_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.green.unsigned_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
result.data_internalformat = GL_RGB32UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB5A1 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT_5_5_5_1 or
* GL_UNSIGNED_INT_2_10_10_10_REV for source pixels.
* 2) GL_UNSIGNED_BYTE for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB5A1PixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green,
unsigned int blue, unsigned int alpha)
{
PixelData result;
if (is_source_pixel)
{
DE_ASSERT(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_SHORT_5_5_5_1 ||
type == GL_UNSIGNED_INT_2_10_10_10_REV);
}
else
{
DE_ASSERT(type == GL_UNSIGNED_BYTE);
}
deMemset(&result, 0, sizeof(result));
switch (type)
{
case GL_UNSIGNED_BYTE:
{
DE_ASSERT(red <= 255);
DE_ASSERT(green <= 255);
DE_ASSERT(blue <= 255);
DE_ASSERT(alpha <= 255);
// Fill the channel data structures
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.alpha.unsigned_byte_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = red;
break;
}
case GL_UNSIGNED_SHORT_5_5_5_1:
{
DE_ASSERT(red <= 31);
DE_ASSERT(green <= 31);
DE_ASSERT(blue <= 31);
DE_ASSERT(alpha == 0 || alpha == 1);
// Fill the channel data structures
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_1BIT;
result.alpha.unsigned_byte_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_5BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_5BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_5BITS;
result.red.unsigned_byte_data = red;
break;
}
case GL_UNSIGNED_INT_2_10_10_10_REV:
{
// Sanity checks
DE_ASSERT(red <= 1023);
DE_ASSERT(green <= 1023);
DE_ASSERT(blue <= 1023);
DE_ASSERT(alpha <= 3);
// Fill the channel data structures
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_2BITS;
result.alpha.unsigned_byte_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
result.blue.unsigned_short_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
result.green.unsigned_short_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
result.red.unsigned_short_data = red;
break;
}
}
result.data_internalformat = GL_RGB5_A1;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB565 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT_5_6_5 for source pixels.
* 2) GL_UNSIGNED_BYTE for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB565PixelData(int is_source_pixel, GLenum type, int red, int green, int blue)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_SHORT_5_6_5);
else
DE_ASSERT(type == GL_UNSIGNED_BYTE);
deMemset(&result, 0, sizeof(result));
switch (type)
{
case GL_UNSIGNED_BYTE:
{
// Fill the channel data structures
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = red;
break;
}
case GL_UNSIGNED_SHORT_5_6_5:
{
DE_ASSERT(red >= 0 && red <= 31);
DE_ASSERT(green >= 0 && green <= 63);
DE_ASSERT(blue >= 0 && blue <= 31);
// Fill the channel data structures
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_5BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_6BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_5BITS;
result.red.unsigned_byte_data = red;
break;
}
}
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.alpha.unsigned_byte_data = 255;
}
result.data_internalformat = GL_RGB565;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB8 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_BYTE.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB8PixelData(int is_source_pixel, GLenum type, unsigned char red, unsigned char green,
unsigned char blue)
{
PixelData result;
DE_ASSERT(type == GL_UNSIGNED_BYTE);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.alpha.unsigned_byte_data = 255;
}
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = red;
result.data_internalformat = GL_RGB8;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB8I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_BYTE for source pixels.
* 2) GL_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB8IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_BYTE);
else
DE_ASSERT(type == GL_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
result.blue.signed_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
result.green.signed_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
result.red.signed_byte_data = red;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = 1;
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.blue.signed_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.green.signed_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
}
result.data_internalformat = GL_RGB8I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB8UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_BYTE for source pixels.
* 2) GL_UNSIGNED_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB8UIPixelData(int is_source_pixel, GLenum type, unsigned int red, unsigned int green,
unsigned int blue)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_BYTE);
else
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = red;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = 1;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.blue.unsigned_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.green.unsigned_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
}
result.data_internalformat = GL_RGB8UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA16I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_SHORT for source pixels.
* 2) GL_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA16IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue,
int alpha)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_SHORT);
else
DE_ASSERT(type == GL_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
result.alpha.signed_short_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
result.blue.signed_short_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
result.green.signed_short_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS;
result.red.signed_short_data = red;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.blue.signed_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.green.signed_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
}
result.data_internalformat = GL_RGBA16I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA16UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_SHORT for source pixels.
* 2) GL_UNSIGNED_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA16UIPixelData(int is_source_pixel, GLenum type, unsigned int red,
unsigned int green, unsigned int blue, unsigned int alpha)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_SHORT);
else
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
result.alpha.unsigned_short_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
result.blue.unsigned_short_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
result.green.unsigned_short_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS;
result.red.unsigned_short_data = red;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.blue.unsigned_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.green.unsigned_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
}
result.data_internalformat = GL_RGBA16UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA32I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_INT.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA32IPixelData(GLenum type, int red, int green, int blue, int alpha)
{
PixelData result;
DE_ASSERT(type == GL_INT);
deMemset(&result, 0, sizeof(result));
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.blue.signed_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.green.signed_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
result.data_internalformat = GL_RGBA32I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA32UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_INT.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA32UIPixelData(GLenum type, unsigned int red, unsigned int green, unsigned int blue,
unsigned int alpha)
{
PixelData result;
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.blue.unsigned_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.green.unsigned_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
result.data_internalformat = GL_RGBA32UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA8I internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_BYTE for source pixels.
* 2) GL_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA8IPixelData(int is_source_pixel, GLenum type, int red, int green, int blue,
int alpha)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_BYTE);
else
DE_ASSERT(type == GL_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
result.alpha.signed_byte_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
result.blue.signed_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
result.green.signed_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS;
result.red.signed_byte_data = red;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.alpha.signed_integer_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.blue.signed_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.green.signed_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
result.red.signed_integer_data = red;
}
result.data_internalformat = GL_RGBA8I;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA8UI internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_BYTE for source pixels.
* 2) GL_UNSIGNED_INT for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA8UIPixelData(int is_source_pixel, GLenum type, unsigned int red,
unsigned int green, unsigned int blue, unsigned int alpha)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_BYTE);
else
DE_ASSERT(type == GL_UNSIGNED_INT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.alpha.unsigned_byte_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = red;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.alpha.unsigned_integer_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.blue.unsigned_integer_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.green.unsigned_integer_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
result.red.unsigned_integer_data = red;
}
result.data_internalformat = GL_RGBA8UI;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA4 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be:
* 1) GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT_4_4_4_4 for source pixels.
* 2) GL_UNSIGNED_BYTE for destination pixels.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA4PixelData(int is_source_pixel, GLenum type, unsigned char red,
unsigned char green, unsigned char blue, unsigned char alpha)
{
PixelData result;
if (is_source_pixel)
DE_ASSERT(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_SHORT_4_4_4_4);
else
DE_ASSERT(type == GL_UNSIGNED_BYTE);
deMemset(&result, 0, sizeof(result));
switch (type)
{
case GL_UNSIGNED_BYTE:
{
// Fill the channel data structures
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.alpha.unsigned_byte_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = red;
break;
}
case GL_UNSIGNED_SHORT_4_4_4_4:
{
DE_ASSERT(red <= 15);
DE_ASSERT(green <= 15);
DE_ASSERT(blue <= 15);
DE_ASSERT(alpha <= 15);
// Fill the channel data structures
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_4BITS;
result.alpha.unsigned_byte_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_4BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_4BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_4BITS;
result.red.unsigned_byte_data = red;
break;
}
}
result.data_internalformat = GL_RGBA4;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA8 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_BYTE.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA8PixelData(GLenum type, unsigned char red, unsigned char green, unsigned char blue,
unsigned char alpha)
{
PixelData result;
DE_ASSERT(type == GL_UNSIGNED_BYTE);
deMemset(&result, 0, sizeof(result));
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.alpha.unsigned_byte_data = alpha;
result.blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.blue.unsigned_byte_data = blue;
result.green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.green.unsigned_byte_data = green;
result.red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.red.unsigned_byte_data = red;
result.data_internalformat = GL_RGBA8;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_SRGB8_ALPHA8 internal format.
*
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_BYTE.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getSRGB8Alpha8PixelData(GLenum type, unsigned char red, unsigned char green,
unsigned char blue, unsigned char alpha)
{
PixelData result = getRGBA8PixelData(type, red, green, blue, alpha);
result.data_internalformat = GL_SRGB8_ALPHA8;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_SRGB8 internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_UNSIGNED_BYTE.
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getSRGB8PixelData(int is_source_pixel, GLenum type, unsigned char red,
unsigned char green, unsigned char blue)
{
PixelData result = getSRGB8Alpha8PixelData(type, red, green, blue, 0);
if (is_source_pixel)
{
result.alpha.data_type = CHANNEL_DATA_TYPE_NONE;
result.alpha.unsigned_byte_data = 0;
}
else
{
result.alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
result.alpha.unsigned_byte_data = 255;
}
result.data_internalformat = GL_SRGB8;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_R16F internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_HALF_FLOAT
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getR16FPixelData(int is_source_pixel, GLenum type, float red)
{
PixelData result;
DE_ASSERT(type == GL_HALF_FLOAT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
else
{
result.alpha.float_data = 1;
result.alpha.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
result.data_internalformat = GL_R16F;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_R32F internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_FLOAT
* @param red Value for red channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getR32FPixelData(int is_source_pixel, GLenum type, float red)
{
PixelData result;
DE_ASSERT(type == GL_FLOAT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
else
{
result.alpha.float_data = 1;
result.alpha.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
result.data_internalformat = GL_R32F;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RG16F internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_HALF_FLOAT
* @param red Value for red channel.
* @param green Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRG16FPixelData(int is_source_pixel, GLenum type, float red, float green)
{
PixelData result;
DE_ASSERT(type == GL_HALF_FLOAT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
else
{
result.alpha.float_data = 1;
result.alpha.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
result.data_internalformat = GL_RG16F;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RG32F internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_FLOAT
* @param red Value for red channel.
* @param green Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRG32FPixelData(int is_source_pixel, GLenum type, float red, float green)
{
PixelData result;
DE_ASSERT(type == GL_FLOAT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
else
{
result.alpha.float_data = 1;
result.alpha.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
result.data_internalformat = GL_RG32F;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB16F internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_HALF_FLOAT
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for green channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB16FPixelData(int is_source_pixel, GLenum type, float red, float green, float blue)
{
PixelData result;
DE_ASSERT(type == GL_HALF_FLOAT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.blue.float_data = blue;
result.blue.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
else
{
result.alpha.float_data = 1;
result.alpha.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.blue.float_data = blue;
result.blue.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
result.data_internalformat = GL_RGB16F;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGB32F internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_FLOAT
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGB32FPixelData(int is_source_pixel, GLenum type, float red, float green, float blue)
{
PixelData result;
DE_ASSERT(type == GL_FLOAT);
deMemset(&result, 0, sizeof(result));
if (is_source_pixel)
{
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.blue.float_data = blue;
result.blue.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
else
{
result.alpha.float_data = 1;
result.alpha.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.blue.float_data = blue;
result.blue.data_type = CHANNEL_DATA_TYPE_FLOAT;
}
result.data_internalformat = GL_RGB32F;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA16F internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_HALF_FLOAT
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA16FPixelData(GLenum type, float red, float green, float blue, float alpha)
{
PixelData result;
DE_ASSERT(type == GL_HALF_FLOAT);
deMemset(&result, 0, sizeof(result));
result.alpha.float_data = alpha;
result.alpha.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.blue.float_data = blue;
result.blue.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.data_internalformat = GL_RGBA16F;
result.data_type = type;
return result;
}
/** Retrieves a PixelData instance describing a single pixel stored in
* GL_RGBA32F internal format.
*
* @param is_source_pixel 1 if the pixel is going to be used as conversion source,
* 0 otherwise.
* @param type GLES type the pixel uses. Must be GL_FLOAT
* @param red Value for red channel.
* @param green Value for green channel.
* @param blue Value for blue channel.
* @param alpha Value for alpha channel.
*
* @return Filled PixelData instance.
**/
PixelData ConversionDatabase::getRGBA32FPixelData(GLenum type, float red, float green, float blue, float alpha)
{
PixelData result;
DE_ASSERT(type == GL_FLOAT);
deMemset(&result, 0, sizeof(result));
result.alpha.float_data = alpha;
result.alpha.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.red.float_data = red;
result.red.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.green.float_data = green;
result.green.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.blue.float_data = blue;
result.blue.data_type = CHANNEL_DATA_TYPE_FLOAT;
result.data_internalformat = GL_RGBA32F;
result.data_type = type;
return result;
}
/** Adds a new conversion rule to a conversion database.
*
* Destination pixel datasets can only use one of the following types:
*
* GL_UNSIGNED_BYTE (for fixed-point source types);
* GL_INT (for signed integer types);
* GL_UNSIGNED_INT (for unsigned integer types);
* GL_UNSIGNED_INT_2_10_10_10_REV (for GL_RGB10_A2 type ONLY)
*
* The type used for destination storage configures arguments that
* will be passed to a gl.readPixels() call in verification stage IF
* source internalformat is color-renderable. If not, destination type
* determines how result & reference data should be compared using
* a special program object.
*
* It is illegal to:
*
* 1) add more than one conversion rule that uses the same source+destination
* internalformat+type combination.
* 2) use source pixels of different internalformats or types;
* 3) use destination pixels of different internalformats or types;
* 4) use pixel data instances using invalid internalformat or types.
*
* @param src_topleft Pixel-data instance describing source top-left corner.
* @param dst_topleft Pixel-data instance describing destination top-left corner.
* @param src_topright Pixel-data instance describing source top-right corner.
* @param dst_topright Pixel-data instance describing destination top-right corner.
* @param src_bottomleft Pixel-data instance describing source bottom-left corner.
* @param dst_bottomleft Pixel-data instance describing destination bottom-left corner.
* @param src_bottomright Pixel-data instance describing source bottom-right corner.
* @param dst_bottomright Pixel-data instance describing destination bottom-right corner.
**/
void ConversionDatabase::addEntryToConversionDatabase(PixelData src_topleft, PixelData dst_topleft,
PixelData src_topright, PixelData dst_topright,
PixelData src_bottomleft, PixelData dst_bottomleft,
PixelData src_bottomright, PixelData dst_bottomright,
PixelCompareChannel channels_to_compare)
{
GLenum dst_internalformat = GL_NONE;
GLenum dst_type = GL_NONE;
int is_dst_internalformat_valid = 0;
int is_dst_type_valid = 0;
GLenum src_internalformat = GL_NONE;
GLenum src_type = GL_NONE;
// Sanity checks: general
DE_ASSERT(src_topleft.data_internalformat != GL_NONE);
DE_ASSERT(dst_topleft.data_internalformat != GL_NONE);
if (src_topleft.data_internalformat == GL_NONE || dst_topleft.data_internalformat == GL_NONE)
return; // if (source / destination internalformats are GL_NONE)
DE_ASSERT(src_topleft.data_internalformat == src_topright.data_internalformat);
DE_ASSERT(src_topleft.data_internalformat == src_bottomleft.data_internalformat);
DE_ASSERT(src_topleft.data_internalformat == src_bottomright.data_internalformat);
DE_ASSERT(src_topleft.data_type == src_topright.data_type);
DE_ASSERT(src_topleft.data_type == src_bottomleft.data_type);
DE_ASSERT(src_topleft.data_type == src_bottomright.data_type);
if (src_topleft.data_internalformat != src_topright.data_internalformat ||
src_topleft.data_internalformat != src_bottomleft.data_internalformat ||
src_topleft.data_internalformat != src_bottomright.data_internalformat ||
src_topleft.data_type != src_topright.data_type || src_topleft.data_type != src_bottomleft.data_type ||
src_topleft.data_type != src_bottomright.data_type)
{
return;
} // if (source pixels' internalformats and/or types are not the same values)
DE_ASSERT(dst_topleft.data_internalformat == dst_topright.data_internalformat);
DE_ASSERT(dst_topleft.data_internalformat == dst_bottomleft.data_internalformat);
DE_ASSERT(dst_topleft.data_internalformat == dst_bottomright.data_internalformat);
DE_ASSERT(dst_topleft.data_type == dst_topright.data_type);
DE_ASSERT(dst_topleft.data_type == dst_bottomleft.data_type);
DE_ASSERT(dst_topleft.data_type == dst_bottomright.data_type);
if (dst_topleft.data_internalformat != dst_topright.data_internalformat ||
dst_topleft.data_internalformat != dst_bottomleft.data_internalformat ||
dst_topleft.data_internalformat != dst_bottomright.data_internalformat ||
dst_topleft.data_type != dst_topright.data_type || dst_topleft.data_type != dst_bottomleft.data_type ||
dst_topleft.data_type != dst_bottomright.data_type)
{
return;
} // if (destination pixels' internalformats and/or types are not the same values)
src_internalformat = src_topleft.data_internalformat;
src_type = src_topleft.data_type;
dst_internalformat = dst_topleft.data_internalformat;
dst_type = dst_topleft.data_type;
// Sanity checks: format used for destination storage
is_dst_type_valid = isTypeSupportedByGLReadPixels(dst_type);
is_dst_internalformat_valid = isInternalFormatCompatibleWithType(dst_type, dst_internalformat);
DE_ASSERT(is_dst_type_valid && is_dst_internalformat_valid);
if (!is_dst_type_valid || !is_dst_internalformat_valid)
TCU_FAIL("Requested destination type or internalformat is not compatible with validation requirements.");
// Sanity checks: make sure the conversion has not been already added
for (unsigned int n = 0; n < n_entries_added; ++n)
{
ConversionDatabaseEntry& entry_ptr = entries[n];
GLenum iterated_dst_internalformat = entry_ptr.dst_topleft_corner.data_internalformat;
GLenum iterated_dst_type = entry_ptr.dst_topleft_corner.data_type;
GLenum iterated_src_internalformat = entry_ptr.src_topleft_corner.data_internalformat;
GLenum iterated_src_type = entry_ptr.src_topleft_corner.data_type;
int is_new_rule = src_internalformat != iterated_src_internalformat ||
((src_internalformat == iterated_src_internalformat) && (src_type != iterated_src_type)) ||
((src_internalformat == iterated_src_internalformat) && (src_type == iterated_src_type) &&
(dst_internalformat != iterated_dst_internalformat)) ||
((src_internalformat == iterated_src_internalformat) && (src_type == iterated_src_type) &&
(dst_internalformat == iterated_dst_internalformat) && (dst_type != iterated_dst_type));
DE_ASSERT(is_new_rule);
if (!is_new_rule)
TCU_FAIL("This conversion rule already exists!");
}
// Make sure there's enough space to hold a new entry
if ((n_entries_added + 1) >= n_entries_allocated)
{
// Realloc is needed
n_entries_allocated <<= 1;
entries.resize(n_entries_allocated);
if (entries.empty())
TCU_FAIL("Out of memory while reallocating conversion database");
}
// Add the new entry
ConversionDatabaseEntry& entry_ptr = entries[n_entries_added];
entry_ptr.dst_bottomleft_corner = dst_bottomleft;
entry_ptr.dst_bottomright_corner = dst_bottomright;
entry_ptr.dst_topleft_corner = dst_topleft;
entry_ptr.dst_topright_corner = dst_topright;
entry_ptr.src_bottomleft_corner = src_bottomleft;
entry_ptr.src_bottomright_corner = src_bottomright;
entry_ptr.src_topleft_corner = src_topleft;
entry_ptr.src_topright_corner = src_topright;
entry_ptr.channels_to_compare = channels_to_compare;
++n_entries_added;
}
/** Adds all known conversion rules to a conversion database passed by argument.
*
* A conversion database stores exactly one conversion rule for each valid combination
* of source+destination internal-formats (with an exception that for each internalformat
* data may be represented with many different types!).
* These rules are then used by copy_tex_image_conversions_required conformance test to
* validate successfully executed conversions.
*
* A quick reminder:
*
* Source dataset corresponds to 2x2 image (using up to 4 channels) that the attachment bound to
* read buffer will use prior to glCopyTexImage2D() call. This image is defined by 4 Get*PixelData()
* calls with the first argument set to 1.
* Destination dataset corresponds to 2x2 image (using up to 4 channels) that the result texture
* object should match (within acceptable epsilon). This image is defined by 4 Get*PixelData() calls
* with the first argument set to 0.
*
* Source datasets are allowed to use any internalformat+type combination that is considered supported
* by GLES implementation.
* Destination datasets are only allowed to use specific types - please see AddEntryToConversionDatabase()
* doxygen for more details.
*
* @param database Conversion database handle.
**/
void ConversionDatabase::configureConversionDatabase()
{
int bits_1010102[4] = { 10, 10, 10, 2 };
int bits_4444[4] = { 4, 4, 4, 4 };
int bits_5551[4] = { 5, 5, 5, 1 };
int bits_565[4] = { 5, 6, 5, 0 };
int bits_888[4] = { 8, 8, 8, 0 };
int bits_8888[4] = { 8, 8, 8, 8 };
/* GL_R8 */
{
const unsigned char texel1[1] = { 255 };
const unsigned char texel2[1] = { 127 };
const unsigned char texel3[1] = { 63 };
const unsigned char texel4[1] = { 0 };
/* GL_R8 => GL_LUMINANCE8_OES */
addEntryToConversionDatabase(
getR8PixelData(1, GL_UNSIGNED_BYTE, texel1[0]), getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel1[0]),
getR8PixelData(1, GL_UNSIGNED_BYTE, texel2[0]), getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel2[0]),
getR8PixelData(1, GL_UNSIGNED_BYTE, texel3[0]), getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel3[0]),
getR8PixelData(1, GL_UNSIGNED_BYTE, texel4[0]), getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
/* GL_R8 => GL_R8 */
addEntryToConversionDatabase(
getR8PixelData(1, GL_UNSIGNED_BYTE, texel1[0]), getR8PixelData(0, GL_UNSIGNED_BYTE, texel1[0]),
getR8PixelData(1, GL_UNSIGNED_BYTE, texel2[0]), getR8PixelData(0, GL_UNSIGNED_BYTE, texel2[0]),
getR8PixelData(1, GL_UNSIGNED_BYTE, texel3[0]), getR8PixelData(0, GL_UNSIGNED_BYTE, texel3[0]),
getR8PixelData(1, GL_UNSIGNED_BYTE, texel4[0]), getR8PixelData(0, GL_UNSIGNED_BYTE, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
}
/* GL_RG8 */
{
const unsigned char texel1[2] = { 255, 127 };
const unsigned char texel2[2] = { 127, 63 };
const unsigned char texel3[2] = { 63, 0 };
const unsigned char texel4[2] = { 0, 255 };
/* GL_RG8 => GL_LUMINANCE8_OES */
addEntryToConversionDatabase(getRG8PixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel1[0]),
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel2[0]),
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel3[0]),
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RG8 => GL_R8 */
addEntryToConversionDatabase(
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1]), getR8PixelData(0, GL_UNSIGNED_BYTE, texel1[0]),
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1]), getR8PixelData(0, GL_UNSIGNED_BYTE, texel2[0]),
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1]), getR8PixelData(0, GL_UNSIGNED_BYTE, texel3[0]),
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1]), getR8PixelData(0, GL_UNSIGNED_BYTE, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
/* GL_RG8 => GL_RG8 */
addEntryToConversionDatabase(getRG8PixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel1[0], texel1[1]),
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel2[0], texel2[1]),
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel3[0], texel3[1]),
getRG8PixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_RGB8 */
{
const unsigned char texel1[3] = { 255, 127, 63 };
const unsigned char texel2[3] = { 127, 63, 0 };
const unsigned char texel3[3] = { 63, 0, 255 };
const unsigned char texel4[3] = { 0, 255, 127 };
/* GL_RGB8 => GL_RGB8 */
addEntryToConversionDatabase(getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2]),
getRGB8PixelData(0, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2]),
getRGB8PixelData(0, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2]),
getRGB8PixelData(0, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2]),
getRGB8PixelData(0, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGB8 => GL_LUMINANCE8_OES */
addEntryToConversionDatabase(getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel1[0]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel2[0]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel3[0]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGB8 => GL_R8 */
addEntryToConversionDatabase(getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2]),
getR8PixelData(0, GL_UNSIGNED_BYTE, texel1[0]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2]),
getR8PixelData(0, GL_UNSIGNED_BYTE, texel2[0]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2]),
getR8PixelData(0, GL_UNSIGNED_BYTE, texel3[0]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2]),
getR8PixelData(0, GL_UNSIGNED_BYTE, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGB8 => GL_RG8 */
addEntryToConversionDatabase(getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel1[0], texel1[1]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel2[0], texel2[1]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel3[0], texel3[1]),
getRGB8PixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
{ /* GL_RGB565 */
int texel565_1[4] = { 31, 63, 21, 0 };
int texel565_2[4] = { 21, 43, 11, 0 };
int texel565_3[4] = { 11, 23, 1, 0 };
int texel888_1[4] = { 255, 155, 55, 0 };
int texel888_2[4] = { 176, 76, 36, 0 };
int texel888_3[4] = { 88, 66, 44, 0 };
int texel888_4[4] = { 20, 10, 0, 0 };
int temp_565_to_888_bl[4] = { 0 };
int temp_565_to_888_tl[4] = { 0 };
int temp_565_to_888_tr[4] = { 0 };
int temp_888_through_565_to_888_bl[4] = { 0 };
int temp_888_through_565_to_888_br[4] = { 0 };
int temp_888_through_565_to_888_tl[4] = { 0 };
int temp_888_through_565_to_888_tr[4] = { 0 };
convertNormalizedUnsignedFixedPoint(bits_565, bits_888, bits_888, bits_888, texel565_1, temp_565_to_888_tl);
convertNormalizedUnsignedFixedPoint(bits_565, bits_888, bits_888, bits_888, texel565_2, temp_565_to_888_tr);
convertNormalizedUnsignedFixedPoint(bits_565, bits_888, bits_888, bits_888, texel565_3, temp_565_to_888_bl);
convertNormalizedUnsignedFixedPoint(bits_888, bits_565, bits_888, bits_888, texel888_1,
temp_888_through_565_to_888_tl);
convertNormalizedUnsignedFixedPoint(bits_888, bits_565, bits_888, bits_888, texel888_2,
temp_888_through_565_to_888_tr);
convertNormalizedUnsignedFixedPoint(bits_888, bits_565, bits_888, bits_888, texel888_3,
temp_888_through_565_to_888_bl);
convertNormalizedUnsignedFixedPoint(bits_888, bits_565, bits_888, bits_888, texel888_4,
temp_888_through_565_to_888_br);
/* GL_RGB565 => GL_RGB565 */
addEntryToConversionDatabase(
getRGB565PixelData(1, GL_UNSIGNED_SHORT_5_6_5, texel565_1[0], texel565_1[1], texel565_1[2]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_565_to_888_tl[0], temp_565_to_888_tl[1],
temp_565_to_888_tl[2]),
getRGB565PixelData(1, GL_UNSIGNED_SHORT_5_6_5, texel565_2[0], texel565_2[1], texel565_2[2]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_565_to_888_tr[0], temp_565_to_888_tr[1],
temp_565_to_888_tr[2]),
getRGB565PixelData(1, GL_UNSIGNED_SHORT_5_6_5, texel565_3[0], texel565_3[1], texel565_3[2]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_565_to_888_bl[0], temp_565_to_888_bl[1],
temp_565_to_888_bl[2]),
getRGB565PixelData(1, GL_UNSIGNED_SHORT_5_6_5, 0, 0, 0), getRGB565PixelData(0, GL_UNSIGNED_BYTE, 0, 0, 0),
PIXEL_COMPARE_CHANNEL_RGB);
addEntryToConversionDatabase(
getRGB565PixelData(1, GL_UNSIGNED_BYTE, texel888_1[0], texel888_1[1], texel888_1[2]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_888_through_565_to_888_tl[0],
temp_888_through_565_to_888_tl[1], temp_888_through_565_to_888_tl[2]),
getRGB565PixelData(1, GL_UNSIGNED_BYTE, texel888_2[0], texel888_2[1], texel888_2[2]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_888_through_565_to_888_tr[0],
temp_888_through_565_to_888_tr[1], temp_888_through_565_to_888_tr[2]),
getRGB565PixelData(1, GL_UNSIGNED_BYTE, texel888_3[0], texel888_3[1], texel888_3[2]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_888_through_565_to_888_bl[0],
temp_888_through_565_to_888_bl[1], temp_888_through_565_to_888_bl[2]),
getRGB565PixelData(1, GL_UNSIGNED_BYTE, texel888_4[0], texel888_4[1], texel888_4[2]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_888_through_565_to_888_br[0],
temp_888_through_565_to_888_br[1], temp_888_through_565_to_888_br[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGB565 => GL_LUMINANCE8_OES */
addEntryToConversionDatabase(
getRGB565PixelData(1, GL_UNSIGNED_SHORT_5_6_5, texel565_1[0], texel565_1[1], texel565_1[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_565_to_888_tl[0]),
getRGB565PixelData(1, GL_UNSIGNED_SHORT_5_6_5, texel565_2[0], texel565_2[1], texel565_2[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_565_to_888_tr[0]),
getRGB565PixelData(1, GL_UNSIGNED_SHORT_5_6_5, texel565_3[0], texel565_3[1], texel565_3[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_565_to_888_bl[0]),
getRGB565PixelData(1, GL_UNSIGNED_SHORT_5_6_5, 0, 0, 0), getLuminance8OESPixelData(GL_UNSIGNED_BYTE, 0),
PIXEL_COMPARE_CHANNEL_R);
addEntryToConversionDatabase(
getRGB565PixelData(1, GL_UNSIGNED_BYTE, texel888_1[0], texel888_1[1], texel888_1[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_888_through_565_to_888_tl[0]),
getRGB565PixelData(1, GL_UNSIGNED_BYTE, texel888_2[0], texel888_2[1], texel888_2[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_888_through_565_to_888_tr[0]),
getRGB565PixelData(1, GL_UNSIGNED_BYTE, texel888_3[0], texel888_3[1], texel888_3[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_888_through_565_to_888_bl[0]),
getRGB565PixelData(1, GL_UNSIGNED_BYTE, texel888_4[0], texel888_4[1], texel888_4[2]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_888_through_565_to_888_br[0]), PIXEL_COMPARE_CHANNEL_R);
}
/* GL_RGBA4 */
{
int texel4444_1[4] = { 15, 9, 4, 0 };
int texel4444_2[4] = { 9, 4, 0, 15 };
int texel4444_3[4] = { 4, 0, 15, 9 };
int texel4444_4[4] = { 0, 15, 9, 4 };
int texel8888_1[4] = { 255, 159, 79, 0 };
int texel8888_2[4] = { 159, 79, 0, 255 };
int texel8888_3[4] = { 79, 0, 255, 159 };
int texel8888_4[4] = { 0, 255, 159, 79 };
int temp_4444_to_565_8888_tl[4] = { 0 };
int temp_4444_to_565_8888_tr[4] = { 0 };
int temp_4444_to_565_8888_bl[4] = { 0 };
int temp_4444_to_565_8888_br[4] = { 0 };
int temp_4444_to_8888_tl[4] = { 0 };
int temp_4444_to_8888_tr[4] = { 0 };
int temp_4444_to_8888_bl[4] = { 0 };
int temp_4444_to_8888_br[4] = { 0 };
int temp_8888_through_4444_to_565_tl[4] = { 0 };
int temp_8888_through_4444_to_565_tr[4] = { 0 };
int temp_8888_through_4444_to_565_bl[4] = { 0 };
int temp_8888_through_4444_to_565_br[4] = { 0 };
int temp_8888_through_4444_to_8888_tl[4] = { 0 };
int temp_8888_through_4444_to_8888_tr[4] = { 0 };
int temp_8888_through_4444_to_8888_bl[4] = { 0 };
int temp_8888_through_4444_to_8888_br[4] = { 0 };
int temp_8888_through_4444_565_to_8888_tl[4] = { 0 };
int temp_8888_through_4444_565_to_8888_tr[4] = { 0 };
int temp_8888_through_4444_565_to_8888_bl[4] = { 0 };
int temp_8888_through_4444_565_to_8888_br[4] = { 0 };
convertNormalizedUnsignedFixedPoint(bits_4444, bits_565, bits_8888, bits_8888, texel4444_1,
temp_4444_to_565_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_4444, bits_565, bits_8888, bits_8888, texel4444_2,
temp_4444_to_565_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_4444, bits_565, bits_8888, bits_8888, texel4444_3,
temp_4444_to_565_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_4444, bits_565, bits_8888, bits_8888, texel4444_4,
temp_4444_to_565_8888_br);
convertNormalizedUnsignedFixedPoint(bits_4444, bits_8888, bits_8888, bits_8888, texel4444_1,
temp_4444_to_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_4444, bits_8888, bits_8888, bits_8888, texel4444_2,
temp_4444_to_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_4444, bits_8888, bits_8888, bits_8888, texel4444_3,
temp_4444_to_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_4444, bits_8888, bits_8888, bits_8888, texel4444_4,
temp_4444_to_8888_br);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_565, bits_565, texel8888_1,
temp_8888_through_4444_to_565_tl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_565, bits_565, texel8888_2,
temp_8888_through_4444_to_565_tr);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_565, bits_565, texel8888_3,
temp_8888_through_4444_to_565_bl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_565, bits_565, texel8888_4,
temp_8888_through_4444_to_565_br);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_8888, bits_8888, texel8888_1,
temp_8888_through_4444_to_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_8888, bits_8888, texel8888_2,
temp_8888_through_4444_to_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_8888, bits_8888, texel8888_3,
temp_8888_through_4444_to_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_8888, bits_8888, texel8888_4,
temp_8888_through_4444_to_8888_br);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_565, bits_8888, texel8888_1,
temp_8888_through_4444_565_to_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_565, bits_8888, texel8888_2,
temp_8888_through_4444_565_to_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_565, bits_8888, texel8888_3,
temp_8888_through_4444_565_to_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_4444, bits_565, bits_8888, texel8888_4,
temp_8888_through_4444_565_to_8888_br);
/* GL_RGBA4 => GL_RGBA4 */
addEntryToConversionDatabase(
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_1[0], texel4444_1[1], texel4444_1[2],
texel4444_1[3]),
getRGBA4PixelData(0, GL_UNSIGNED_BYTE, temp_4444_to_8888_tl[0], temp_4444_to_8888_tl[1],
temp_4444_to_8888_tl[2], temp_4444_to_8888_tl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_2[0], texel4444_2[1], texel4444_2[2],
texel4444_2[3]),
getRGBA4PixelData(0, GL_UNSIGNED_BYTE, temp_4444_to_8888_tr[0], temp_4444_to_8888_tr[1],
temp_4444_to_8888_tr[2], temp_4444_to_8888_tr[3]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_3[0], texel4444_3[1], texel4444_3[2],
texel4444_3[3]),
getRGBA4PixelData(0, GL_UNSIGNED_BYTE, temp_4444_to_8888_bl[0], temp_4444_to_8888_bl[1],
temp_4444_to_8888_bl[2], temp_4444_to_8888_bl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_4[0], texel4444_4[1], texel4444_4[2],
texel4444_4[3]),
getRGBA4PixelData(0, GL_UNSIGNED_BYTE, temp_4444_to_8888_br[0], temp_4444_to_8888_br[1],
temp_4444_to_8888_br[2], temp_4444_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
addEntryToConversionDatabase(
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel8888_1[0], texel8888_1[1], texel8888_1[2], texel8888_1[3]),
getRGBA4PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_tl[0],
temp_8888_through_4444_to_8888_tl[1], temp_8888_through_4444_to_8888_tl[2],
temp_8888_through_4444_to_8888_tl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel8888_2[0], texel8888_2[1], texel8888_2[2], texel8888_2[3]),
getRGBA4PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_tr[0],
temp_8888_through_4444_to_8888_tr[1], temp_8888_through_4444_to_8888_tr[2],
temp_8888_through_4444_to_8888_tr[3]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel8888_3[0], texel8888_3[1], texel8888_3[2], texel8888_3[3]),
getRGBA4PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_bl[0],
temp_8888_through_4444_to_8888_bl[1], temp_8888_through_4444_to_8888_bl[2],
temp_8888_through_4444_to_8888_bl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel8888_4[0], texel8888_4[1], texel8888_4[2], texel8888_4[3]),
getRGBA4PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_br[0],
temp_8888_through_4444_to_8888_br[1], temp_8888_through_4444_to_8888_br[2],
temp_8888_through_4444_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
/* GL_RGBA4 => GL_RGB565 */
addEntryToConversionDatabase(getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_1[0], texel4444_1[1],
texel4444_1[2], texel4444_1[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_4444_to_565_8888_tl[0],
temp_4444_to_565_8888_tl[1], temp_4444_to_565_8888_tl[2]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_2[0], texel4444_2[1],
texel4444_2[2], texel4444_2[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_4444_to_565_8888_tr[0],
temp_4444_to_565_8888_tr[1], temp_4444_to_565_8888_tr[2]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_3[0], texel4444_3[1],
texel4444_3[2], texel4444_3[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_4444_to_565_8888_bl[0],
temp_4444_to_565_8888_bl[1], temp_4444_to_565_8888_bl[2]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_4[0], texel4444_4[1],
texel4444_4[2], texel4444_4[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_4444_to_565_8888_br[0],
temp_4444_to_565_8888_br[1], temp_4444_to_565_8888_br[2]),
PIXEL_COMPARE_CHANNEL_RGB);
addEntryToConversionDatabase(
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel8888_1[0], texel8888_1[1], texel8888_1[2], texel8888_1[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_4444_565_to_8888_tl[0],
temp_8888_through_4444_565_to_8888_tl[1], temp_8888_through_4444_565_to_8888_tl[2]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel8888_2[0], texel8888_2[1], texel8888_2[2], texel8888_2[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_4444_565_to_8888_tr[0],
temp_8888_through_4444_565_to_8888_tr[1], temp_8888_through_4444_565_to_8888_tr[2]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel8888_3[0], texel8888_3[1], texel8888_3[2], texel8888_3[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_4444_565_to_8888_bl[0],
temp_8888_through_4444_565_to_8888_bl[1], temp_8888_through_4444_565_to_8888_bl[2]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel8888_4[0], texel8888_4[1], texel8888_4[2], texel8888_4[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_4444_565_to_8888_br[0],
temp_8888_through_4444_565_to_8888_br[1], temp_8888_through_4444_565_to_8888_br[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA4 => GL_LUMINANCE8_ALPHA8_OES */
addEntryToConversionDatabase(
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_1[0], texel4444_1[1], texel4444_1[2],
texel4444_1[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_tl[0], temp_4444_to_8888_tl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_2[0], texel4444_2[1], texel4444_2[2],
texel4444_2[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_tr[0], temp_4444_to_8888_tr[3]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_3[0], texel4444_3[1], texel4444_3[2],
texel4444_3[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_bl[0], temp_4444_to_8888_bl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_4[0], texel4444_4[1], texel4444_4[2],
texel4444_4[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_br[0], temp_4444_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RA);
addEntryToConversionDatabase(
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_1[0], texel4444_1[1], texel4444_1[2], texel4444_1[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_tl[0],
temp_8888_through_4444_to_8888_tl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_2[0], texel4444_2[1], texel4444_2[2], texel4444_2[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_tr[0],
temp_8888_through_4444_to_8888_tr[3]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_3[0], texel4444_3[1], texel4444_3[2], texel4444_3[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_bl[0],
temp_8888_through_4444_to_8888_bl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_4[0], texel4444_4[1], texel4444_4[2], texel4444_4[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_br[0],
temp_8888_through_4444_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RA);
/* GL_RGBA4 => GL_LUMINANCE8_OES */
addEntryToConversionDatabase(getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_1[0], texel4444_1[1],
texel4444_1[2], texel4444_1[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_tl[0]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_2[0], texel4444_2[1],
texel4444_2[2], texel4444_2[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_tr[0]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_3[0], texel4444_3[1],
texel4444_3[2], texel4444_3[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_bl[0]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_4[0], texel4444_4[1],
texel4444_4[2], texel4444_4[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_br[0]),
PIXEL_COMPARE_CHANNEL_R);
addEntryToConversionDatabase(
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_1[0], texel4444_1[1], texel4444_1[2], texel4444_1[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_tl[0]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_2[0], texel4444_2[1], texel4444_2[2], texel4444_2[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_tr[0]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_3[0], texel4444_3[1], texel4444_3[2], texel4444_3[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_bl[0]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_4[0], texel4444_4[1], texel4444_4[2], texel4444_4[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_br[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA4 => GL_ALPHA8_OES */
addEntryToConversionDatabase(getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_1[0], texel4444_1[1],
texel4444_1[2], texel4444_1[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_tl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_2[0], texel4444_2[1],
texel4444_2[2], texel4444_2[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_tr[3]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_3[0], texel4444_3[1],
texel4444_3[2], texel4444_3[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_bl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_SHORT_4_4_4_4, texel4444_4[0], texel4444_4[1],
texel4444_4[2], texel4444_4[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_4444_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_A);
addEntryToConversionDatabase(
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_1[0], texel4444_1[1], texel4444_1[2], texel4444_1[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_tl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_2[0], texel4444_2[1], texel4444_2[2], texel4444_2[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_tr[3]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_3[0], texel4444_3[1], texel4444_3[2], texel4444_3[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_bl[3]),
getRGBA4PixelData(1, GL_UNSIGNED_BYTE, texel4444_4[0], texel4444_4[1], texel4444_4[2], texel4444_4[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_4444_to_8888_br[3]), PIXEL_COMPARE_CHANNEL_A);
}
/* GL_RGB5_A1 */
{
int texel2101010_1[4] = { 1023, 703, 383, 2 };
int texel2101010_2[4] = { 703, 383, 0, 0 };
int texel2101010_3[4] = { 383, 0, 1023, 2 };
int texel2101010_4[4] = { 0, 1023, 703, 0 };
int texel5551_1[4] = { 31, 21, 11, 1 };
int texel5551_2[4] = { 21, 11, 0, 0 };
int texel5551_3[4] = { 11, 0, 31, 1 };
int texel5551_4[4] = { 0, 31, 21, 0 };
int texel8888_1[4] = { 255, 207, 95, 255 };
int texel8888_2[4] = { 207, 95, 0, 0 };
int texel8888_3[4] = { 95, 0, 255, 255 };
int texel8888_4[4] = { 0, 255, 207, 0 };
int temp_2101010rev_through_5551_to_8888_tl[4] = { 0 };
int temp_2101010rev_through_5551_to_8888_tr[4] = { 0 };
int temp_2101010rev_through_5551_to_8888_bl[4] = { 0 };
int temp_2101010rev_through_5551_to_8888_br[4] = { 0 };
int temp_2101010rev_through_5551_565_to_8888_tl[4] = { 0 };
int temp_2101010rev_through_5551_565_to_8888_tr[4] = { 0 };
int temp_2101010rev_through_5551_565_to_8888_bl[4] = { 0 };
int temp_2101010rev_through_5551_565_to_8888_br[4] = { 0 };
int temp_5551_to_8888_tl[4] = { 0 };
int temp_5551_to_8888_tr[4] = { 0 };
int temp_5551_to_8888_bl[4] = { 0 };
int temp_5551_to_8888_br[4] = { 0 };
int temp_5551_through_565_to_8888_tl[4] = { 0 };
int temp_5551_through_565_to_8888_tr[4] = { 0 };
int temp_5551_through_565_to_8888_bl[4] = { 0 };
int temp_5551_through_565_to_8888_br[4] = { 0 };
int temp_8888_through_5551_to_8888_tl[4] = { 0 };
int temp_8888_through_5551_to_8888_tr[4] = { 0 };
int temp_8888_through_5551_to_8888_bl[4] = { 0 };
int temp_8888_through_5551_to_8888_br[4] = { 0 };
int temp_8888_through_5551_565_to_8888_tl[4] = { 0 };
int temp_8888_through_5551_565_to_8888_tr[4] = { 0 };
int temp_8888_through_5551_565_to_8888_bl[4] = { 0 };
int temp_8888_through_5551_565_to_8888_br[4] = { 0 };
convertNormalizedUnsignedFixedPoint(bits_1010102, bits_5551, bits_8888, bits_8888, texel2101010_1,
temp_2101010rev_through_5551_to_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_1010102, bits_5551, bits_8888, bits_8888, texel2101010_2,
temp_2101010rev_through_5551_to_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_1010102, bits_5551, bits_8888, bits_8888, texel2101010_3,
temp_2101010rev_through_5551_to_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_1010102, bits_5551, bits_8888, bits_8888, texel2101010_4,
temp_2101010rev_through_5551_to_8888_br);
convertNormalizedUnsignedFixedPoint(bits_1010102, bits_5551, bits_565, bits_8888, texel2101010_1,
temp_2101010rev_through_5551_565_to_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_1010102, bits_5551, bits_565, bits_8888, texel2101010_2,
temp_2101010rev_through_5551_565_to_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_1010102, bits_5551, bits_565, bits_8888, texel2101010_3,
temp_2101010rev_through_5551_565_to_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_1010102, bits_5551, bits_565, bits_8888, texel2101010_4,
temp_2101010rev_through_5551_565_to_8888_br);
convertNormalizedUnsignedFixedPoint(bits_5551, bits_8888, bits_8888, bits_8888, texel5551_1,
temp_5551_to_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_5551, bits_8888, bits_8888, bits_8888, texel5551_2,
temp_5551_to_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_5551, bits_8888, bits_8888, bits_8888, texel5551_3,
temp_5551_to_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_5551, bits_8888, bits_8888, bits_8888, texel5551_4,
temp_5551_to_8888_br);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_5551, bits_8888, bits_8888, texel8888_1,
temp_8888_through_5551_to_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_5551, bits_8888, bits_8888, texel8888_2,
temp_8888_through_5551_to_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_5551, bits_8888, bits_8888, texel8888_3,
temp_8888_through_5551_to_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_5551, bits_8888, bits_8888, texel8888_4,
temp_8888_through_5551_to_8888_br);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_5551, bits_565, bits_8888, texel8888_1,
temp_8888_through_5551_565_to_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_5551, bits_565, bits_8888, texel8888_2,
temp_8888_through_5551_565_to_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_5551, bits_565, bits_8888, texel8888_3,
temp_8888_through_5551_565_to_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_8888, bits_5551, bits_565, bits_8888, texel8888_4,
temp_8888_through_5551_565_to_8888_br);
convertNormalizedUnsignedFixedPoint(bits_5551, bits_565, bits_8888, bits_8888, texel5551_1,
temp_5551_through_565_to_8888_tl);
convertNormalizedUnsignedFixedPoint(bits_5551, bits_565, bits_8888, bits_8888, texel5551_2,
temp_5551_through_565_to_8888_tr);
convertNormalizedUnsignedFixedPoint(bits_5551, bits_565, bits_8888, bits_8888, texel5551_3,
temp_5551_through_565_to_8888_bl);
convertNormalizedUnsignedFixedPoint(bits_5551, bits_565, bits_8888, bits_8888, texel5551_4,
temp_5551_through_565_to_8888_br);
/* GL_RGB5_A1 => GL_RGB5_A1 */
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_1[0], texel8888_1[1], texel8888_1[2], texel8888_1[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_tl[0],
temp_8888_through_5551_to_8888_tl[1], temp_8888_through_5551_to_8888_tl[2],
temp_8888_through_5551_to_8888_tl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_2[0], texel8888_2[1], texel8888_2[2], texel8888_2[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_tr[0],
temp_8888_through_5551_to_8888_tr[1], temp_8888_through_5551_to_8888_tr[2],
temp_8888_through_5551_to_8888_tr[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_3[0], texel8888_3[1], texel8888_3[2], texel8888_3[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_bl[0],
temp_8888_through_5551_to_8888_bl[1], temp_8888_through_5551_to_8888_bl[2],
temp_8888_through_5551_to_8888_bl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_4[0], texel8888_4[1], texel8888_4[2], texel8888_4[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_br[0],
temp_8888_through_5551_to_8888_br[1], temp_8888_through_5551_to_8888_br[2],
temp_8888_through_5551_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_1[0], texel5551_1[1], texel5551_1[2],
texel5551_1[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_5551_to_8888_tl[0], temp_5551_to_8888_tl[1],
temp_5551_to_8888_tl[2], temp_5551_to_8888_tl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_2[0], texel5551_2[1], texel5551_2[2],
texel5551_2[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_5551_to_8888_tr[0], temp_5551_to_8888_tr[1],
temp_5551_to_8888_tr[2], temp_5551_to_8888_tr[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_3[0], texel5551_3[1], texel5551_3[2],
texel5551_3[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_5551_to_8888_bl[0], temp_5551_to_8888_bl[1],
temp_5551_to_8888_bl[2], temp_5551_to_8888_bl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_4[0], texel5551_4[1], texel5551_4[2],
texel5551_4[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_5551_to_8888_br[0], temp_5551_to_8888_br[1],
temp_5551_to_8888_br[2], temp_5551_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_1[0], texel2101010_1[1],
texel2101010_1[2], texel2101010_1[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_tl[0],
temp_2101010rev_through_5551_to_8888_tl[1], temp_2101010rev_through_5551_to_8888_tl[2],
temp_2101010rev_through_5551_to_8888_tl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_2[0], texel2101010_2[1],
texel2101010_2[2], texel2101010_2[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_tr[0],
temp_2101010rev_through_5551_to_8888_tr[1], temp_2101010rev_through_5551_to_8888_tr[2],
temp_2101010rev_through_5551_to_8888_tr[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_3[0], texel2101010_3[1],
texel2101010_3[2], texel2101010_3[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_bl[0],
temp_2101010rev_through_5551_to_8888_bl[1], temp_2101010rev_through_5551_to_8888_bl[2],
temp_2101010rev_through_5551_to_8888_bl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_4[0], texel2101010_4[1],
texel2101010_4[2], texel2101010_4[3]),
getRGB5A1PixelData(0, GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_br[0],
temp_2101010rev_through_5551_to_8888_br[1], temp_2101010rev_through_5551_to_8888_br[2],
temp_2101010rev_through_5551_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
/* GL_RGB5_A1 => GL_RGB565 */
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_1[0], texel8888_1[1], texel8888_1[2], texel8888_1[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_5551_565_to_8888_tl[0],
temp_8888_through_5551_565_to_8888_tl[1], temp_8888_through_5551_565_to_8888_tl[2]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_2[0], texel8888_2[1], texel8888_2[2], texel8888_2[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_5551_565_to_8888_tr[0],
temp_8888_through_5551_565_to_8888_tr[1], temp_8888_through_5551_565_to_8888_tr[2]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_3[0], texel8888_3[1], texel8888_3[2], texel8888_3[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_5551_565_to_8888_bl[0],
temp_8888_through_5551_565_to_8888_bl[1], temp_8888_through_5551_565_to_8888_bl[2]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_4[0], texel8888_4[1], texel8888_4[2], texel8888_4[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_8888_through_5551_565_to_8888_br[0],
temp_8888_through_5551_565_to_8888_br[1], temp_8888_through_5551_565_to_8888_br[2]),
PIXEL_COMPARE_CHANNEL_RGB);
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_1[0], texel5551_1[1], texel5551_1[2],
texel5551_1[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_5551_through_565_to_8888_tl[0],
temp_5551_through_565_to_8888_tl[1], temp_5551_through_565_to_8888_tl[2]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_2[0], texel5551_2[1], texel5551_2[2],
texel5551_2[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_5551_through_565_to_8888_tr[0],
temp_5551_through_565_to_8888_tr[1], temp_5551_through_565_to_8888_tr[2]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_3[0], texel5551_3[1], texel5551_3[2],
texel5551_3[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_5551_through_565_to_8888_bl[0],
temp_5551_through_565_to_8888_bl[1], temp_5551_through_565_to_8888_bl[2]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_4[0], texel5551_4[1], texel5551_4[2],
texel5551_4[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_5551_through_565_to_8888_br[0],
temp_5551_through_565_to_8888_br[1], temp_5551_through_565_to_8888_br[2]),
PIXEL_COMPARE_CHANNEL_RGB);
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_1[0], texel2101010_1[1],
texel2101010_1[2], texel2101010_1[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_565_to_8888_tl[0],
temp_2101010rev_through_5551_565_to_8888_tl[1],
temp_2101010rev_through_5551_565_to_8888_tl[2]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_2[0], texel2101010_2[1],
texel2101010_2[2], texel2101010_2[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_565_to_8888_tr[0],
temp_2101010rev_through_5551_565_to_8888_tr[1],
temp_2101010rev_through_5551_565_to_8888_tr[2]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_3[0], texel2101010_3[1],
texel2101010_3[2], texel2101010_3[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_565_to_8888_bl[0],
temp_2101010rev_through_5551_565_to_8888_bl[1],
temp_2101010rev_through_5551_565_to_8888_bl[2]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_4[0], texel2101010_4[1],
texel2101010_4[2], texel2101010_4[3]),
getRGB565PixelData(0, GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_565_to_8888_br[0],
temp_2101010rev_through_5551_565_to_8888_br[1],
temp_2101010rev_through_5551_565_to_8888_br[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGB5_A1 => GL_LUMINANCE8_ALPHA8_OES */
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_1[0], texel8888_1[1], texel8888_1[2], texel8888_1[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_tl[0],
temp_8888_through_5551_to_8888_tl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_2[0], texel8888_2[1], texel8888_2[2], texel8888_2[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_tr[0],
temp_8888_through_5551_to_8888_tr[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_3[0], texel8888_3[1], texel8888_3[2], texel8888_3[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_bl[0],
temp_8888_through_5551_to_8888_bl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_4[0], texel8888_4[1], texel8888_4[2], texel8888_4[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_br[0],
temp_8888_through_5551_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RA);
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_1[0], texel5551_1[1], texel5551_1[2],
texel5551_1[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_tl[0], temp_5551_to_8888_tl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_2[0], texel5551_2[1], texel5551_2[2],
texel5551_2[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_tr[0], temp_5551_to_8888_tr[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_3[0], texel5551_3[1], texel5551_3[2],
texel5551_3[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_bl[0], temp_5551_to_8888_bl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_4[0], texel5551_4[1], texel5551_4[2],
texel5551_4[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_br[0], temp_5551_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RA);
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_1[0], texel2101010_1[1],
texel2101010_1[2], texel2101010_1[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_tl[0],
temp_2101010rev_through_5551_to_8888_tl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_2[0], texel2101010_2[1],
texel2101010_2[2], texel2101010_2[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_tr[0],
temp_2101010rev_through_5551_to_8888_tr[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_3[0], texel2101010_3[1],
texel2101010_3[2], texel2101010_3[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_bl[0],
temp_2101010rev_through_5551_to_8888_bl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_4[0], texel2101010_4[1],
texel2101010_4[2], texel2101010_4[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_br[0],
temp_2101010rev_through_5551_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_RA);
/* GL_RGB5_A1 => GL_LUMINANCE8_OES */
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_1[0], texel8888_1[1], texel8888_1[2], texel8888_1[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_tl[0]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_2[0], texel8888_2[1], texel8888_2[2], texel8888_2[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_tr[0]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_3[0], texel8888_3[1], texel8888_3[2], texel8888_3[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_bl[0]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_4[0], texel8888_4[1], texel8888_4[2], texel8888_4[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_br[0]), PIXEL_COMPARE_CHANNEL_R);
addEntryToConversionDatabase(getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_1[0], texel5551_1[1],
texel5551_1[2], texel5551_1[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_tl[0]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_2[0], texel5551_2[1],
texel5551_2[2], texel5551_2[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_tr[0]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_3[0], texel5551_3[1],
texel5551_3[2], texel5551_3[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_bl[0]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_4[0], texel5551_4[1],
texel5551_4[2], texel5551_4[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_br[0]),
PIXEL_COMPARE_CHANNEL_R);
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_1[0], texel2101010_1[1],
texel2101010_1[2], texel2101010_1[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_tl[0]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_2[0], texel2101010_2[1],
texel2101010_2[2], texel2101010_2[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_tr[0]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_3[0], texel2101010_3[1],
texel2101010_3[2], texel2101010_3[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_bl[0]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_4[0], texel2101010_4[1],
texel2101010_4[2], texel2101010_4[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_br[0]),
PIXEL_COMPARE_CHANNEL_R);
/* GL_RGB5_A1 => GL_ALPHA8_OES */
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_1[0], texel8888_1[1], texel8888_1[2], texel8888_1[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_tl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_2[0], texel8888_2[1], texel8888_2[2], texel8888_2[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_tr[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_3[0], texel8888_3[1], texel8888_3[2], texel8888_3[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_bl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_BYTE, texel8888_4[0], texel8888_4[1], texel8888_4[2], texel8888_4[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_8888_through_5551_to_8888_br[3]), PIXEL_COMPARE_CHANNEL_A);
addEntryToConversionDatabase(getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_1[0], texel5551_1[1],
texel5551_1[2], texel5551_1[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_tl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_2[0], texel5551_2[1],
texel5551_2[2], texel5551_2[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_tr[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_3[0], texel5551_3[1],
texel5551_3[2], texel5551_3[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_bl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_SHORT_5_5_5_1, texel5551_4[0], texel5551_4[1],
texel5551_4[2], texel5551_4[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_5551_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_A);
addEntryToConversionDatabase(
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_1[0], texel2101010_1[1],
texel2101010_1[2], texel2101010_1[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_tl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_2[0], texel2101010_2[1],
texel2101010_2[2], texel2101010_2[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_tr[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_3[0], texel2101010_3[1],
texel2101010_3[2], texel2101010_3[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_bl[3]),
getRGB5A1PixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2101010_4[0], texel2101010_4[1],
texel2101010_4[2], texel2101010_4[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, temp_2101010rev_through_5551_to_8888_br[3]),
PIXEL_COMPARE_CHANNEL_A);
}
/* GL_RGBA8 */
{
const unsigned char texel1[4] = { 255, 127, 63, 0 };
const unsigned char texel2[4] = { 127, 63, 0, 255 };
const unsigned char texel3[4] = { 63, 0, 255, 127 };
const unsigned char texel4[4] = { 0, 255, 127, 63 };
/* GL_RGBA8 => GL_RGBA8 */
addEntryToConversionDatabase(getRGBA8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
/* GL_RGBA8 => GL_RGB8 */
addEntryToConversionDatabase(getRGBA8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB8PixelData(0, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB8PixelData(0, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB8PixelData(0, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB8PixelData(0, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA8 => GL_LUMINANCE8_ALPHA8_OES */
addEntryToConversionDatabase(getRGBA8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getLuminance8Alpha8OESPixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[3]),
PIXEL_COMPARE_CHANNEL_RA);
/* GL_RGBA8 => GL_LUMINANCE8_OES */
addEntryToConversionDatabase(getRGBA8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel1[0]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel2[0]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel3[0]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getLuminance8OESPixelData(GL_UNSIGNED_BYTE, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA8 => GL_ALPHA8_OES */
addEntryToConversionDatabase(getRGBA8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, texel1[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, texel2[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, texel3[3]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getAlpha8OESPixelData(GL_UNSIGNED_BYTE, texel4[3]), PIXEL_COMPARE_CHANNEL_A);
/* GL_RGBA8 => GL_R8 */
addEntryToConversionDatabase(getRGBA8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getR8PixelData(0, GL_UNSIGNED_BYTE, texel1[0]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getR8PixelData(0, GL_UNSIGNED_BYTE, texel2[0]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getR8PixelData(0, GL_UNSIGNED_BYTE, texel3[0]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getR8PixelData(0, GL_UNSIGNED_BYTE, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA8 => GL_RG8 */
addEntryToConversionDatabase(getRGBA8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel1[0], texel1[1]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel2[0], texel2[1]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel3[0], texel3[1]),
getRGBA8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getRG8PixelData(0, GL_UNSIGNED_BYTE, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_RGB10_A2 */
{
const unsigned short texel1[4] = { 1023, 682, 341, 3 };
const unsigned short texel2[4] = { 682, 341, 0, 2 };
const unsigned short texel3[4] = { 341, 0, 1023, 1 };
const unsigned short texel4[4] = { 0, 1023, 682, 0 };
/* GL_RGB10_A2 => GL_RGB10_A2 */
addEntryToConversionDatabase(getRGB10A2PixelData(GL_UNSIGNED_INT_2_10_10_10_REV, texel1[0], texel1[1],
texel1[2], (unsigned char)texel1[3]),
getRGB10A2PixelData(GL_UNSIGNED_INT_2_10_10_10_REV, texel1[0], texel1[1],
texel1[2], (unsigned char)texel1[3]),
getRGB10A2PixelData(GL_UNSIGNED_INT_2_10_10_10_REV, texel2[0], texel2[1],
texel2[2], (unsigned char)texel2[3]),
getRGB10A2PixelData(GL_UNSIGNED_INT_2_10_10_10_REV, texel2[0], texel2[1],
texel2[2], (unsigned char)texel2[3]),
getRGB10A2PixelData(GL_UNSIGNED_INT_2_10_10_10_REV, texel3[0], texel3[1],
texel3[2], (unsigned char)texel3[3]),
getRGB10A2PixelData(GL_UNSIGNED_INT_2_10_10_10_REV, texel3[0], texel3[1],
texel3[2], (unsigned char)texel3[3]),
getRGB10A2PixelData(GL_UNSIGNED_INT_2_10_10_10_REV, texel4[0], texel4[1],
texel4[2], (unsigned char)texel4[3]),
getRGB10A2PixelData(GL_UNSIGNED_INT_2_10_10_10_REV, texel4[0], texel4[1],
texel4[2], (unsigned char)texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_RGB10_A2UI */
{
const unsigned short texel1[4] = { 1023, 682, 341, 3 };
const unsigned short texel2[4] = { 682, 341, 0, 2 };
const unsigned short texel3[4] = { 341, 0, 1023, 1 };
const unsigned short texel4[4] = { 0, 1023, 682, 0 };
/* GL_RGB10_A2UI => GL_RGB10_A2UI */
addEntryToConversionDatabase(
getRGB10A2UIPixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB10A2UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB10A2UIPixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB10A2UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB10A2UIPixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB10A2UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB10A2UIPixelData(1, GL_UNSIGNED_INT_2_10_10_10_REV, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB10A2UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_SRGB8_ALPHA8 */
{
const unsigned char texel1[4] = { 255, 127, 63, 0 };
const unsigned char texel2[4] = { 127, 63, 0, 255 };
const unsigned char texel3[4] = { 63, 0, 255, 127 };
const unsigned char texel4[4] = { 0, 255, 127, 63 };
/* GL_SRGB8_ALPHA8 => GL_SRGB8 */
addEntryToConversionDatabase(
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getSRGB8PixelData(0, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getSRGB8PixelData(0, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getSRGB8PixelData(0, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getSRGB8PixelData(0, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2]), PIXEL_COMPARE_CHANNEL_RGB);
/* GL_SRGB8_ALPHA8 => GL_SRGB8_ALPHA8 */
addEntryToConversionDatabase(
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getSRGB8Alpha8PixelData(GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_R8I */
{
const signed char texel1[1] = { 127 };
const signed char texel2[1] = { 42 };
const signed char texel3[1] = { -43 };
const signed char texel4[1] = { -127 };
/* GL_R8I => GL_R8I */
addEntryToConversionDatabase(getR8IPixelData(1, GL_BYTE, texel1[0]), getR8IPixelData(0, GL_INT, texel1[0]),
getR8IPixelData(1, GL_BYTE, texel2[0]), getR8IPixelData(0, GL_INT, texel2[0]),
getR8IPixelData(1, GL_BYTE, texel3[0]), getR8IPixelData(0, GL_INT, texel3[0]),
getR8IPixelData(1, GL_BYTE, texel4[0]), getR8IPixelData(0, GL_INT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
}
/* GL_R8UI */
{
const unsigned char texel1[1] = { 255 };
const unsigned char texel2[1] = { 127 };
const unsigned char texel3[1] = { 63 };
const unsigned char texel4[1] = { 0 };
/* GL_R8UI => GL_R8UI */
addEntryToConversionDatabase(
getR8UIPixelData(1, GL_UNSIGNED_BYTE, texel1[0]), getR8UIPixelData(0, GL_UNSIGNED_INT, texel1[0]),
getR8UIPixelData(1, GL_UNSIGNED_BYTE, texel2[0]), getR8UIPixelData(0, GL_UNSIGNED_INT, texel2[0]),
getR8UIPixelData(1, GL_UNSIGNED_BYTE, texel3[0]), getR8UIPixelData(0, GL_UNSIGNED_INT, texel3[0]),
getR8UIPixelData(1, GL_UNSIGNED_BYTE, texel4[0]), getR8UIPixelData(0, GL_UNSIGNED_INT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
}
/* GL_R16I */
{
const signed short texel1[1] = { 32767 };
const signed short texel2[1] = { 10922 };
const signed short texel3[1] = { -10923 };
const signed short texel4[1] = { -32767 };
/* GL_R16I => GL_R16I */
addEntryToConversionDatabase(getR16IPixelData(1, GL_SHORT, texel1[0]), getR16IPixelData(0, GL_INT, texel1[0]),
getR16IPixelData(1, GL_SHORT, texel2[0]), getR16IPixelData(0, GL_INT, texel2[0]),
getR16IPixelData(1, GL_SHORT, texel3[0]), getR16IPixelData(0, GL_INT, texel3[0]),
getR16IPixelData(1, GL_SHORT, texel4[0]), getR16IPixelData(0, GL_INT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
}
/* GL_R16UI */
{
const unsigned short texel1[1] = { 65535 };
const unsigned short texel2[1] = { 43690 };
const unsigned short texel3[1] = { 21845 };
const unsigned short texel4[1] = { 0 };
/* GL_R16UI => GL_R16UI */
addEntryToConversionDatabase(
getR16UIPixelData(1, GL_UNSIGNED_SHORT, texel1[0]), getR16UIPixelData(0, GL_UNSIGNED_INT, texel1[0]),
getR16UIPixelData(1, GL_UNSIGNED_SHORT, texel2[0]), getR16UIPixelData(0, GL_UNSIGNED_INT, texel2[0]),
getR16UIPixelData(1, GL_UNSIGNED_SHORT, texel3[0]), getR16UIPixelData(0, GL_UNSIGNED_INT, texel3[0]),
getR16UIPixelData(1, GL_UNSIGNED_SHORT, texel4[0]), getR16UIPixelData(0, GL_UNSIGNED_INT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
}
/* GL_R32I */
{
const int texel1[1] = { 2147483647l };
const int texel2[1] = { 715827883l };
const int texel3[1] = { -715827881l };
const int texel4[1] = { -2147483647l };
/* GL_R32I => GL_R32I */
addEntryToConversionDatabase(getR32IPixelData(1, GL_INT, texel1[0]), getR32IPixelData(0, GL_INT, texel1[0]),
getR32IPixelData(1, GL_INT, texel2[0]), getR32IPixelData(0, GL_INT, texel2[0]),
getR32IPixelData(1, GL_INT, texel3[0]), getR32IPixelData(0, GL_INT, texel3[0]),
getR32IPixelData(1, GL_INT, texel4[0]), getR32IPixelData(0, GL_INT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
}
/* GL_R32UI */
{
const unsigned int texel1[1] = { 4294967295u };
const unsigned int texel2[1] = { 2863311530u };
const unsigned int texel3[1] = { 1431655765u };
const unsigned int texel4[1] = { 0 };
/* GL_R32UI => GL_R32UI */
addEntryToConversionDatabase(
getR32UIPixelData(1, GL_UNSIGNED_INT, texel1[0]), getR32UIPixelData(0, GL_UNSIGNED_INT, texel1[0]),
getR32UIPixelData(1, GL_UNSIGNED_INT, texel2[0]), getR32UIPixelData(0, GL_UNSIGNED_INT, texel2[0]),
getR32UIPixelData(1, GL_UNSIGNED_INT, texel3[0]), getR32UIPixelData(0, GL_UNSIGNED_INT, texel3[0]),
getR32UIPixelData(1, GL_UNSIGNED_INT, texel4[0]), getR32UIPixelData(0, GL_UNSIGNED_INT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
}
/* GL_RG8I */
{
const signed char texel1[2] = { 127, 42 };
const signed char texel2[2] = { 42, -43 };
const signed char texel3[2] = { -43, -127 };
const signed char texel4[2] = { -127, 127 };
/* GL_RG8I => GL_R8I */
addEntryToConversionDatabase(
getRG8IPixelData(1, GL_BYTE, texel1[0], texel1[1]), getR8IPixelData(0, GL_INT, texel1[0]),
getRG8IPixelData(1, GL_BYTE, texel2[0], texel2[1]), getR8IPixelData(0, GL_INT, texel2[0]),
getRG8IPixelData(1, GL_BYTE, texel3[0], texel3[1]), getR8IPixelData(0, GL_INT, texel3[0]),
getRG8IPixelData(1, GL_BYTE, texel4[0], texel4[1]), getR8IPixelData(0, GL_INT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
/* GL_RG8I => GL_RG8I */
addEntryToConversionDatabase(
getRG8IPixelData(1, GL_BYTE, texel1[0], texel1[1]), getRG8IPixelData(0, GL_INT, texel1[0], texel1[1]),
getRG8IPixelData(1, GL_BYTE, texel2[0], texel2[1]), getRG8IPixelData(0, GL_INT, texel2[0], texel2[1]),
getRG8IPixelData(1, GL_BYTE, texel3[0], texel3[1]), getRG8IPixelData(0, GL_INT, texel3[0], texel3[1]),
getRG8IPixelData(1, GL_BYTE, texel4[0], texel4[1]), getRG8IPixelData(0, GL_INT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_RG8UI */
{
const unsigned char texel1[2] = { 255, 127 };
const unsigned char texel2[2] = { 127, 63 };
const unsigned char texel3[2] = { 63, 0 };
const unsigned char texel4[2] = { 0, 255 };
/* GL_RG8UI => GL_R8UI */
addEntryToConversionDatabase(getRG8UIPixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1]),
getR8UIPixelData(0, GL_UNSIGNED_INT, texel1[0]),
getRG8UIPixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1]),
getR8UIPixelData(0, GL_UNSIGNED_INT, texel2[0]),
getRG8UIPixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1]),
getR8UIPixelData(0, GL_UNSIGNED_INT, texel3[0]),
getRG8UIPixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1]),
getR8UIPixelData(0, GL_UNSIGNED_INT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RG8UI => GL_RG8UI */
addEntryToConversionDatabase(getRG8UIPixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1]),
getRG8UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1]),
getRG8UIPixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1]),
getRG8UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1]),
getRG8UIPixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1]),
getRG8UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1]),
getRG8UIPixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1]),
getRG8UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_RG16I */
{
const short texel1[2] = { 32767, 10922 };
const short texel2[2] = { 10922, -10923 };
const short texel3[2] = { -10923, -32767 };
const short texel4[2] = { -32767, 32767 };
/* GL_RG16I => GL_R16I */
addEntryToConversionDatabase(
getRG16IPixelData(1, GL_SHORT, texel1[0], texel1[1]), getR16IPixelData(0, GL_INT, texel1[0]),
getRG16IPixelData(1, GL_SHORT, texel2[0], texel2[1]), getR16IPixelData(0, GL_INT, texel2[0]),
getRG16IPixelData(1, GL_SHORT, texel3[0], texel3[1]), getR16IPixelData(0, GL_INT, texel3[0]),
getRG16IPixelData(1, GL_SHORT, texel4[0], texel4[1]), getR16IPixelData(0, GL_INT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
/* GL_RG16I => GL_RG16I */
addEntryToConversionDatabase(
getRG16IPixelData(1, GL_SHORT, texel1[0], texel1[1]), getRG16IPixelData(0, GL_INT, texel1[0], texel1[1]),
getRG16IPixelData(1, GL_SHORT, texel2[0], texel2[1]), getRG16IPixelData(0, GL_INT, texel2[0], texel2[1]),
getRG16IPixelData(1, GL_SHORT, texel3[0], texel3[1]), getRG16IPixelData(0, GL_INT, texel3[0], texel3[1]),
getRG16IPixelData(1, GL_SHORT, texel4[0], texel4[1]), getRG16IPixelData(0, GL_INT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_RG16UI */
{
const unsigned short texel1[2] = { 65535, 43690 };
const unsigned short texel2[2] = { 43690, 21845 };
const unsigned short texel3[2] = { 21845, 0 };
const unsigned short texel4[2] = { 0, 65535 };
/* GL_RG16UI => GL_R16UI */
addEntryToConversionDatabase(getRG16UIPixelData(1, GL_UNSIGNED_SHORT, texel1[0], texel1[1]),
getR16UIPixelData(0, GL_UNSIGNED_INT, texel1[0]),
getRG16UIPixelData(1, GL_UNSIGNED_SHORT, texel2[0], texel2[1]),
getR16UIPixelData(0, GL_UNSIGNED_INT, texel2[0]),
getRG16UIPixelData(1, GL_UNSIGNED_SHORT, texel3[0], texel3[1]),
getR16UIPixelData(0, GL_UNSIGNED_INT, texel3[0]),
getRG16UIPixelData(1, GL_UNSIGNED_SHORT, texel4[0], texel4[1]),
getR16UIPixelData(0, GL_UNSIGNED_INT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RG16UI => GL_RG16UI */
addEntryToConversionDatabase(getRG16UIPixelData(1, GL_UNSIGNED_SHORT, texel1[0], texel1[1]),
getRG16UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1]),
getRG16UIPixelData(1, GL_UNSIGNED_SHORT, texel2[0], texel2[1]),
getRG16UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1]),
getRG16UIPixelData(1, GL_UNSIGNED_SHORT, texel3[0], texel3[1]),
getRG16UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1]),
getRG16UIPixelData(1, GL_UNSIGNED_SHORT, texel4[0], texel4[1]),
getRG16UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_RG32I */
{
const int texel1[2] = { 2147483647, 715827883l };
const int texel2[2] = { 715827883, -715827881l };
const int texel3[2] = { -715827881, -2147483647l };
const int texel4[2] = { -2147483647, 2147483647l };
/* GL_RG32I => GL_R32I */
addEntryToConversionDatabase(
getRG32IPixelData(1, GL_INT, texel1[0], texel1[1]), getR32IPixelData(0, GL_INT, texel1[0]),
getRG32IPixelData(1, GL_INT, texel2[0], texel2[1]), getR32IPixelData(0, GL_INT, texel2[0]),
getRG32IPixelData(1, GL_INT, texel3[0], texel3[1]), getR32IPixelData(0, GL_INT, texel3[0]),
getRG32IPixelData(1, GL_INT, texel4[0], texel4[1]), getR32IPixelData(0, GL_INT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
/* GL_RG32I => GL_RG32I */
addEntryToConversionDatabase(
getRG32IPixelData(1, GL_INT, texel1[0], texel1[1]), getRG32IPixelData(0, GL_INT, texel1[0], texel1[1]),
getRG32IPixelData(1, GL_INT, texel2[0], texel2[1]), getRG32IPixelData(0, GL_INT, texel2[0], texel2[1]),
getRG32IPixelData(1, GL_INT, texel3[0], texel3[1]), getRG32IPixelData(0, GL_INT, texel3[0], texel3[1]),
getRG32IPixelData(1, GL_INT, texel4[0], texel4[1]), getRG32IPixelData(0, GL_INT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_RG32UI */
{
const unsigned int texel1[2] = { 4294967295u, 2863311530u };
const unsigned int texel2[2] = { 2863311530u, 1431655765u };
const unsigned int texel3[2] = { 1431655765u, 0 };
const unsigned int texel4[2] = { 0, 4294967295u };
/* GL_RG32UI => GL_R32UI */
addEntryToConversionDatabase(getRG32UIPixelData(1, GL_UNSIGNED_INT, texel1[0], texel1[1]),
getR32UIPixelData(0, GL_UNSIGNED_INT, texel1[0]),
getRG32UIPixelData(1, GL_UNSIGNED_INT, texel2[0], texel2[1]),
getR32UIPixelData(0, GL_UNSIGNED_INT, texel2[0]),
getRG32UIPixelData(1, GL_UNSIGNED_INT, texel3[0], texel3[1]),
getR32UIPixelData(0, GL_UNSIGNED_INT, texel3[0]),
getRG32UIPixelData(1, GL_UNSIGNED_INT, texel4[0], texel4[1]),
getR32UIPixelData(0, GL_UNSIGNED_INT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RG32UI => GL_RG32UI */
addEntryToConversionDatabase(getRG32UIPixelData(1, GL_UNSIGNED_INT, texel1[0], texel1[1]),
getRG32UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1]),
getRG32UIPixelData(1, GL_UNSIGNED_INT, texel2[0], texel2[1]),
getRG32UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1]),
getRG32UIPixelData(1, GL_UNSIGNED_INT, texel3[0], texel3[1]),
getRG32UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1]),
getRG32UIPixelData(1, GL_UNSIGNED_INT, texel4[0], texel4[1]),
getRG32UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_RGBA8I */
{
const signed char texel1[4] = { 127, 42, -43, -127 };
const signed char texel2[4] = { 42, -43, -127, 127 };
const signed char texel3[4] = { -43, -127, 127, 42 };
const signed char texel4[4] = { -127, 127, 42, -43 };
/* GL_RGBA8I => GL_R8I */
addEntryToConversionDatabase(getRGBA8IPixelData(1, GL_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getR8IPixelData(0, GL_INT, texel1[0]),
getRGBA8IPixelData(1, GL_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getR8IPixelData(0, GL_INT, texel2[0]),
getRGBA8IPixelData(1, GL_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getR8IPixelData(0, GL_INT, texel3[0]),
getRGBA8IPixelData(1, GL_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getR8IPixelData(0, GL_INT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA8I => GL_RG8I */
addEntryToConversionDatabase(getRGBA8IPixelData(1, GL_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRG8IPixelData(0, GL_INT, texel1[0], texel1[1]),
getRGBA8IPixelData(1, GL_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRG8IPixelData(0, GL_INT, texel2[0], texel2[1]),
getRGBA8IPixelData(1, GL_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRG8IPixelData(0, GL_INT, texel3[0], texel3[1]),
getRGBA8IPixelData(1, GL_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getRG8IPixelData(0, GL_INT, texel4[0], texel4[1]), PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGBA8I => GL_RGB8I */
addEntryToConversionDatabase(getRGBA8IPixelData(1, GL_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB8IPixelData(0, GL_INT, texel1[0], texel1[1], texel1[2]),
getRGBA8IPixelData(1, GL_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB8IPixelData(0, GL_INT, texel2[0], texel2[1], texel2[2]),
getRGBA8IPixelData(1, GL_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB8IPixelData(0, GL_INT, texel3[0], texel3[1], texel3[2]),
getRGBA8IPixelData(1, GL_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB8IPixelData(0, GL_INT, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA8I => GL_RGBA8I */
addEntryToConversionDatabase(getRGBA8IPixelData(1, GL_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA8IPixelData(0, GL_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA8IPixelData(1, GL_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA8IPixelData(0, GL_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA8IPixelData(1, GL_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA8IPixelData(0, GL_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA8IPixelData(1, GL_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGBA8IPixelData(0, GL_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_RGBA8UI */
{
const unsigned char texel1[4] = { 255, 127, 63, 0 };
const unsigned char texel2[4] = { 127, 63, 0, 255 };
const unsigned char texel3[4] = { 63, 0, 255, 127 };
const unsigned char texel4[4] = { 0, 255, 127, 63 };
/* GL_RGBA8UI => GL_R8UI */
addEntryToConversionDatabase(
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getR8UIPixelData(0, GL_UNSIGNED_INT, texel1[0]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getR8UIPixelData(0, GL_UNSIGNED_INT, texel2[0]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getR8UIPixelData(0, GL_UNSIGNED_INT, texel3[0]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getR8UIPixelData(0, GL_UNSIGNED_INT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA8UI => GL_RG8UI */
addEntryToConversionDatabase(
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRG8UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRG8UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRG8UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getRG8UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1]), PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGBA8UI => GL_RGB8UI */
addEntryToConversionDatabase(
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB8UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB8UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB8UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB8UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2]), PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA8UI => GL_RGBA8UI */
addEntryToConversionDatabase(
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA8UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA8UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA8UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA8UIPixelData(1, GL_UNSIGNED_BYTE, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGBA8UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_RGBA16I */
{
const short texel1[4] = { 32767, 10922, -10923, -32767 };
const short texel2[4] = { 10922, -10923, -32767, 32767 };
const short texel3[4] = { -10923, -32767, 32767, 10922 };
const short texel4[4] = { -32767, 32767, 10922, -10923 };
/* GL_RGBA16I => GL_R16I */
addEntryToConversionDatabase(getRGBA16IPixelData(1, GL_SHORT, texel1[0], texel1[1], texel1[2], texel1[3]),
getR16IPixelData(0, GL_INT, texel1[0]),
getRGBA16IPixelData(1, GL_SHORT, texel2[0], texel2[1], texel2[2], texel2[3]),
getR16IPixelData(0, GL_INT, texel2[0]),
getRGBA16IPixelData(1, GL_SHORT, texel3[0], texel3[1], texel3[2], texel3[3]),
getR16IPixelData(0, GL_INT, texel3[0]),
getRGBA16IPixelData(1, GL_SHORT, texel4[0], texel4[1], texel4[2], texel4[3]),
getR16IPixelData(0, GL_INT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA16I => GL_RG16I */
addEntryToConversionDatabase(getRGBA16IPixelData(1, GL_SHORT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRG16IPixelData(0, GL_INT, texel1[0], texel1[1]),
getRGBA16IPixelData(1, GL_SHORT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRG16IPixelData(0, GL_INT, texel2[0], texel2[1]),
getRGBA16IPixelData(1, GL_SHORT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRG16IPixelData(0, GL_INT, texel3[0], texel3[1]),
getRGBA16IPixelData(1, GL_SHORT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRG16IPixelData(0, GL_INT, texel4[0], texel4[1]), PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGBA16I => GL_RGB16I */
addEntryToConversionDatabase(getRGBA16IPixelData(1, GL_SHORT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB16IPixelData(0, GL_INT, texel1[0], texel1[1], texel1[2]),
getRGBA16IPixelData(1, GL_SHORT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB16IPixelData(0, GL_INT, texel2[0], texel2[1], texel2[2]),
getRGBA16IPixelData(1, GL_SHORT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB16IPixelData(0, GL_INT, texel3[0], texel3[1], texel3[2]),
getRGBA16IPixelData(1, GL_SHORT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB16IPixelData(0, GL_INT, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA16I => GL_RGBA16I */
addEntryToConversionDatabase(getRGBA16IPixelData(1, GL_SHORT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA16IPixelData(0, GL_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA16IPixelData(1, GL_SHORT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA16IPixelData(0, GL_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA16IPixelData(1, GL_SHORT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA16IPixelData(0, GL_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA16IPixelData(1, GL_SHORT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGBA16IPixelData(0, GL_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_RGBA16UI */
{
const unsigned short texel1[4] = { 65535, 43690, 21845, 0 };
const unsigned short texel2[4] = { 43690, 21845, 0, 65535 };
const unsigned short texel3[4] = { 21845, 0, 65535, 43690 };
const unsigned short texel4[4] = { 0, 65535, 43690, 21845 };
/* GL_RGBA16UI => GL_R16UI */
addEntryToConversionDatabase(
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel1[0], texel1[1], texel1[2], texel1[3]),
getR16UIPixelData(0, GL_UNSIGNED_INT, texel1[0]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel2[0], texel2[1], texel2[2], texel2[3]),
getR16UIPixelData(0, GL_UNSIGNED_INT, texel2[0]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel3[0], texel3[1], texel3[2], texel3[3]),
getR16UIPixelData(0, GL_UNSIGNED_INT, texel3[0]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel4[0], texel4[1], texel4[2], texel4[3]),
getR16UIPixelData(0, GL_UNSIGNED_INT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA16UI => GL_RG16UI */
addEntryToConversionDatabase(
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRG16UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRG16UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRG16UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRG16UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1]), PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGBA16UI => GL_RGB16UI */
addEntryToConversionDatabase(
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB16UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB16UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB16UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB16UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2]), PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA16UI => GL_RGBA16UI */
addEntryToConversionDatabase(
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA16UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA16UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA16UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA16UIPixelData(1, GL_UNSIGNED_SHORT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGBA16UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_RGBA32I */
{
const int texel1[4] = { 2147483647, 715827883, -715827881, -2147483647 };
const int texel2[4] = { 715827883, -715827881, -2147483647, 2147483647 };
const int texel3[4] = { -715827881, -2147483647, 2147483647, 715827883 };
const int texel4[4] = { -2147483647, 2147483647, 715827883, -715827881 };
/* GL_RGBA32I => GL_R32I */
addEntryToConversionDatabase(getRGBA32IPixelData(GL_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getR32IPixelData(0, GL_INT, texel1[0]),
getRGBA32IPixelData(GL_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getR32IPixelData(0, GL_INT, texel2[0]),
getRGBA32IPixelData(GL_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getR32IPixelData(0, GL_INT, texel3[0]),
getRGBA32IPixelData(GL_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
getR32IPixelData(0, GL_INT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA32I => GL_RG32I */
addEntryToConversionDatabase(getRGBA32IPixelData(GL_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRG32IPixelData(0, GL_INT, texel1[0], texel1[1]),
getRGBA32IPixelData(GL_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRG32IPixelData(0, GL_INT, texel2[0], texel2[1]),
getRGBA32IPixelData(GL_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRG32IPixelData(0, GL_INT, texel3[0], texel3[1]),
getRGBA32IPixelData(GL_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRG32IPixelData(0, GL_INT, texel4[0], texel4[1]), PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGBA32I => GL_RGB32I */
addEntryToConversionDatabase(getRGBA32IPixelData(GL_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB32IPixelData(0, GL_INT, texel1[0], texel1[1], texel1[2]),
getRGBA32IPixelData(GL_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB32IPixelData(0, GL_INT, texel2[0], texel2[1], texel2[2]),
getRGBA32IPixelData(GL_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB32IPixelData(0, GL_INT, texel3[0], texel3[1], texel3[2]),
getRGBA32IPixelData(GL_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB32IPixelData(0, GL_INT, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA32I => GL_RGBA32I */
addEntryToConversionDatabase(getRGBA32IPixelData(GL_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA32IPixelData(GL_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA32IPixelData(GL_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA32IPixelData(GL_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA32IPixelData(GL_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA32IPixelData(GL_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA32IPixelData(GL_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGBA32IPixelData(GL_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_RGBA32UI */
{
const unsigned int texel1[4] = { 4294967295u, 2863311530u, 1431655765u, 0 };
const unsigned int texel2[4] = { 2863311530u, 1431655765u, 0, 4294967295u };
const unsigned int texel3[4] = { 1431655765u, 0, 4294967295u, 2863311530u };
const unsigned int texel4[4] = { 0, 4294967295u, 2863311530u, 1431655765u };
/* GL_RGBA32UI => GL_R32UI */
addEntryToConversionDatabase(getRGBA32UIPixelData(GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getR32UIPixelData(0, GL_UNSIGNED_INT, texel1[0]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getR32UIPixelData(0, GL_UNSIGNED_INT, texel2[0]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getR32UIPixelData(0, GL_UNSIGNED_INT, texel3[0]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
getR32UIPixelData(0, GL_UNSIGNED_INT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA32UI => GL_RG32UI */
addEntryToConversionDatabase(getRGBA32UIPixelData(GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRG32UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRG32UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRG32UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRG32UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGBA32UI => GL_RGB32UI */
addEntryToConversionDatabase(getRGBA32UIPixelData(GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB32UIPixelData(0, GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB32UIPixelData(0, GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB32UIPixelData(0, GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB32UIPixelData(0, GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA32UI => GL_RGBA32UI */
addEntryToConversionDatabase(getRGBA32UIPixelData(GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGBA32UIPixelData(GL_UNSIGNED_INT, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_R16F */
{
const float texel1[1] = { 1 };
const float texel2[1] = { 4096 };
const float texel3[1] = { -4096 };
const float texel4[1] = { 32000 };
/* GL_R16F => GL_R16F */
addEntryToConversionDatabase(
getR16FPixelData(1, GL_HALF_FLOAT, texel1[0]), getR16FPixelData(0, GL_HALF_FLOAT, texel1[0]),
getR16FPixelData(1, GL_HALF_FLOAT, texel2[0]), getR16FPixelData(0, GL_HALF_FLOAT, texel2[0]),
getR16FPixelData(1, GL_HALF_FLOAT, texel3[0]), getR16FPixelData(0, GL_HALF_FLOAT, texel3[0]),
getR16FPixelData(1, GL_HALF_FLOAT, texel4[0]), getR16FPixelData(0, GL_HALF_FLOAT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
}
/* GL_RG16F */
{
const float texel1[2] = { 1, 0 };
const float texel2[2] = { 4096, -4096 };
const float texel3[2] = { -32000, 32000 };
const float texel4[2] = { 1.5f, -4.7f };
/* GL_RG16F => GL_R16F */
addEntryToConversionDatabase(
getRG16FPixelData(1, GL_HALF_FLOAT, texel1[0], texel1[1]), getR16FPixelData(0, GL_HALF_FLOAT, texel1[0]),
getRG16FPixelData(1, GL_HALF_FLOAT, texel2[0], texel2[1]), getR16FPixelData(0, GL_HALF_FLOAT, texel2[0]),
getRG16FPixelData(1, GL_HALF_FLOAT, texel3[0], texel3[1]), getR16FPixelData(0, GL_HALF_FLOAT, texel3[0]),
getRG16FPixelData(1, GL_HALF_FLOAT, texel4[0], texel4[1]), getR16FPixelData(0, GL_HALF_FLOAT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
/* GL_RG16F => GL_RG16F */
addEntryToConversionDatabase(getRG16FPixelData(1, GL_HALF_FLOAT, texel1[0], texel1[1]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel1[0], texel1[1]),
getRG16FPixelData(1, GL_HALF_FLOAT, texel2[0], texel2[1]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel2[0], texel2[1]),
getRG16FPixelData(1, GL_HALF_FLOAT, texel3[0], texel3[1]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel3[0], texel3[1]),
getRG16FPixelData(1, GL_HALF_FLOAT, texel4[0], texel4[1]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_R32F */
{
const float texel1[1] = { 1 };
const float texel2[1] = { 4096 };
const float texel3[1] = { -4096 };
const float texel4[1] = { 32000 };
/* GL_R32F => GL_R32F */
addEntryToConversionDatabase(getR32FPixelData(1, GL_FLOAT, texel1[0]), getR32FPixelData(0, GL_FLOAT, texel1[0]),
getR32FPixelData(1, GL_FLOAT, texel2[0]), getR32FPixelData(0, GL_FLOAT, texel2[0]),
getR32FPixelData(1, GL_FLOAT, texel3[0]), getR32FPixelData(0, GL_FLOAT, texel3[0]),
getR32FPixelData(1, GL_FLOAT, texel4[0]), getR32FPixelData(0, GL_FLOAT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
}
/* GL_RG32F */
{
const float texel1[2] = { 1, 0 };
const float texel2[2] = { 4096, -4096 };
const float texel3[2] = { -32000, 32000 };
const float texel4[2] = { 1.5f, -4.7f };
/* GL_RG32F => GL_R32F */
addEntryToConversionDatabase(
getRG32FPixelData(1, GL_FLOAT, texel1[0], texel1[1]), getR32FPixelData(0, GL_FLOAT, texel1[0]),
getRG32FPixelData(1, GL_FLOAT, texel2[0], texel2[1]), getR32FPixelData(0, GL_FLOAT, texel2[0]),
getRG32FPixelData(1, GL_FLOAT, texel3[0], texel3[1]), getR32FPixelData(0, GL_FLOAT, texel3[0]),
getRG32FPixelData(1, GL_FLOAT, texel4[0], texel4[1]), getR32FPixelData(0, GL_FLOAT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
/* GL_RG32F => GL_RG32F */
addEntryToConversionDatabase(
getRG32FPixelData(1, GL_FLOAT, texel1[0], texel1[1]), getRG32FPixelData(0, GL_FLOAT, texel1[0], texel1[1]),
getRG32FPixelData(1, GL_FLOAT, texel2[0], texel2[1]), getRG32FPixelData(0, GL_FLOAT, texel2[0], texel2[1]),
getRG32FPixelData(1, GL_FLOAT, texel3[0], texel3[1]), getRG32FPixelData(0, GL_FLOAT, texel3[0], texel3[1]),
getRG32FPixelData(1, GL_FLOAT, texel4[0], texel4[1]), getRG32FPixelData(0, GL_FLOAT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
}
/* GL_RGB16F */
{
const float texel1[3] = { 1, 0, -1 };
const float texel2[3] = { 4096, -4096, 127.5f };
const float texel3[3] = { -32000, 32000, -456.7f };
const float texel4[3] = { 1.5f, -4.7f, 123.6f };
/* GL_RGB16F => GL_R16F */
addEntryToConversionDatabase(getRGB16FPixelData(1, GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2]),
getR16FPixelData(0, GL_HALF_FLOAT, texel1[0]),
getRGB16FPixelData(1, GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2]),
getR16FPixelData(0, GL_HALF_FLOAT, texel2[0]),
getRGB16FPixelData(1, GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2]),
getR16FPixelData(0, GL_HALF_FLOAT, texel3[0]),
getRGB16FPixelData(1, GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2]),
getR16FPixelData(0, GL_HALF_FLOAT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGB16F => GL_RG16F */
addEntryToConversionDatabase(getRGB16FPixelData(1, GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel1[0], texel1[1]),
getRGB16FPixelData(1, GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel2[0], texel2[1]),
getRGB16FPixelData(1, GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel3[0], texel3[1]),
getRGB16FPixelData(1, GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGB16F => GL_RGB16F */
addEntryToConversionDatabase(getRGB16FPixelData(1, GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2]),
getRGB16FPixelData(0, GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2]),
getRGB16FPixelData(1, GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2]),
getRGB16FPixelData(0, GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2]),
getRGB16FPixelData(1, GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2]),
getRGB16FPixelData(0, GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2]),
getRGB16FPixelData(1, GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2]),
getRGB16FPixelData(0, GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
}
/* GL_RGBA16F */
{
const float texel1[4] = { 1, 0, -1, 0.25f };
const float texel2[4] = { 4096, -4096, 127.5f, 0.5f };
const float texel3[4] = { -32000, 32000, -456.7f, 0.75f };
const float texel4[4] = { 1.5f, -4.7f, 123.6f, 1 };
/* GL_RGBA16F => GL_R16F */
addEntryToConversionDatabase(getRGBA16FPixelData(GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getR16FPixelData(0, GL_HALF_FLOAT, texel1[0]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getR16FPixelData(0, GL_HALF_FLOAT, texel2[0]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getR16FPixelData(0, GL_HALF_FLOAT, texel3[0]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
getR16FPixelData(0, GL_HALF_FLOAT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA16F => GL_RG16F */
addEntryToConversionDatabase(getRGBA16FPixelData(GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel1[0], texel1[1]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel2[0], texel2[1]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel3[0], texel3[1]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRG16FPixelData(0, GL_HALF_FLOAT, texel4[0], texel4[1]),
PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGBA16F => GL_RGB16F */
addEntryToConversionDatabase(getRGBA16FPixelData(GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB16FPixelData(0, GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB16FPixelData(0, GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB16FPixelData(0, GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB16FPixelData(0, GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA16F => GL_RGBA16F */
addEntryToConversionDatabase(getRGBA16FPixelData(GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGBA16FPixelData(GL_HALF_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
/* GL_RGB32F */
{
const float texel1[3] = { 1, 0, -1 };
const float texel2[3] = { 4096, -4096, 127.5f };
const float texel3[3] = { -32000, 32000, -456.7f };
const float texel4[3] = { 1.5f, -4.7f, 123.6f };
/* GL_RGB32F => GL_R32F */
addEntryToConversionDatabase(
getRGB32FPixelData(1, GL_FLOAT, texel1[0], texel1[1], texel1[2]), getR32FPixelData(0, GL_FLOAT, texel1[0]),
getRGB32FPixelData(1, GL_FLOAT, texel2[0], texel2[1], texel2[2]), getR32FPixelData(0, GL_FLOAT, texel2[0]),
getRGB32FPixelData(1, GL_FLOAT, texel3[0], texel3[1], texel3[2]), getR32FPixelData(0, GL_FLOAT, texel3[0]),
getRGB32FPixelData(1, GL_FLOAT, texel4[0], texel4[1], texel4[2]), getR32FPixelData(0, GL_FLOAT, texel4[0]),
PIXEL_COMPARE_CHANNEL_R);
/* GL_RGB32F => GL_RG32F */
addEntryToConversionDatabase(getRGB32FPixelData(1, GL_FLOAT, texel1[0], texel1[1], texel1[2]),
getRG32FPixelData(0, GL_FLOAT, texel1[0], texel1[1]),
getRGB32FPixelData(1, GL_FLOAT, texel2[0], texel2[1], texel2[2]),
getRG32FPixelData(0, GL_FLOAT, texel2[0], texel2[1]),
getRGB32FPixelData(1, GL_FLOAT, texel3[0], texel3[1], texel3[2]),
getRG32FPixelData(0, GL_FLOAT, texel3[0], texel3[1]),
getRGB32FPixelData(1, GL_FLOAT, texel4[0], texel4[1], texel4[2]),
getRG32FPixelData(0, GL_FLOAT, texel4[0], texel4[1]), PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGB32F => GL_RGB32F */
addEntryToConversionDatabase(getRGB32FPixelData(1, GL_FLOAT, texel1[0], texel1[1], texel1[2]),
getRGB32FPixelData(0, GL_FLOAT, texel1[0], texel1[1], texel1[2]),
getRGB32FPixelData(1, GL_FLOAT, texel2[0], texel2[1], texel2[2]),
getRGB32FPixelData(0, GL_FLOAT, texel2[0], texel2[1], texel2[2]),
getRGB32FPixelData(1, GL_FLOAT, texel3[0], texel3[1], texel3[2]),
getRGB32FPixelData(0, GL_FLOAT, texel3[0], texel3[1], texel3[2]),
getRGB32FPixelData(1, GL_FLOAT, texel4[0], texel4[1], texel4[2]),
getRGB32FPixelData(0, GL_FLOAT, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
}
/* GL_RGBA32F */
{
const float texel1[4] = { 1, 0, -1, 0.25f };
const float texel2[4] = { 4096, -4096, 127.5f, 0.5f };
const float texel3[4] = { -32000, 32000, -456.7f, 0.75f };
const float texel4[4] = { 1.5f, -4.7f, 123.6f, 1 };
/* GL_RGBA32F => GL_R32F */
addEntryToConversionDatabase(getRGBA32FPixelData(GL_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getR32FPixelData(0, GL_FLOAT, texel1[0]),
getRGBA32FPixelData(GL_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getR32FPixelData(0, GL_FLOAT, texel2[0]),
getRGBA32FPixelData(GL_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getR32FPixelData(0, GL_FLOAT, texel3[0]),
getRGBA32FPixelData(GL_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
getR32FPixelData(0, GL_FLOAT, texel4[0]), PIXEL_COMPARE_CHANNEL_R);
/* GL_RGBA32F => GL_RG32F */
addEntryToConversionDatabase(getRGBA32FPixelData(GL_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRG32FPixelData(0, GL_FLOAT, texel1[0], texel1[1]),
getRGBA32FPixelData(GL_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRG32FPixelData(0, GL_FLOAT, texel2[0], texel2[1]),
getRGBA32FPixelData(GL_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRG32FPixelData(0, GL_FLOAT, texel3[0], texel3[1]),
getRGBA32FPixelData(GL_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRG32FPixelData(0, GL_FLOAT, texel4[0], texel4[1]), PIXEL_COMPARE_CHANNEL_RG);
/* GL_RGBA32F => GL_RGB32F */
addEntryToConversionDatabase(getRGBA32FPixelData(GL_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGB32FPixelData(0, GL_FLOAT, texel1[0], texel1[1], texel1[2]),
getRGBA32FPixelData(GL_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGB32FPixelData(0, GL_FLOAT, texel2[0], texel2[1], texel2[2]),
getRGBA32FPixelData(GL_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGB32FPixelData(0, GL_FLOAT, texel3[0], texel3[1], texel3[2]),
getRGBA32FPixelData(GL_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGB32FPixelData(0, GL_FLOAT, texel4[0], texel4[1], texel4[2]),
PIXEL_COMPARE_CHANNEL_RGB);
/* GL_RGBA32F => GL_RGBA32F */
addEntryToConversionDatabase(getRGBA32FPixelData(GL_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA32FPixelData(GL_FLOAT, texel1[0], texel1[1], texel1[2], texel1[3]),
getRGBA32FPixelData(GL_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA32FPixelData(GL_FLOAT, texel2[0], texel2[1], texel2[2], texel2[3]),
getRGBA32FPixelData(GL_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA32FPixelData(GL_FLOAT, texel3[0], texel3[1], texel3[2], texel3[3]),
getRGBA32FPixelData(GL_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
getRGBA32FPixelData(GL_FLOAT, texel4[0], texel4[1], texel4[2], texel4[3]),
PIXEL_COMPARE_CHANNEL_RGBA);
}
}
class TestBase : public deqp::TestCase
{
public:
TestBase(deqp::Context& context, GLenum source_attachment_type, GLenum destination_attachment_type);
virtual ~TestBase();
protected:
bool getFormatAndTypeCompatibleWithInternalformat(GLenum internalformat, int index, GLenum* out_format,
GLenum* out_type) const;
bool getFormatForInternalformat(GLenum internalformat, GLenum* out_format) const;
GLenum getFBOEffectiveInternalFormatAtIndex(unsigned int index) const;
GLenum getCopyTexImage2DInternalFormatAtIndex(unsigned int index) const;
const char* getTargetName(GLenum target) const;
GLenum getGeneralTargetForDetailedTarget(GLenum target);
GLuint generateGLObject(GLenum object_type);
bool configureGLObject(int is_source_gl_object, GLenum object_target, GLint object_id, GLenum internal_format,
GLenum format, GLenum type, void* data);
void destroyGLObject(GLenum target, GLuint object_id);
bool isValidRBOInternalFormat(GLenum internalformat) const;
bool isColorRenderableInternalFormat(GLenum internalformat) const;
bool isDepthRenderableInternalFormat(GLenum internalformat) const;
bool isDepthStencilRenderableInternalFormat(GLenum internalformat) const;
bool isFBOEffectiveInternalFormatCompatibleWithDestinationInternalFormat(GLenum src_internalformat,
GLenum dst_internalformat) const;
const char* getInternalformatString(GLenum internalformat);
protected:
GLenum m_source_attachment_type;
GLenum m_destination_attachment_type;
};
TestBase::TestBase(deqp::Context& context, GLenum source_attachment_type, GLenum destination_attachment_type)
: deqp::TestCase(context, "", "")
, m_source_attachment_type(source_attachment_type)
, m_destination_attachment_type(destination_attachment_type)
{
static std::map<GLenum, std::string> attachment_name_map;
if (attachment_name_map.empty())
{
attachment_name_map[GL_TEXTURE_2D] = "texture2d";
attachment_name_map[GL_TEXTURE_CUBE_MAP_NEGATIVE_X] = "cubemap_negx";
attachment_name_map[GL_TEXTURE_CUBE_MAP_NEGATIVE_Y] = "cubemap_negy";
attachment_name_map[GL_TEXTURE_CUBE_MAP_NEGATIVE_Z] = "cubemap_negz";
attachment_name_map[GL_TEXTURE_CUBE_MAP_POSITIVE_X] = "cubemap_posx";
attachment_name_map[GL_TEXTURE_CUBE_MAP_POSITIVE_Y] = "cubemap_posy";
attachment_name_map[GL_TEXTURE_CUBE_MAP_POSITIVE_Z] = "cubemap_posz";
attachment_name_map[GL_TEXTURE_2D_ARRAY] = "texture_array";
attachment_name_map[GL_TEXTURE_3D] = "texture3d";
attachment_name_map[GL_RENDERBUFFER] = "renderbuffer";
};
m_name = attachment_name_map[m_source_attachment_type] + "_" + attachment_name_map[m_destination_attachment_type];
}
TestBase::~TestBase()
{
}
/** For every valid GLES internalformat, gl.readPixels() can often work with a variety of different
* format+type combinations. This function allows to enumerate valid pairs for user-specified
* internal formats.
*
* Enumeration should start from 0 and continue until the function starts reporting failure.
*
* @param internalformat GLES internal format to consider.
* @param index Index of format+type pair to look up.
* @param out_format Deref will be used to store compatible GLES format. Cannot be NULL.
* @param out_type Deref will be used to store compatible GLES type. Cannot be NULL.
*
* @return true if successful and relevant format & type information has been stored under
* dereferences of corresponding arguments, false otherwise.
**/
bool TestBase::getFormatAndTypeCompatibleWithInternalformat(GLenum internalformat, int index, GLenum* out_format,
GLenum* out_type) const
{
const glu::ContextInfo& contextInfo = m_context.getContextInfo();
bool is_ext_texture_storage_supported = contextInfo.isExtensionSupported("GL_EXT_texture_storage");
bool is_ext_texture_type_2_10_10_10_rev_supported =
contextInfo.isExtensionSupported("GL_EXT_texture_type_2_10_10_10_REV");
DE_ASSERT(out_format != NULL);
DE_ASSERT(out_type != NULL);
if (!getFormatForInternalformat(internalformat, out_format))
TCU_FAIL("No format known for requested internalformat");
switch (internalformat)
{
case GL_ALPHA:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_LUMINANCE:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_R8:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_LUMINANCE_ALPHA:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_RG8:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_SRGB:
case GL_RGB:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else if (index == 1)
*out_type = GL_UNSIGNED_SHORT_5_6_5;
else if (index == 2)
*out_type = GL_UNSIGNED_INT_2_10_10_10_REV;
else if (index == 3)
*out_type = GL_HALF_FLOAT;
else if (index == 4)
*out_type = GL_FLOAT;
else
return false;
break;
}
case GL_SRGB8:
case GL_RGB8:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_RGB565:
{
if (index == 0)
*out_type = GL_UNSIGNED_SHORT_5_6_5;
else if (index == 1)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_RGBA:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else if (index == 1)
*out_type = GL_UNSIGNED_SHORT_4_4_4_4;
else if (index == 2)
*out_type = GL_UNSIGNED_SHORT_5_5_5_1;
else if (index == 3)
*out_type = GL_HALF_FLOAT;
else if (index == 4)
*out_type = GL_FLOAT;
else
return false;
break;
}
case GL_RGBA4:
{
if (index == 0)
*out_type = GL_UNSIGNED_SHORT_4_4_4_4;
else if (index == 1)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_RGB5_A1:
{
if (index == 0)
*out_type = GL_UNSIGNED_SHORT_5_5_5_1;
else if (index == 1)
*out_type = GL_UNSIGNED_BYTE;
else if (index == 2)
*out_type = GL_UNSIGNED_INT_2_10_10_10_REV;
else
return false;
break;
}
case GL_RGBA8:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_RGB10_A2:
{
if (index == 0)
*out_type = GL_UNSIGNED_INT_2_10_10_10_REV;
else
return false;
break;
}
case GL_RGB10_A2UI:
{
if (index == 0)
{
*out_type = GL_UNSIGNED_INT_2_10_10_10_REV;
} /* if (index == 0) */
else
{
return false;
}
break;
}
case GL_SRGB8_ALPHA8:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_R8I:
{
if (index == 0)
*out_type = GL_BYTE;
else
return false;
break;
}
case GL_R8UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_R16I:
{
if (index == 0)
*out_type = GL_SHORT;
else
return false;
break;
}
case GL_R16UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_SHORT;
else
return false;
break;
}
case GL_R32I:
{
if (index == 0)
*out_type = GL_INT;
else
return false;
break;
}
case GL_R32UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_INT;
else
return false;
break;
}
case GL_RG8I:
{
if (index == 0)
*out_type = GL_BYTE;
else
return false;
break;
}
case GL_RG8UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_RG16I:
{
if (index == 0)
*out_type = GL_SHORT;
else
return false;
break;
}
case GL_RG16UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_SHORT;
else
return false;
break;
}
case GL_RG32I:
{
if (index == 0)
*out_type = GL_INT;
else
return false;
break;
}
case GL_RG32UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_INT;
else
return false;
break;
}
case GL_RGB8I:
{
if (index == 0)
*out_type = GL_BYTE;
else
return false;
break;
}
case GL_RGB8UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_RGB16I:
{
if (index == 0)
*out_type = GL_SHORT;
else
return false;
break;
}
case GL_RGB16UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_SHORT;
else
return false;
break;
}
case GL_RGB32I:
{
if (index == 0)
*out_type = GL_INT;
else
return false;
break;
}
case GL_RGB32UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_INT;
else
return false;
break;
}
case GL_RGBA8I:
{
if (index == 0)
*out_type = GL_BYTE;
else
return false;
break;
}
case GL_RGBA8UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_BYTE;
else
return false;
break;
}
case GL_RGBA16I:
{
if (index == 0)
*out_type = GL_SHORT;
else
return false;
break;
}
case GL_RGBA16UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_SHORT;
else
return false;
break;
}
case GL_RGBA32I:
{
if (index == 0)
*out_type = GL_INT;
else
return false;
break;
}
case GL_RGBA32UI:
{
if (index == 0)
*out_type = GL_UNSIGNED_INT;
else
return false;
break;
}
case GL_R16F:
{
if (index == 0)
*out_type = GL_HALF_FLOAT;
else
return false;
break;
}
case GL_RG16F:
{
if (index == 0)
*out_type = GL_HALF_FLOAT;
else
return false;
break;
}
case GL_R32F:
{
if (index == 0)
*out_type = GL_FLOAT;
else
return false;
break;
}
case GL_RG32F:
{
if (index == 0)
*out_type = GL_FLOAT;
else
return false;
break;
}
case GL_RGB16F:
{
if (index == 0)
*out_type = GL_HALF_FLOAT;
else
return false;
break;
}
case GL_RGBA16F:
{
if (index == 0)
*out_type = GL_HALF_FLOAT;
else
return false;
break;
}
case GL_RGB32F:
{
if (index == 0)
*out_type = GL_FLOAT;
else
return false;
break;
}
case GL_RGBA32F:
{
if (index == 0)
*out_type = GL_FLOAT;
else
return false;
break;
}
case GL_RGB10_EXT:
{
if (index == 0)
{
if (is_ext_texture_type_2_10_10_10_rev_supported && is_ext_texture_storage_supported)
{
*out_type = GL_UNSIGNED_INT_2_10_10_10_REV;
} /* if (is_ext_texture_type_2_10_10_10_rev_supported) */
else
{
return false;
}
} /* if (index == 0) */
else
{
return false;
}
break;
}
case GL_ALPHA8_EXT:
{
// TODO: No extension available at the time of writing.
return false;
}
case GL_LUMINANCE8_EXT:
{
// TODO: No extension available at the time of writing.
return false;
}
case GL_LUMINANCE8_ALPHA8_EXT:
{
// TODO: No extension available at the time of writing.
return false;
}
default:
{
TCU_FAIL("Unsupported internalformat");
}
} // switch (internalformat)
return true;
}
/** Retrieves GLES format compatible for user-specified GLES internal format.
*
* @param internalformat GLES internalformat to consider.
* @param out_format Deref will be used to store the result. Cannot be NULL.
*
* @return true if successful, false otherwise.
**/
bool TestBase::getFormatForInternalformat(GLenum internalformat, GLenum* out_format) const
{
DE_ASSERT(out_format != NULL);
// Find out the format for user-provided internalformat
switch (internalformat)
{
case GL_ALPHA:
*out_format = GL_ALPHA;
break;
case GL_LUMINANCE_ALPHA:
*out_format = GL_LUMINANCE_ALPHA;
break;
case GL_LUMINANCE:
case GL_LUMINANCE8_OES:
*out_format = GL_LUMINANCE;
break;
case GL_R8:
case GL_R8_SNORM:
case GL_R16F:
case GL_R32F:
*out_format = GL_RED;
break;
case GL_R8UI:
case GL_R8I:
case GL_R16UI:
case GL_R16I:
case GL_R32UI:
case GL_R32I:
*out_format = GL_RED_INTEGER;
break;
case GL_RG8:
case GL_RG8_SNORM:
case GL_RG16F:
case GL_RG32F:
*out_format = GL_RG;
break;
case GL_RG8UI:
case GL_RG8I:
case GL_RG16UI:
case GL_RG16I:
case GL_RG32UI:
case GL_RG32I:
*out_format = GL_RG_INTEGER;
break;
case GL_RGB:
case GL_RGB8:
case GL_SRGB8:
case GL_RGB565:
case GL_RGB8_SNORM:
case GL_R11F_G11F_B10F:
case GL_RGB9_E5:
case GL_RGB16F:
case GL_RGB32F:
*out_format = GL_RGB;
break;
case GL_RGB8UI:
case GL_RGB8I:
case GL_RGB16UI:
case GL_RGB16I:
case GL_RGB32UI:
case GL_RGB32I:
*out_format = GL_RGB_INTEGER;
break;
case GL_RGBA:
case GL_RGBA8:
case GL_SRGB8_ALPHA8:
case GL_RGBA8_SNORM:
case GL_RGB5_A1:
case GL_RGBA4:
case GL_RGB10_A2:
case GL_RGBA16F:
case GL_RGBA32F:
*out_format = GL_RGBA;
break;
case GL_RGBA8UI:
case GL_RGBA8I:
case GL_RGB10_A2UI:
case GL_RGBA16UI:
case GL_RGBA16I:
case GL_RGBA32I:
case GL_RGBA32UI:
*out_format = GL_RGBA_INTEGER;
break;
case GL_DEPTH_COMPONENT16:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32F:
*out_format = GL_DEPTH_COMPONENT;
break;
case GL_DEPTH24_STENCIL8:
case GL_DEPTH32F_STENCIL8:
*out_format = GL_DEPTH_STENCIL;
break;
default:
TCU_FAIL("Internalformat not recognized");
return false;
} // switch (internalformat)
return true;
}
/** Retrieves FBO effective internal format at user-specified index.
*
* Pays extra care not to reach outside of fbo_effective_internal_format_ordering array.
*
* @param index Index to look up the internal format at.
*
* @return Requested information or GL_NONE if failed or 0xFFFFFFFF if index is
* outside allowed range.
**/
GLenum TestBase::getFBOEffectiveInternalFormatAtIndex(unsigned int index) const
{
const unsigned int n_effective_internalformats = DE_LENGTH_OF_ARRAY(fboEffectiveInternalFormatOrdering);
DE_ASSERT(index < n_effective_internalformats);
if (index < n_effective_internalformats)
return fboEffectiveInternalFormatOrdering[index];
// Return glitch
m_testCtx.getLog() << tcu::TestLog::Message
<< "GetFBOEffectiveInternalFormatAtIndex - Invalid index requested: " << index
<< tcu::TestLog::EndMessage;
return static_cast<GLenum>(0xFFFFFFFF);
}
/** Retrieves glCopyTexImage2D() internal format at user-specified index.
*
* Pays extra care not to reach outside of copy_tex_image_2d_internal_format_orderingarray.
*
* @param index Index to look up the internal format at.
*
* @return Requested information or GL_NONE if failed or 0xFFFFFFFF if index is outside
* allowed range.
**/
GLenum TestBase::getCopyTexImage2DInternalFormatAtIndex(unsigned int index) const
{
const unsigned int n_internalformats = DE_LENGTH_OF_ARRAY(copyTexImage2DInternalFormatOrdering);
DE_ASSERT(index < n_internalformats);
if (index < n_internalformats)
return copyTexImage2DInternalFormatOrdering[index];
// Return glitch
m_testCtx.getLog() << tcu::TestLog::Message
<< "GetCopyTexImage2DInternalFormatAtIndex - Invalid index requested: " << index
<< tcu::TestLog::EndMessage;
return static_cast<GLenum>(0xFFFFFFFF);
}
/** Retrieves a string representing name of target passed by argument.
*
* @param target GLES target to retrieve a string for.
*
* @return A relevant string or "?" (without double quotation marks)
* if type is unrecognized.
**/
const char* TestBase::getTargetName(GLenum target) const
{
const char* result = "?";
switch (target)
{
case GL_RENDERBUFFER:
result = "GL_RENDERBUFFER";
break;
case GL_TEXTURE_2D:
result = "GL_TEXTURE_2D";
break;
case GL_TEXTURE_2D_ARRAY:
result = "GL_TEXTURE_2D_ARRAY";
break;
case GL_TEXTURE_3D:
result = "GL_TEXTURE_3D";
break;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
result = "GL_TEXTURE_CUBE_MAP_NEGATIVE_X";
break;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
result = "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y";
break;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
result = "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z";
break;
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
result = "GL_TEXTURE_CUBE_MAP_POSITIVE_X";
break;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
result = "GL_TEXTURE_CUBE_MAP_POSITIVE_Y";
break;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
result = "GL_TEXTURE_CUBE_MAP_POSITIVE_Z";
break;
}
return result;
}
/** Returns a general texture target for cube-map texture targets or
* user-specified target otherwise.
*
* @param target GLES target to consider. Allowed values:
* 1) GL_RENDERBUFFER,
* 2) GL_TEXTURE_2D,
* 3) GL_TEXTURE_2D_ARRAY,
* 4) GL_TEXTURE_3D,
* 5) GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
* 6) GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
* 7) GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
* 8) GL_TEXTURE_CUBE_MAP_POSITIVE_X,
* 9) GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
* 10) GL_TEXTURE_CUBE_MAP_POSITIVE_Z.
*
* @return General texture target or used-specified target
* if successful, GL_NONE otherwise.
*/
GLenum TestBase::getGeneralTargetForDetailedTarget(GLenum target)
{
GLenum result = GL_NONE;
switch (target)
{
case GL_RENDERBUFFER:
case GL_TEXTURE_2D:
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_3D:
{
result = target;
break;
} // renderbuffer & 2D/3D texture targets
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
{
result = GL_TEXTURE_CUBE_MAP;
break;
} // cube-map texture targets
default:
{
TCU_FAIL("Unrecognized target");
}
}
return result;
}
/** Generates a GL object of an user-requested type.
*
* NOTE: It is expected no error is reported by OpenGL ES prior to
* the call.
*
* @param object_type Type of a GL object to create. Allowed values:
* 1) GL_RENDERBUFFER,
* 2) GL_TEXTURE_2D,
* 3) GL_TEXTURE_2D_ARRAY,
* 4) GL_TEXTURE_3D,
* 5) GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
* 6) GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
* 7) GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
* 8) GL_TEXTURE_CUBE_MAP_POSITIVE_X,
* 9) GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
* 10) GL_TEXTURE_CUBE_MAP_POSITIVE_Z.
*
* @return GLES ID (different than zero) of the created object if
* successful, zero otherwise.
*/
GLuint TestBase::generateGLObject(GLenum object_type)
{
const Functions& gl = m_context.getRenderContext().getFunctions();
GLenum error_code = GL_NO_ERROR;
GLuint result = 0;
switch (object_type)
{
case GL_RENDERBUFFER:
{
gl.genRenderbuffers(1, &result);
break;
}
case GL_TEXTURE_2D:
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_3D:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
{
gl.genTextures(1, &result);
break;
}
default:
TCU_FAIL("Unsupported source attachment type");
}
// check if all is good with our new object
error_code = gl.getError();
if (error_code != GL_NO_ERROR)
{
m_testCtx.getLog() << tcu::TestLog::Message
<< "Could not generate a renderbuffer OR texture object. GL reported error: [" << error_code
<< "]" << tcu::TestLog::EndMessage;
return 0;
}
return result;
}
/** Sets up a GL object and binds it to either GL_DRAW_FRAMEBUFFER
* (if @param is_source_gl_object is 0) or GL_READ_FRAMEBUFFER zeroth
* color attachment.
*
* NOTE: The function assumes the object at @param object_id of @param
* object_target type has already been generated!
*
* @param is_source_gl_object 1 if the object should be bound to
* GL_DRAW_FRAMEBUFFER target once configured,
* 0 to bound the object to GL_READ_FRAMEBUFFER
* target instead.
* @param object_target Type of the object to configure. Allowed values:
* 1) GL_RENDERBUFFER,
* 2) GL_TEXTURE_2D,
* 3) GL_TEXTURE_2D_ARRAY,
* 4) GL_TEXTURE_3D,
* 5) GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
* 6) GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
* 7) GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
* 8) GL_TEXTURE_CUBE_MAP_POSITIVE_X,
* 9) GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
* 10) GL_TEXTURE_CUBE_MAP_POSITIVE_Z.
* @param object_id GLES ID of the object to configure.
* @param internal_format Internal-format of the data under @param data.
* @param format Format of the data under @param data.
* @param type Type the data @param data is represented with.
* @param data Buffer with the data to fill the object with.
* Cannot be NULL.
*
* @return true if successful, false otherwise.,
**/
bool TestBase::configureGLObject(int is_source_gl_object, GLenum object_target, GLint object_id, GLenum internal_format,
GLenum format, GLenum type, void* data)
{
const Functions& gl = m_context.getRenderContext().getFunctions();
GLenum fbo_target = (is_source_gl_object == 0) ? GL_DRAW_FRAMEBUFFER : GL_READ_FRAMEBUFFER;
bool result = true;
// Special case for GL_HALF_FLOAT -> input data is in GL_FLOAT
if (type == GL_HALF_FLOAT)
type = GL_FLOAT;
switch (object_target)
{
case GL_RENDERBUFFER:
{
GLint current_draw_fbo_id = 0;
GLint current_read_fbo_id = 0;
GLuint temporary_draw_fbo_id = 0;
GLuint temporary_read_fbo_id = 0;
GLuint temporary_to_id = 0;
// Retrieve current draw/read fbo bindings
gl.getIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_draw_fbo_id);
gl.getIntegerv(GL_READ_FRAMEBUFFER_BINDING, ¤t_read_fbo_id);
// Set up the RBO */
gl.bindRenderbuffer(GL_RENDERBUFFER, object_id);
gl.renderbufferStorage(GL_RENDERBUFFER, internal_format, TEXTURE_WIDTH, TEXTURE_HEIGHT);
// Generate a temporary 2D texture object and copy the data into it
gl.genTextures(1, &temporary_to_id);
gl.bindTexture(GL_TEXTURE_2D, temporary_to_id);
gl.texImage2D(GL_TEXTURE_2D, 0 /* level */, internal_format, TEXTURE_WIDTH, TEXTURE_HEIGHT, 0 /* border */,
format, type, data);
// Set up a temporary read FBO with the texture object attached to zeroth color attachment..
gl.genFramebuffers(1, &temporary_read_fbo_id);
gl.bindFramebuffer(GL_READ_FRAMEBUFFER, temporary_read_fbo_id);
gl.framebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, temporary_to_id,
0 /* level */);
// and another one we'll bind to draw framebuffer target with the renderbuffer object attached
gl.genFramebuffers(1, &temporary_draw_fbo_id);
gl.bindFramebuffer(GL_DRAW_FRAMEBUFFER, temporary_draw_fbo_id);
gl.framebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, object_id);
// Blit the texture contents into the renderbuffer.
gl.blitFramebuffer(0 /* srcX0 */, 0 /* srcY0 */, TEXTURE_WIDTH, TEXTURE_HEIGHT, 0 /* dstX0 */, 0 /* dstY0 */,
TEXTURE_WIDTH, TEXTURE_HEIGHT, GL_COLOR_BUFFER_BIT, GL_NEAREST);
// Restore pre-call configuration
gl.bindFramebuffer(GL_DRAW_FRAMEBUFFER, current_draw_fbo_id);
gl.bindFramebuffer(GL_READ_FRAMEBUFFER, current_read_fbo_id);
// Get rid of the temporary objects
gl.bindTexture(GL_TEXTURE_2D, 0);
gl.deleteTextures(1, &temporary_to_id);
gl.deleteFramebuffers(1, &temporary_draw_fbo_id);
gl.deleteFramebuffers(1, &temporary_read_fbo_id);
// Update the pre-call framebuffer's attachment configuration
gl.framebufferRenderbuffer(fbo_target, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, object_id);
break;
}
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
{
const GLenum cm_targets[] = { GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, GL_TEXTURE_CUBE_MAP_POSITIVE_X,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z };
GLenum general_target = getGeneralTargetForDetailedTarget(object_target);
unsigned int n_cm_target = 0;
// Set up base mipmap for our source texture.
gl.bindTexture(general_target, object_id);
// Set up *all* faces of a cube-map (as per Bugzilla #9689 & #9807),
// so that the CM texture is cube complete.
for (n_cm_target = 0; n_cm_target < sizeof(cm_targets) / sizeof(cm_targets[0]); ++n_cm_target)
{
gl.texImage2D(cm_targets[n_cm_target], 0 /* level */, internal_format, TEXTURE_WIDTH, TEXTURE_HEIGHT,
0 /* border */, format, type, data);
}
gl.texParameterf(general_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl.texParameterf(general_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl.texParameterf(general_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl.texParameterf(general_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Set up the FBO attachment
if (is_source_gl_object)
gl.framebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0, object_target, object_id, 0);
gl.bindTexture(general_target, 0);
break;
}
case GL_TEXTURE_2D:
{
// Set up base mipmap for our source texture.
gl.bindTexture(object_target, object_id);
gl.texImage2D(object_target, 0 /* level */, internal_format, TEXTURE_WIDTH, TEXTURE_HEIGHT, 0 /* border */,
format, type, data);
gl.texParameterf(object_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl.texParameterf(object_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl.texParameterf(object_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl.texParameterf(object_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Set up the FBO attachment
if (is_source_gl_object)
gl.framebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0, object_target, object_id, 0);
gl.bindTexture(object_target, 0);
break;
}
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_3D:
{
// Set up base mipmap for our source texture.
gl.bindTexture(object_target, object_id);
gl.texImage3D(object_target, 0 /* level */, internal_format, TEXTURE_WIDTH, TEXTURE_HEIGHT, TEXTURE_DEPTH,
0 /* border */, format, type, NULL);
gl.texSubImage3D(object_target, 0 /* level */, 0 /* xoffset */, 0 /* yoffset */, 1 /* zoffset */, TEXTURE_WIDTH,
TEXTURE_HEIGHT, 1 /* depth */, format, type, data);
gl.texParameterf(object_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl.texParameterf(object_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl.texParameterf(object_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl.texParameterf(object_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
gl.texParameterf(object_target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
DE_ASSERT(is_source_gl_object);
// Set up the FBO attachment. Make sure there is an actual difference from gl.framebufferTexture2D()
// and use the second layer of the texture.
gl.framebufferTextureLayer(fbo_target, GL_COLOR_ATTACHMENT0, object_id, 0 /* level */, 1 /* layer */);
gl.bindTexture(object_target, 0);
break;
}
default:
{
// ASSERTION FAILURE: unsupported source attachment type
DE_ASSERT(0);
result = false;
}
} /* switch (source_attachment_type) */
if (result)
{
GLenum error_code = gl.getError();
if (error_code != GL_NO_ERROR)
{
m_testCtx.getLog() << tcu::TestLog::Message << "Could not set up a GL object ["
<< (is_source_gl_object ? "source" : "destination") << "] of format ["
<< getInternalformatString(internal_format) << "] to be used as "
<< getTargetName(object_target) << " attachment for the test. GL reported error ["
<< error_code << "]";
return false;
}
}
return result;
}
/** Releases a GL object. If @param target represents a texture,
* the object is unbound from the target prior to a gl.deleteTextures()
* call.
*
* @param target Type of the object to release. Allowed values:
* 1) GL_RENDERBUFFER,
* 2) GL_TEXTURE_2D,
* 3) GL_TEXTURE_2D_ARRAY,
* 4) GL_TEXTURE_3D,
* 5) GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
* 6) GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
* 7) GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
* 8) GL_TEXTURE_CUBE_MAP_POSITIVE_X,
* 9) GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
* 10) GL_TEXTURE_CUBE_MAP_POSITIVE_Z.
*
* @param object_id GLES ID of the object to release.
*/
void TestBase::destroyGLObject(GLenum target, GLuint object_id)
{
const Functions& gl = m_context.getRenderContext().getFunctions();
switch (target)
{
case GL_RENDERBUFFER:
{
gl.bindRenderbuffer(GL_RENDERBUFFER, 0);
gl.deleteRenderbuffers(1, &object_id);
break;
}
case GL_TEXTURE_2D:
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_3D:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
{
GLenum general_attachment_type = getGeneralTargetForDetailedTarget(target);
gl.bindTexture(general_attachment_type, 0);
gl.deleteTextures(1, &object_id);
break;
}
default:
{
TCU_FAIL("Unsupported attachment type.");
}
}
}
/** Tells whether @param internalformat can be used for
* a gl.renderbufferStorage*() call.
*
* @param internalformat Internalformat to consider.
*
* @return true if the internal format can be used for the call,
* false otherwise.
**/
bool TestBase::isValidRBOInternalFormat(GLenum internalformat) const
{
// Internal format can be used for gl.renderbufferStorage()
// call if it's either color-, depth- or stencil-renderable.
return isColorRenderableInternalFormat(internalformat) || isDepthRenderableInternalFormat(internalformat) ||
isDepthStencilRenderableInternalFormat(internalformat);
}
/** Tells whether internal format @param internalformat is color-renderable.
*
* @param internalformat GLES internal format to consider.
*
* @return true if @param internalformat is color-renderable, false otherwise
**/
bool TestBase::isColorRenderableInternalFormat(GLenum internalformat) const
{
const glu::ContextInfo& contextInfo = m_context.getContextInfo();
bool supports_fp_textures = contextInfo.isExtensionSupported("GL_EXT_color_buffer_float");
bool supports_half_fp_textures = contextInfo.isExtensionSupported("GL_EXT_color_buffer_half_float");
// Floating-point textures are only supported if
// implementation supports GL_EXT_color_buffer_float extension
if (!supports_fp_textures && (internalformat == GL_R32F || internalformat == GL_RG32F ||
internalformat == GL_RGB32F || internalformat == GL_RGBA32F))
{
return false;
}
// Half floating-point textures are only supported if
// implementation supports GL_EXT_color_buffer_half_float extension
if (!supports_half_fp_textures && (internalformat == GL_R16F || internalformat == GL_RG16F ||
internalformat == GL_RGB16F || internalformat == GL_RGBA16F))
{
return false;
}
switch (internalformat)
{
case GL_RGB:
case GL_RGBA:
case GL_R8:
case GL_RG8:
case GL_RGB8:
case GL_RGB565:
case GL_RGBA4:
case GL_RGB5_A1:
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGB10_A2UI:
case GL_SRGB8_ALPHA8:
case GL_R8I:
case GL_R8UI:
case GL_R16I:
case GL_R16UI:
case GL_R32I:
case GL_R32UI:
case GL_RG8I:
case GL_RG8UI:
case GL_RG16I:
case GL_RG16UI:
case GL_RG32I:
case GL_RG32UI:
case GL_RGBA8I:
case GL_RGBA8UI:
case GL_RGBA16I:
case GL_RGBA16UI:
case GL_RGBA32I:
case GL_RGBA32UI:
// GLES3.0 color-renderable internalformats
return true;
case GL_R16F:
case GL_R32F:
case GL_RG16F:
case GL_RG32F:
case GL_RGB16F:
// GL_RGB32F not supported
case GL_RGBA16F:
case GL_RGBA32F:
// Since we passed the above checks, we can assume
// the internalformats are color-renderable
return true;
default:
return false;
}
return false;
}
/** Tells whether internal format @param internalformat is depth-renderable.
*
* @param internalformat GLES internal format to consider.
*
* @return true if @param internalformat is depth-renderable, false otherwise
**/
bool TestBase::isDepthRenderableInternalFormat(GLenum internalformat) const
{
switch (internalformat)
{
case GL_DEPTH_COMPONENT16:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32F:
return true;
}
return false;
}
/** Tells whether internal format @param internalformat is depth+stencil-renderable.
*
* @param internalformat GLES internal format to consider.
*
* @return true if @param internalformat is depth+stencil-renderable, false otherwise
**/
bool TestBase::isDepthStencilRenderableInternalFormat(GLenum internalformat) const
{
switch (internalformat)
{
case GL_DEPTH24_STENCIL8:
case GL_DEPTH32F_STENCIL8:
return true;
}
return false;
}
/** Tells whether OpenGL ES 3.0 implementations should accept copying texture image data from
* a read buffer using @param src_internalformat internalformat-based storage to a texture object
* using an internal format @param dst_internalformat.
*
* @param src_internalformat Internal format to be used for source object's data storage.
* @param dst_internalformat Internal format to be used for destination texture object's data storage.
*
* @return true if the operation is expected to execute successfully, false otherwise.
*/
bool TestBase::isFBOEffectiveInternalFormatCompatibleWithDestinationInternalFormat(GLenum src_internalformat,
GLenum dst_internalformat) const
{
const unsigned int n_copyteximage_internalformats = DE_LENGTH_OF_ARRAY(copyTexImage2DInternalFormatOrdering);
unsigned int n_dst_internalformat = 0;
const unsigned int n_effective_internalformats = DE_LENGTH_OF_ARRAY(fboEffectiveInternalFormatOrdering);
unsigned int n_src_internalformat = 0;
bool result = false;
// Find out which index does the source internalformat use
while (n_src_internalformat < n_effective_internalformats)
{
GLenum internalformat_at_n = getFBOEffectiveInternalFormatAtIndex(n_src_internalformat);
if (internalformat_at_n == src_internalformat)
break;
else
++n_src_internalformat;
}
DE_ASSERT(n_src_internalformat != n_effective_internalformats);
if (n_src_internalformat == n_effective_internalformats)
return false;
// Find out which index does the target internalformat use
while (n_dst_internalformat < n_copyteximage_internalformats)
{
GLenum internalformat_at_n = getCopyTexImage2DInternalFormatAtIndex(n_dst_internalformat);
if (internalformat_at_n == dst_internalformat)
break;
else
++n_dst_internalformat;
}
DE_ASSERT(n_dst_internalformat != n_copyteximage_internalformats);
if (n_dst_internalformat == n_copyteximage_internalformats)
return false;
// Find out if the conversion is allowed
unsigned int conversion_array_index = n_copyteximage_internalformats * n_src_internalformat + n_dst_internalformat;
DE_ASSERT(conversion_array_index < (sizeof(conversionArray) / sizeof(GLenum)));
if (conversion_array_index < (sizeof(conversionArray) / sizeof(GLenum)))
result = (conversionArray[conversion_array_index] != GL_NONE);
return result;
}
/** Retrieves a string representing name of internal format passed by argument.
*
* @param internalformat GLES internal format to retrieve a string for.
*
* @return A relevant string or "?" (without double quotation marks)
* if type is unrecognized.
**/
const char* TestBase::getInternalformatString(GLenum internalformat)
{
switch (internalformat)
{
case GL_ALPHA:
return "GL_ALPHA";
case GL_ALPHA8_OES:
return "GL_ALPHA8";
case GL_LUMINANCE:
return "GL_LUMINANCE";
case GL_LUMINANCE8_OES:
return "GL_LUMINANCE8";
case GL_LUMINANCE8_ALPHA8_OES:
return "GL_LUMINANCE8_ALPHA8";
case GL_LUMINANCE_ALPHA:
return "GL_LUMINANCE_ALPHA";
case GL_R11F_G11F_B10F:
return "GL_R11F_G11F_B10F";
case GL_R16F:
return "GL_R16F";
case GL_R16I:
return "GL_R16I";
case GL_R16UI:
return "GL_R16UI";
case GL_R32F:
return "GL_R32F";
case GL_R32I:
return "GL_R32I";
case GL_R32UI:
return "GL_R32UI";
case GL_R8:
return "GL_R8";
case GL_R8I:
return "GL_R8I";
case GL_R8UI:
return "GL_R8UI";
case GL_R8_SNORM:
return "GL_R8_SNORM";
case GL_RG16F:
return "GL_RG16F";
case GL_RG16I:
return "GL_RG16I";
case GL_RG16UI:
return "GL_RG16UI";
case GL_RG32F:
return "GL_RG32F";
case GL_RG32I:
return "GL_RG32I";
case GL_RG32UI:
return "GL_RG32UI";
case GL_RG8:
return "GL_RG8";
case GL_RG8I:
return "GL_RG8I";
case GL_RG8UI:
return "GL_RG8UI";
case GL_RG8_SNORM:
return "GL_RG8_SNORM";
case GL_RGB:
return "GL_RGB";
case GL_RGB10_A2:
return "GL_RGB10_A2";
case GL_RGB10_A2UI:
return "GL_RGB10_A2UI";
case GL_RGB16F:
return "GL_RGB16F";
case GL_RGB16I:
return "GL_RGB16I";
case GL_RGB16UI:
return "GL_RGB16UI";
case GL_RGB32F:
return "GL_RGB32F";
case GL_RGB32I:
return "GL_RGB32I";
case GL_RGB32UI:
return "GL_RGB32UI";
case GL_RGB5_A1:
return "GL_RGB5_A1";
case GL_RGB8:
return "GL_RGB8";
case GL_RGB8I:
return "GL_RGB8I";
case GL_RGB8UI:
return "GL_RGB8UI";
case GL_RGB8_SNORM:
return "GL_RGB8_SNORM";
case GL_RGB9_E5:
return "GL_RGB9_E5";
case GL_RGBA:
return "GL_RGBA";
case GL_RGBA16I:
return "GL_RGBA16I";
case GL_RGBA16UI:
return "GL_RGBA16UI";
case GL_RGBA4:
return "GL_RGBA4";
case GL_RGBA32I:
return "GL_RGBA32I";
case GL_RGBA32UI:
return "GL_RGBA32UI";
case GL_RGBA8I:
return "GL_RGBA8I";
case GL_RGBA8UI:
return "GL_RGBA8UI";
case GL_RGB565:
return "GL_RGB565";
case GL_RGBA16F:
return "GL_RGBA16F";
case GL_RGBA32F:
return "GL_RGBA32F";
case GL_RGBA8:
return "GL_RGBA8";
case GL_RGBA8_SNORM:
return "GL_RGBA8_SNORM";
case GL_SRGB8:
return "GL_SRGB8";
case GL_SRGB8_ALPHA8:
return "GL_SRGB8_ALPHA8";
}
return "GL_NONE";
}
/* SPECIFICATION:
*
* This conformance test verifies that glCopyTexImage2D() implementation accepts
* internalformats that are compatible with effective internalformat of current
* read buffer.
*
* The test starts from creating two framebuffer objects, that it accordingly binds
* to GL_DRAW_FRAMEBUFFER and GL_READ_FRAMEBUFFER targets. It then enters two-level loop:
*
* a) First level determines source attachment type: this could either be a 2D texture/cube-map
* face mip-map, a specific mip-map of a slice coming from a 2D texture array OR a 3D texture,
* or finally a render-buffer. All of these can be bound to an attachment point that is
* later pointed to by read buffer configuration.
* b) Second level configures attachment type of destination. Since glCopyTexImage2D()
* specification limits accepted targets, only 2D texture or cube-map face targets are
* accepted.
*
* For each viable source/destination configuration, the test then enters another two-level loop:
*
* I) First sub-level determines what internal format should be used for the source attachment.
* All texture formats required from a conformant GLES3.0 implementation are iterated over.
* II) Second sub-level determines internal format that should be passed as a parameter to
* a glCopyTexImage2D() call.
*
* For each internal format pair, the test creates and configures a corresponding GL object and
* attaches it to the read framebuffer. The test also uses a pre-generated texture object ID that
* will be re-configured with each glCopyTexImage2D() call.
*
* Source data is a 2x2 array consisting of up to 4 channels with different values, represented
* in an iteration-specific format and type. For more details, please see implementation of
* ConfigureConversionDatabase() entry-point.
*
* The test then loops over all supported format+type combinations for the internal-format considered
* and feeds them into actual glCopyTexImage2D() call. It is against the specification for the call
* to fail at this point. Should this be the case, the test is considered to fail but will continue
* iterating over all the loops to make sure all problems are reported within a single run.
*
* Once the call is determined to have finished successfully, the test attempts to read the result data.
* This needs to be handled in two ways:
*
* - if internalformat is color-renderable, we can attach the result texture to the read framebuffer object
* and do a glReadPixels() call. For some combinations of internalformat and attachment types the implementations
* are allowed to report unsupported framebuffer configuration, in which case the test will proceed with testing
* remaining source/destination/internalformat combinations and will not consider this an error.
* - if internalformat is not color-renderable, we need to bind the result texture to a texture unit and
* use a program object to determine whether the data made available are valid. THIS CASE IS NOT IMPLEMENTED
* YET!
*
* Once the data are downloaded, they are compared against reference texture data. Should the rendered output
* diverge outside the allowed epsilon, the test will report an error but will continue iterating to make sure
* all source/destination/internalformat combinations are covered.
*/
class RequiredCase : public TestBase
{
public:
RequiredCase(deqp::Context& context, de::SharedPtr<ConversionDatabase> database, GLenum sourceAttachmentTypes,
GLenum destinationAttachmentTypes);
virtual ~RequiredCase();
void deinit(void);
tcu::TestNode::IterateResult iterate(void);
protected:
bool execute(GLenum src_internalformat, GLenum dst_internalformat,
NonRenderableInternalformatSupportObjects* objects_ptr);
bool bindTextureToTargetToSpecificTextureUnit(GLuint to_id, GLenum texture_target, GLenum texture_unit);
bool setUniformValues(GLint source_2D_texture_uniform_location, GLenum source_2D_texture_unit,
GLint source_2DArray_texture_uniform_location, GLenum source_2DArray_texture_unit,
GLint source_3D_texture_uniform_location, GLenum source_3D_texture_unit,
GLint source_Cube_texture_uniform_location, GLenum source_Cube_texture_unit,
GLint destination_2D_texture_uniform_location, GLenum destination_2D_texture_unit,
GLint destination_Cube_texture_uniform_location, GLenum destination_Cube_texture_unit,
GLint channels_to_compare_uniform_location, GLint channels_to_compare,
GLint samplers_to_use_uniform_location, GLint samplers_to_use);
bool copyDataFromBufferObject(GLuint bo_id, std::vector<GLint>& retrieved_data);
bool findEntryInConversionDatabase(unsigned int index, GLenum src_internalformat, GLenum src_type,
GLenum copyteximage2d_internalformat, GLenum* out_result_internalformat,
GLenum* out_dst_type, PixelData* out_src_topleft, PixelData* out_src_topright,
PixelData* out_src_bottomleft, PixelData* out_src_bottomright,
PixelData* out_dst_topleft, PixelData* out_dst_topright,
PixelData* out_dst_bottomleft, PixelData* out_dst_bottomright,
PixelCompareChannel* out_channels_to_compare);
int getIndexOfCopyTexImage2DInternalFormat(GLenum internalformat);
int getIndexOfFramebufferEffectiveInternalFormat(GLenum internalformat);
bool compareExpectedResultsByReadingPixels(PixelData source_tl_pixel_data, PixelData source_tr_pixel_data,
PixelData source_bl_pixel_data, PixelData source_br_pixel_data,
PixelData reference_tl_pixel_data, PixelData reference_tr_pixel_data,
PixelData reference_bl_pixel_data, PixelData reference_br_pixel_data,
GLenum read_type, GLenum result_internalformat);
unsigned int getSizeOfPixel(GLenum format, GLenum type);
bool getPixelDataFromRawData(void* raw_data, GLenum raw_data_format, GLenum raw_data_type, PixelData* out_result);
bool comparePixelData(PixelData downloaded_pixel, PixelData reference_pixel, PixelData source_pixel,
GLenum result_internalformat, bool has_test_failed_already);
bool getNumberOfBitsForInternalFormat(GLenum internalformat, int* out_rgba_bits);
bool getRawDataFromPixelData(std::vector<char>& result, PixelData topleft, PixelData topright, PixelData bottomleft,
PixelData bottomright);
bool getNumberOfBitsForChannelDataType(ChannelDataType channel_data_type, int* out_n_bits);
bool getChannelOrderForInternalformatAndType(GLenum internalformat, GLenum type, ChannelOrder* out_channel_order);
bool generateObjectsToSupportNonColorRenderableInternalformats();
bool prepareSupportForNonRenderableTexture(NonRenderableInternalformatSupportObjects& objects,
DataSamplerType src_texture_sampler_type,
DataSamplerType dst_texture_sampler_type, GLenum source_attachment_type,
GLenum destination_attachment_type);
bool calculateBufferDataSize(DataSamplerType sampler_type, GLuint* buffer_data_size_ptr);
const float* getTexCoordinates(GLenum attachment_type) const;
bool prepareProgramAndShaderObjectsToSupportNonRenderableTexture(GLuint program_object_id,
GLuint fragment_shader_object_id,
GLuint vertex_shader_object_id,
DataSamplerType src_texture_sampler_type,
DataSamplerType dst_texture_sampler_type);
bool setSourceForShaderObjectsUsedForNonRenderableTextureSupport(GLuint fragment_shader_object_id,
GLuint vertex_shader_object_id,
DataSamplerType src_texture_sampler_type,
DataSamplerType dst_texture_sampler_type);
bool compileAndCheckShaderCompilationStatus(GLuint shader_object_id);
bool linkAndCheckProgramLinkStatus(GLuint program_object_id);
bool getUniformLocations(GLuint program_object_id, GLint* source_2D_texture_uniform_location_ptr,
GLint* source_2DArray_texture_uniform_location_ptr,
GLint* source_3D_texture_uniform_location_ptr,
GLint* source_Cube_texture_uniform_location_ptr,
GLint* destination_2D_texture_uniform_location_ptr,
GLint* destination_Cube_texture_uniform_location_ptr,
GLint* channels_to_compare_uniform_location_ptr,
GLint* samplers_to_use_uniform_location_ptr);
void displayPixelComparisonFailureMessage(GLint source_pixel_r, GLint source_pixel_g, GLint source_pixel_b,
GLint source_pixel_a, GLenum source_internalformat, GLenum source_type,
GLint reference_pixel_r, GLint reference_pixel_g, GLint reference_pixel_b,
GLint reference_pixel_a, GLenum reference_internalformat,
GLenum reference_type, GLint result_pixel_r, GLint result_pixel_g,
GLint result_pixel_b, GLint result_pixel_a, GLenum result_internalformat,
GLenum result_type, GLint max_epsilon_r, GLint max_epsilon_g,
GLint max_epsilon_b, GLint max_epsilon_a);
DataSamplerType getDataSamplerTypeForInternalformat(GLenum internalformat);
bool isInternalFormatCompatibleWithFPSampler(GLenum internalformat);
bool isInternalFormatCompatibleWithIntegerSampler(GLenum internalformat);
bool isInternalFormatCompatibleWithUnsignedIntegerSampler(GLenum internalformat);
void destroyObjectsSupportingNonRenderableInternalformats(NonRenderableInternalformatSupportObjects& objects);
void unbindAndDestroyBufferObject(GLuint bo_id);
void destroyTransformFeedbackObject(GLuint transform_feedback_object_id);
void destroyProgramAndShaderObjects(GLuint program_object_id, GLuint fragment_shader_id, GLuint vertex_shader_id);
void unbindColorAttachments();
void restoreBindings(GLenum src_attachment_point, GLenum dst_attachment_point, GLint bound_draw_fbo_id,
GLint bound_read_fbo_id);
private:
GLuint m_dst_object_id;
GLuint m_src_object_id;
de::SharedPtr<ConversionDatabase> m_conversion_database;
// Some of the internalformats considered during the test are not renderable, meaning
// we cannot use glReadPixels() to retrieve their contents.
// Instead, a special program object needs to be used to perform the verification in
// actual shader.
// We create a program object for possible each float/int/uint->float/int/uint combination.
// All objects created during the process are stored in a dedicated
// _non_renderable_internalformat_support_objects instance and released once the test ends.
NonRenderableInternalformatSupportObjects m_f_src_f_dst_internalformat;
NonRenderableInternalformatSupportObjects m_i_src_i_dst_internalformat;
NonRenderableInternalformatSupportObjects m_ui_src_ui_dst_internalformat;
};
RequiredCase::RequiredCase(deqp::Context& context, de::SharedPtr<ConversionDatabase> database,
GLenum sourceAttachmentTypes, GLenum destinationAttachmentTypes)
: TestBase(context, sourceAttachmentTypes, destinationAttachmentTypes)
, m_dst_object_id(0)
, m_src_object_id(0)
, m_conversion_database(database)
{
deMemset(&m_f_src_f_dst_internalformat, 0, sizeof(m_f_src_f_dst_internalformat));
deMemset(&m_i_src_i_dst_internalformat, 0, sizeof(m_i_src_i_dst_internalformat));
deMemset(&m_ui_src_ui_dst_internalformat, 0, sizeof(m_ui_src_ui_dst_internalformat));
}
RequiredCase::~RequiredCase()
{
}
void RequiredCase::deinit(void)
{
// free shared pointer
m_conversion_database.clear();
// Release the source object before we continue
if (m_src_object_id != 0)
{
destroyGLObject(m_source_attachment_type, m_src_object_id);
m_src_object_id = 0;
}
if (m_dst_object_id != 0)
{
destroyGLObject(m_destination_attachment_type, m_dst_object_id);
m_dst_object_id = 0;
}
destroyObjectsSupportingNonRenderableInternalformats(m_f_src_f_dst_internalformat);
destroyObjectsSupportingNonRenderableInternalformats(m_i_src_i_dst_internalformat);
destroyObjectsSupportingNonRenderableInternalformats(m_ui_src_ui_dst_internalformat);
}
tcu::TestNode::IterateResult RequiredCase::iterate(void)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
GLuint draw_fbo_id = 0;
GLuint read_fbo_id = 0;
gl.genFramebuffers(1, &draw_fbo_id);
gl.genFramebuffers(1, &read_fbo_id);
gl.bindTexture(GL_TEXTURE_2D, 0);
gl.bindFramebuffer(GL_DRAW_FRAMEBUFFER, draw_fbo_id);
gl.bindFramebuffer(GL_READ_FRAMEBUFFER, read_fbo_id);
// We will be reading from zeroth color attachment
gl.readBuffer(GL_COLOR_ATTACHMENT0);
// Make sure the pixel storage is configured accordingly to our data sets!
gl.pixelStorei(GL_UNPACK_ALIGNMENT, 1);
gl.pixelStorei(GL_PACK_ALIGNMENT, 1);
GLU_EXPECT_NO_ERROR(gl.getError(), "glPixelStorei");
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
// Sanity checks
DE_ASSERT(m_destination_attachment_type == GL_TEXTURE_2D ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_POSITIVE_Z);
// Determine general attachment type
GLenum general_attachment_type = getGeneralTargetForDetailedTarget(m_source_attachment_type);
if (general_attachment_type == GL_NONE)
return STOP;
// Set up source object
m_src_object_id = generateGLObject(m_source_attachment_type);
if (m_src_object_id == 0)
return STOP;
// Set up destination object
m_dst_object_id = generateGLObject(m_destination_attachment_type);
if (m_dst_object_id == 0)
return STOP;
// Generate all objects required to execute the non-renderable internalformat tests.
// Can't use the shader on GL_RENDERBUFFER as source.
if (m_source_attachment_type != GL_RENDERBUFFER && !generateObjectsToSupportNonColorRenderableInternalformats())
{
return STOP;
}
m_conversion_database.get()->initializeDatabase();
// Run through all FBO internal formats.
bool result = true;
const int n_dst_internal_formats = DE_LENGTH_OF_ARRAY(copyTexImage2DInternalFormatOrdering);
const int n_fbo_internal_formats = DE_LENGTH_OF_ARRAY(fboEffectiveInternalFormatOrdering);
for (int n_fbo_internal_format = 0; n_fbo_internal_format < n_fbo_internal_formats; ++n_fbo_internal_format)
{
GLenum fbo_internalformat = fboEffectiveInternalFormatOrdering[n_fbo_internal_format];
// Run through all destination internal formats.
for (int n_dst_internal_format = 0; n_dst_internal_format < n_dst_internal_formats; ++n_dst_internal_format)
{
GLenum dst_internalformat = copyTexImage2DInternalFormatOrdering[n_dst_internal_format];
switch (getDataSamplerTypeForInternalformat(fbo_internalformat))
{
case DATA_SAMPLER_FLOAT:
{
switch (getDataSamplerTypeForInternalformat(dst_internalformat))
{
case DATA_SAMPLER_FLOAT:
{
if (!execute(fbo_internalformat, dst_internalformat, &m_f_src_f_dst_internalformat))
{
// At least one conversion was invalid or failed. Test should fail,
// but let's continue iterating over internalformats.
result = false;
}
break;
}
case DATA_SAMPLER_INTEGER:
case DATA_SAMPLER_UNSIGNED_INTEGER:
{
// There shouldn't be any valid conversion formats in this case. Just pass NULL for the non-renderable case's objects.
// The test will fail if we try to verify the copy for different data type formats
if (!execute(fbo_internalformat, dst_internalformat, NULL))
{
// At least one conversion was invalid or failed. Test should
// fail, but let's continue iterating over internalformats.
result = false;
}
break;
}
default:
{
// Unrecognized destination internalformat
DE_ASSERT(0);
break;
}
} // switch (GetDataSamplerTypeForInternalformat(dst_internalformat) )
break;
}
case DATA_SAMPLER_INTEGER:
{
switch (getDataSamplerTypeForInternalformat(dst_internalformat))
{
case DATA_SAMPLER_INTEGER:
{
if (!execute(fbo_internalformat, dst_internalformat, &m_i_src_i_dst_internalformat))
{
// At least one conversion was invalid or failed. Test should fail,
// but let's continue iterating over internalformats.
result = false;
}
break;
}
case DATA_SAMPLER_FLOAT:
case DATA_SAMPLER_UNSIGNED_INTEGER:
{
// There shouldn't be any valid conversion formats in this case. Just pass NULL for the non-renderable case's objects.
// The test will fail if we try to verify the copy for different data type formats
if (!execute(fbo_internalformat, dst_internalformat, NULL))
{
// At least one conversion was invalid or failed. Test should fail,
// but let's continue iterating over internalformats.
result = false;
}
break;
}
default:
{
// Unrecognized destination internalformat
DE_ASSERT(0);
break;
}
} // switch (GetDataSamplerTypeForInternalformat(dst_internalformat) )
break;
} // case DATA_SAMPLER_INTEGER:
case DATA_SAMPLER_UNSIGNED_INTEGER:
{
switch (getDataSamplerTypeForInternalformat(dst_internalformat))
{
case DATA_SAMPLER_UNSIGNED_INTEGER:
{
if (!execute(fbo_internalformat, dst_internalformat, &m_ui_src_ui_dst_internalformat))
{
// At least one conversion was invalid or failed. Test should fail,
// but let's continue iterating over internalformats.
result = false;
}
break;
}
case DATA_SAMPLER_FLOAT:
case DATA_SAMPLER_INTEGER:
{
// There shouldn't be any valid conversion formats in this case. Just pass NULL for the non-renderable case's objects.
// The test will fail if we try to verify the copy for different data type formats
if (!execute(fbo_internalformat, dst_internalformat, NULL))
{
// At least one conversion was invalid or failed. Test should fail,
// but let's continue iterating over internalformats.
result = false;
}
break;
}
default:
{
// Unrecognized destination internalformat?
DE_ASSERT(0);
break;
}
} // switch (GetDataSamplerTypeForInternalformat(dst_internalformat) )
break;
} // case DATA_SAMPLER_UNSIGNED_INTEGER
default:
{
// Unrecognized source internalformat
DE_ASSERT(0);
break;
}
} // switch (GetDataSamplerTypeForInternalformat(fbo_internalformat) )
} // for (all destination internalformats)
} // for (all FBO internalformats)
if (result)
m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
return STOP;
}
/** This function verifies if glCopyTexImage2D() implementation performs conversions as
* per GLES3.0.3 spec, and that the result data is valid. For more detailed description,
* please see specification of copy_tex_image_conversions_required conformance test.
*
* @param conversion_database Conversion database handle. Cannot be NULL.
* @param source_attachment_type Tells what GL object (or which texture target)
* should be used as a read buffer for
* a glCopyTexImage2D) call. Allowed values:
* 1) GL_TEXTURE_2D,
* 2) GL_TEXTURE_2D_ARRAY,
* 3) GL_TEXTURE_3D,
* 4) GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
* 5) GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
* 6) GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
* 7) GL_TEXTURE_CUBE_MAP_POSITIVE_X,
* 8) GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
* 9) GL_TEXTURE_CUBE_MAP_POSITIVE_Z.
* @param destination_attachment_type Tells which texture target should be used for
* a glCopyTexImage2D() call. Allowed values:
* 1) GL_TEXTURE_2D,
* 2) GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
* 3) GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
* 4) GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
* 5) GL_TEXTURE_CUBE_MAP_POSITIVE_X,
* 6) GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
* 7) GL_TEXTURE_CUBE_MAP_POSITIVE_Z.
* @param src_internalformat GLES internalformat that read buffer should use.
* @param dst_internalformat GLES internalformat that should be used for glReadPixels() call.
* This should NOT be the expected effective internalformat!
* @param objects_ptr Deref where generated object ids are stored
* (objects which were generated to support non-color-renderable internalformats).
* Cannot be NULL.
*
* @return true if successful, false otherwise.
*/
bool RequiredCase::execute(GLenum src_internalformat, GLenum dst_internalformat,
NonRenderableInternalformatSupportObjects* objects_ptr)
{
GLenum fbo_completeness = GL_NONE;
GLenum general_destination_attachment_type = GL_NONE;
int n_format_type_pair = 0;
GLenum src_format = GL_NONE;
GLenum src_type = GL_NONE;
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// If we're using a renderbuffer as a source, make sure the internalformat
// we'll try to use to store data in it is actually renderable
if (m_destination_attachment_type == GL_RENDERBUFFER && !isValidRBOInternalFormat(src_internalformat))
return true;
// Only accept source internal formats that are color renderable
if (!isColorRenderableInternalFormat(src_internalformat))
return true;
// Retrieve general destination attachment type before we continue
if ((general_destination_attachment_type = getGeneralTargetForDetailedTarget(m_destination_attachment_type)) ==
GL_NONE)
{
return false;
}
// Good. Check if the conversion is required - if so, we can run the test!
if (!isFBOEffectiveInternalFormatCompatibleWithDestinationInternalFormat(src_internalformat, dst_internalformat))
return true;
bool result = true;
std::vector<char> fbo_data(4);
// Try using all compatible format+type pairs
while (getFormatAndTypeCompatibleWithInternalformat(src_internalformat, n_format_type_pair, &src_format, &src_type))
{
// Try to find a rule in the conversion database, so that we know what data we should fill
// the source attachment with.
// There may be many entries for a single source internal format + type pair, so
// iterate until the find() function fails.
GLenum effective_internalformat = GL_NONE;
int n_conversion_rule = 0;
PixelData result_bottomleft_pixel_data;
PixelData result_bottomright_pixel_data;
PixelData result_topleft_pixel_data;
PixelData result_topright_pixel_data;
GLenum result_type = GL_NONE;
PixelData src_bottomleft_pixel_data;
PixelData src_bottomright_pixel_data;
PixelData src_topleft_pixel_data;
PixelData src_topright_pixel_data;
PixelCompareChannel channels_to_compare;
while (findEntryInConversionDatabase(
n_conversion_rule, src_internalformat, src_type, dst_internalformat, &effective_internalformat,
&result_type, &src_topleft_pixel_data, &src_topright_pixel_data, &src_bottomleft_pixel_data,
&src_bottomright_pixel_data, &result_topleft_pixel_data, &result_topright_pixel_data,
&result_bottomleft_pixel_data, &result_bottomright_pixel_data, &channels_to_compare))
{
#if 0
m_testCtx.getLog() << tcu::TestLog::Message
<< "Testing [src "
<< getInternalformatString(src_internalformat)
<< " " << glu::getTypeStr(src_type).toString()
<< "]=>[" << getInternalformatString(dst_internalformat) << "effective: "
<< getInternalformatString(effective_internalformat) << "] read with type: ["
<< glu::getTypeStr(result_type).toString() << ", src target: [" << GetTargetName(m_source_attachment_type)
<< "], dst target: " << GetTargetName(m_destination_attachment_type)
<< tcu::TestLog::EndMessage;
#endif
// Retrieve source data we can have uploaded to the source attachment
if (!getRawDataFromPixelData(fbo_data, src_topleft_pixel_data, src_topright_pixel_data,
src_bottomleft_pixel_data, src_bottomright_pixel_data))
{
unbindColorAttachments();
return false;
}
// Set up source attachment
if (!configureGLObject(1, m_source_attachment_type, m_src_object_id, src_internalformat, src_format,
src_type, &fbo_data[0]))
{
unbindColorAttachments();
return false;
}
// Make sure the source FBO configuration is supported.
fbo_completeness = gl.checkFramebufferStatus(GL_READ_FRAMEBUFFER);
if (fbo_completeness != GL_FRAMEBUFFER_COMPLETE)
{
if (fbo_completeness == GL_FRAMEBUFFER_UNSUPPORTED)
{
// The implementation does not allow us to use source data built using this internal-format,
// using this particular attachment type. Break out of the loop, there's no need to carry on
// trying.
break;
}
else
{
m_testCtx.getLog() << tcu::TestLog::Message << "FBO error - incompleteness reason ["
<< fbo_completeness << "]" << tcu::TestLog::EndMessage;
// This should never happen. Consider test failed
unbindColorAttachments();
return false;
}
}
// Ask the implementation to perform the conversion!
switch (m_destination_attachment_type)
{
case GL_TEXTURE_2D:
{
gl.bindTexture(m_destination_attachment_type, m_dst_object_id);
gl.copyTexImage2D(m_destination_attachment_type, 0, dst_internalformat, 0 /* x */, 0 /* y */,
TEXTURE_WIDTH, TEXTURE_HEIGHT, 0 /* border */);
gl.texParameterf(m_destination_attachment_type, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl.texParameterf(m_destination_attachment_type, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl.texParameterf(m_destination_attachment_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl.texParameterf(m_destination_attachment_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
gl.bindTexture(m_destination_attachment_type, 0);
break;
}
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
{
unsigned int j = 0;
GLuint dst_format, dst_type;
getFormatAndTypeCompatibleWithInternalformat(dst_internalformat, 0, &dst_format, &dst_type);
gl.bindTexture(general_destination_attachment_type, m_dst_object_id);
// Initialize all faces so that the texture is CM complete
// It's needed in case we need to use a shader to verify the copy operation
for (j = GL_TEXTURE_CUBE_MAP_POSITIVE_X; j <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; j++)
{
if (j == m_destination_attachment_type)
{
// Do the copy to the destination face
gl.copyTexImage2D(j, 0, dst_internalformat, 0 /* x */, 0 /* y */, TEXTURE_WIDTH, TEXTURE_HEIGHT,
0 /* border */);
}
else
{
// Clear the remaining faces to catch "copy to the wrong face" errors
static std::vector<char> zero_data(TEXTURE_WIDTH * TEXTURE_HEIGHT * 4 * sizeof(float), 0);
gl.texImage2D(j, 0, dst_internalformat, TEXTURE_WIDTH, TEXTURE_HEIGHT, 0, dst_format, dst_type,
&zero_data[0]);
}
}
gl.texParameterf(general_destination_attachment_type, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl.texParameterf(general_destination_attachment_type, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl.texParameterf(general_destination_attachment_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl.texParameterf(general_destination_attachment_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
gl.bindTexture(general_destination_attachment_type, 0);
break;
} // cube-map texture target cases
default:
{
// Unsupported destination attachment type
DE_ASSERT(0);
}
} // switch (destination_attachment_type)
// Has the conversion succeeded as expected?
GLenum error_code = gl.getError();
if (error_code != GL_NO_ERROR)
{
m_testCtx.getLog() << tcu::TestLog::Message << "glCopyTexImage2D() reported an error for ["
<< getInternalformatString(src_internalformat) << "]=>["
<< getInternalformatString(dst_internalformat)
<< "] internalformat conversion [target=" << getTargetName(m_source_attachment_type)
<< "], as opposed to ES specification requirements!" << tcu::TestLog::EndMessage;
// This test is now considered failed
result = false;
}
else
{
// Conversion succeeded. We now need to compare the data stored by OpenGL ES with reference data.
if (isColorRenderableInternalFormat(effective_internalformat))
{
gl.framebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_destination_attachment_type,
m_dst_object_id, 0);
fbo_completeness = gl.checkFramebufferStatus(GL_READ_FRAMEBUFFER);
if (fbo_completeness != GL_FRAMEBUFFER_COMPLETE)
{
// Per spec:
// Although the GL defines a wide variety of internal formats for framebuffer-
// attachable image, such as texture images and renderbuffer images, some imple-
// mentations may not support rendering to particular combinations of internal for-
// mats. If the combination of formats of the images attached to a framebuffer object
// are not supported by the implementation, then the framebuffer is not complete un-
// der the clause labeled FRAMEBUFFER_UNSUPPORTED.
if (fbo_completeness != GL_FRAMEBUFFER_UNSUPPORTED)
{
m_testCtx.getLog() << tcu::TestLog::Message
<< "Framebuffer is considered incomplete [reason: " << fbo_completeness
<< "] - cannot proceed with the test case" << tcu::TestLog::EndMessage;
result = false;
}
}
else
{
if (!compareExpectedResultsByReadingPixels(
src_topleft_pixel_data, src_topright_pixel_data, src_bottomleft_pixel_data,
src_bottomright_pixel_data, result_topleft_pixel_data, result_topright_pixel_data,
result_bottomleft_pixel_data, result_bottomright_pixel_data, result_type,
effective_internalformat))
{
// This test is now considered failed
result = false;
}
}
gl.framebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_destination_attachment_type, 0,
0);
} // if (IsColorRenderableInternalFormat(effective_internalformat) )
else if (m_source_attachment_type != GL_RENDERBUFFER)
{
// We cannot use glReadPixels()-approach to test this internalformat.
// The approach to be taken for non-color-renderable internalformats will
// be to use a special vertex shader to verify texture data. Outcome of the
// comparison will be captured using transform feedback.
GLint bound_draw_fbo_id = 0;
GLint bound_read_fbo_id = 0;
int compare_result_index = 0;
std::vector<GLint> copied_compare_result_data;
std::vector<GLint> copied_dst_texture_data;
std::vector<GLint> copied_src_texture_data;
GLenum dst_attachment_point = GL_TEXTURE2;
GLenum src_attachment_point = GL_TEXTURE1;
GLint samplers_to_use = 0;
// unique sampler values
GLint src_2D_texture_attachment = GL_TEXTURE3;
GLint src_2DArray_texture_attachment = GL_TEXTURE4;
GLint src_3D_texture_attachment = GL_TEXTURE5;
GLint src_Cube_texture_attachment = GL_TEXTURE6;
GLint dst_2D_texture_attachment = GL_TEXTURE7;
GLint dst_Cube_texture_attachment = GL_TEXTURE8;
if (m_source_attachment_type == GL_TEXTURE_2D_ARRAY)
{
samplers_to_use = TEXTURE_2D_ARRAY_SAMPLER_TYPE;
src_2DArray_texture_attachment = src_attachment_point;
}
else if (m_source_attachment_type == GL_TEXTURE_3D)
{
samplers_to_use = TEXTURE_3D_SAMPLER_TYPE;
src_3D_texture_attachment = src_attachment_point;
}
else if (m_source_attachment_type != GL_TEXTURE_2D)
{
samplers_to_use = TEXTURE_CUBE_SAMPLER_TYPE;
src_Cube_texture_attachment = src_attachment_point;
}
else
src_2D_texture_attachment = src_attachment_point;
if (m_destination_attachment_type != GL_TEXTURE_2D)
{
samplers_to_use = (samplers_to_use | (TEXTURE_CUBE_SAMPLER_TYPE << 8));
dst_Cube_texture_attachment = dst_attachment_point;
}
else
dst_2D_texture_attachment = dst_attachment_point;
// We will get a NULL pointer here if src and dst data type are different
// (NORM -> INT, UNSIGNED INT -> INT etc.). It's not allowed by the spec.
if (objects_ptr == NULL)
{
m_testCtx.getLog()
<< tcu::TestLog::Message << "Source and destination should be of the same data type - "
"cannot proceed with the test case"
<< tcu::TestLog::EndMessage;
result = false;
restoreBindings(src_attachment_point, dst_attachment_point, bound_draw_fbo_id,
bound_read_fbo_id);
continue;
}
// Retrieve currently bound framebuffer (draw and read) object IDs.
// If there is any FBO bound, glDraw*() function uses it, which is not wanted in this situation.
// What we do here is: unbinding FBOs, issue draw calls, bind FBOs again.
gl.getIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &bound_draw_fbo_id);
gl.getIntegerv(GL_READ_FRAMEBUFFER_BINDING, &bound_read_fbo_id);
// Use default framebuffer object for this case purposes.
gl.bindFramebuffer(GL_FRAMEBUFFER, 0);
// Bind source texture object to specific texture unit.
if (!bindTextureToTargetToSpecificTextureUnit(m_src_object_id, m_source_attachment_type,
src_attachment_point))
{
result = false;
restoreBindings(src_attachment_point, dst_attachment_point, bound_draw_fbo_id,
bound_read_fbo_id);
continue;
}
// Bind destination texture object to specific texture unit.
if (!bindTextureToTargetToSpecificTextureUnit(m_dst_object_id, m_destination_attachment_type,
dst_attachment_point))
{
result = false;
restoreBindings(src_attachment_point, dst_attachment_point, bound_draw_fbo_id,
bound_read_fbo_id);
continue;
}
// Set active program object.
gl.useProgram(objects_ptr->program_object_id);
if (!setUniformValues(objects_ptr->src_2D_texture_uniform_location, src_2D_texture_attachment,
objects_ptr->src_2DArray_texture_uniform_location,
src_2DArray_texture_attachment, objects_ptr->src_3D_texture_uniform_location,
src_3D_texture_attachment, objects_ptr->src_Cube_texture_uniform_location,
src_Cube_texture_attachment, objects_ptr->dst_2D_texture_uniform_location,
dst_2D_texture_attachment, objects_ptr->dst_Cube_texture_uniform_location,
dst_Cube_texture_attachment,
objects_ptr->channels_to_compare_uniform_location, channels_to_compare,
objects_ptr->samplers_to_use_uniform_location, samplers_to_use))
{
result = false;
restoreBindings(src_attachment_point, dst_attachment_point, bound_draw_fbo_id,
bound_read_fbo_id);
continue;
}
gl.bindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, COMPARISON_RESULT_BUFFER_OBJECT_INDEX,
objects_ptr->comparison_result_buffer_object_id);
gl.bindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, SOURCE_TEXTURE_PIXELS_BUFFER_OBJECT_INDEX,
objects_ptr->src_texture_pixels_buffer_object_id);
gl.bindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, DESTINATION_TEXTURE_PIXELS_BUFFER_OBJECT_INDEX,
objects_ptr->dst_texture_pixels_buffer_object_id);
// Enable texture corrdinates (vertex attribs 0 & 1)
gl.enableVertexAttribArray(SRC_TEXTURE_COORDS_ATTRIB_INDEX);
gl.enableVertexAttribArray(DST_TEXTURE_COORDS_ATTRIB_INDEX);
// Begin transform feedback operations.
gl.enable(GL_RASTERIZER_DISCARD);
// Issue transform feedback operations.
gl.beginTransformFeedback(GL_POINTS);
error_code = gl.getError();
if (GL_NO_ERROR != error_code)
{
m_testCtx.getLog()
<< tcu::TestLog::Message << "An error [" << error_code
<< "] occurred after glBeginTransformFeedback() call." << tcu::TestLog::EndMessage;
result = false;
restoreBindings(src_attachment_point, dst_attachment_point, bound_draw_fbo_id,
bound_read_fbo_id);
continue;
}
gl.drawArrays(GL_POINTS, 0, NUMBER_OF_POINTS_TO_DRAW);
error_code = gl.getError();
if (GL_NO_ERROR != error_code)
{
m_testCtx.getLog() << tcu::TestLog::Message << "An error [" << error_code
<< "] occurred after glDrawArrays() call." << tcu::TestLog::EndMessage;
result = false;
restoreBindings(src_attachment_point, dst_attachment_point, bound_draw_fbo_id,
bound_read_fbo_id);
continue;
}
gl.endTransformFeedback();
error_code = gl.getError();
if (GL_NO_ERROR != error_code)
{
m_testCtx.getLog()
<< tcu::TestLog::Message << "An error [" << error_code
<< "] occurred after glEndTransformFeedback() call." << tcu::TestLog::EndMessage;
result = false;
restoreBindings(src_attachment_point, dst_attachment_point, bound_draw_fbo_id,
bound_read_fbo_id);
continue;
}
// Restore default active program object.
gl.useProgram(0);
// Make sure no error was generated at this point.
error_code = gl.getError();
if (GL_NO_ERROR != error_code)
{
m_testCtx.getLog()
<< tcu::TestLog::Message << "An error [" << error_code
<< "] occurred while working with transform feedback object." << tcu::TestLog::EndMessage;
result = false;
restoreBindings(src_attachment_point, dst_attachment_point, bound_draw_fbo_id,
bound_read_fbo_id);
continue;
}
gl.disable(GL_RASTERIZER_DISCARD);
// Let's read the buffer data now.
copyDataFromBufferObject(objects_ptr->comparison_result_buffer_object_id,
copied_compare_result_data);
copyDataFromBufferObject(objects_ptr->src_texture_pixels_buffer_object_id, copied_src_texture_data);
copyDataFromBufferObject(objects_ptr->dst_texture_pixels_buffer_object_id, copied_dst_texture_data);
// Check the results.
for (compare_result_index = 0; compare_result_index < NUMBER_OF_POINTS_TO_DRAW;
compare_result_index++)
{
if (copied_compare_result_data[compare_result_index] != 1)
{
int index_in_vec4_array = compare_result_index * NUMBER_OF_ELEMENTS_IN_VEC4;
// Returned result indicates that textures are different.
// Print texture object contents as well.
displayPixelComparisonFailureMessage(copied_src_texture_data[index_in_vec4_array],
copied_src_texture_data[index_in_vec4_array + 1],
copied_src_texture_data[index_in_vec4_array + 2],
copied_src_texture_data[index_in_vec4_array + 3],
src_internalformat, src_type, 0, 0, 0, 0, GL_NONE,
GL_NONE, copied_dst_texture_data[index_in_vec4_array],
copied_dst_texture_data[index_in_vec4_array + 1],
copied_dst_texture_data[index_in_vec4_array + 2],
copied_dst_texture_data[index_in_vec4_array + 3],
dst_internalformat, result_type, 0, 0, 0, 0);
// Report failure.
result = false;
}
}
fbo_completeness = GL_FRAMEBUFFER_COMPLETE;
restoreBindings(src_attachment_point, dst_attachment_point, bound_draw_fbo_id, bound_read_fbo_id);
} // if (source_attachment_type != GL_RENDERBUFFER && destination_attachment_type != GL_RENDERBUFFER)
} // if (no error was reported by GLES)
n_conversion_rule++;
}
// There should be at least ONE conversion rule defined
// for each valid FBO effective internalformat =>copyteximage2d internalformat defined!
// NOTE: This assertion can fail IF GLES implementation does not support particular FBO attachment combination.
// Make sure the check is not performed, should GL_FRAMEBUFFER_UNSUPPORTED fbo status be reported.
if (fbo_completeness != GL_FRAMEBUFFER_UNSUPPORTED)
{
if (n_conversion_rule == 0)
{
m_testCtx.getLog() << tcu::TestLog::Message << "No conversion rule for [src "
<< getInternalformatString(src_internalformat) << " "
<< glu::getTypeStr(src_type).toString() << "]=>["
<< getInternalformatString(dst_internalformat)
<< "effective: " << getInternalformatString(effective_internalformat)
<< "] read with type: [" << glu::getTypeStr(result_type).toString()
<< ", src target: [" << getTargetName(m_source_attachment_type)
<< "], dst target: " << getTargetName(m_destination_attachment_type)
<< tcu::TestLog::EndMessage;
}
}
// Check next format+type combination
n_format_type_pair++;
// If we're copying from a renderbuffer, we don't really care about compatible format+type pairs, as
// the effective internalformat is explicitly configured by glRenderbufferStorage() call.
if (m_source_attachment_type == GL_RENDERBUFFER)
{
break;
} // if (general_attachment_type == GL_RENDERBUFFER)
} // while (internalformat has n-th legal format+type pair)
unbindColorAttachments();
return result;
}
/** Binds texture object to a given texture target of a specified texture unit.
*
* @param to_id Valid texture object ID to be bound.
* @param texture_target Valid texture target to which @param to_id will be bound.
* @param texture_unit Texture unit to which @param to_id will be bound.
*
* @return GTFtrue if successful, GTFfalse otherwise.
*/
bool RequiredCase::bindTextureToTargetToSpecificTextureUnit(GLuint to_id, GLenum texture_target, GLenum texture_unit)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// Set active texture unit.
gl.activeTexture(texture_unit);
GLU_EXPECT_NO_ERROR(gl.getError(), "glActiveTexture");
if (texture_target == GL_TEXTURE_CUBE_MAP_POSITIVE_X || texture_target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
texture_target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y || texture_target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
texture_target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z || texture_target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
{
texture_target = GL_TEXTURE_CUBE_MAP;
}
// Bind texture object to specific texture target of specified texture unit.
gl.bindTexture(texture_target, to_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glBindTexture");
// Restore default active texture unit.
gl.activeTexture(GL_TEXTURE0);
GLU_EXPECT_NO_ERROR(gl.getError(), "glActiveTexture");
return true;
}
/** Sets values of uniforms, that will later be used to perform data check-up for non-renderable internalformats.
*
* @param source_2D_texture_uniform_location Location for source 2D texture sample uniform.
* @param source_2D_texture_unit Texture unit which the source 2D texture object is bound to.
* Will be used to set value for @param source_2D_texture_uniform_location.
* @param source_2DArray_texture_uniform_location Location for source 2DArray texture sample uniform.
* @param source_2DArray_texture_unit Texture unit which the source 2DArray texture object is bound to.
* Will be used to set value for @param source_2DArray_texture_uniform_location.
* @param source_3D_texture_uniform_location Location for source 3D texture sample uniform.
* @param source_3D_texture_unit Texture unit which the source 3D texture object is bound to.
* Will be used to set value for @param source_Cube_texture_uniform_location.
* @param source_Cube_texture_uniform_location Location for source Cube texture sample uniform.
* @param source_Cube_texture_unit Texture unit which the source 2D texture object is bound to.
* Will be used to set value for @param source_2D_texture_uniform_location.
* @param destination_2D_texture_uniform_location Location for destination texture sample uniform.
* @param destination_2D_texture_unit Texture unit which the destination texture object is bound to.
* Will be used to set value for @param destination_2D_texture_uniform_location.
* @param destination_Cube_texture_uniform_location Location for destination texture sample uniform.
* @param destination_Cube_texture_unit Texture unit which the destination texture object is bound to.
* Will be used to set value for @param destination_Cube_texture_uniform_location.
* @param channels_to_compare_uniform_location Location for components to compare value uniform.
* @param channels_to_compare Components to compare value.
* @param samplers_to_use_uniform_location Location for samplers to use value uniform.
* @param samplers_to_use samplers to use value.
*
* @return GTFtrue if the operation succeeded (no error was generated),
* GTFfalse otherwise.
*/
bool RequiredCase::setUniformValues(GLint source_2D_texture_uniform_location, GLenum source_2D_texture_unit,
GLint source_2DArray_texture_uniform_location, GLenum source_2DArray_texture_unit,
GLint source_3D_texture_uniform_location, GLenum source_3D_texture_unit,
GLint source_Cube_texture_uniform_location, GLenum source_Cube_texture_unit,
GLint destination_2D_texture_uniform_location, GLenum destination_2D_texture_unit,
GLint destination_Cube_texture_uniform_location,
GLenum destination_Cube_texture_unit, GLint channels_to_compare_uniform_location,
GLint channels_to_compare, GLint samplers_to_use_uniform_location,
GLint samplers_to_use)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
if (source_2D_texture_uniform_location == -1 || source_2DArray_texture_uniform_location == -1 ||
source_3D_texture_uniform_location == -1 || source_Cube_texture_uniform_location == -1 ||
destination_2D_texture_uniform_location == -1 || destination_Cube_texture_uniform_location == -1 ||
channels_to_compare_uniform_location == -1 || samplers_to_use_uniform_location == -1)
{
m_testCtx.getLog() << tcu::TestLog::Message << "Cannot set uniform values for invalid uniform locations."
<< tcu::TestLog::EndMessage;
return false;
} // if (input uniform locations are invalid)
// We are now ready to set uniform values.
gl.uniform1i(destination_2D_texture_uniform_location, destination_2D_texture_unit - GL_TEXTURE0);
gl.uniform1i(destination_Cube_texture_uniform_location, destination_Cube_texture_unit - GL_TEXTURE0);
gl.uniform1i(source_2D_texture_uniform_location, source_2D_texture_unit - GL_TEXTURE0);
gl.uniform1i(source_2DArray_texture_uniform_location, source_2DArray_texture_unit - GL_TEXTURE0);
gl.uniform1i(source_3D_texture_uniform_location, source_3D_texture_unit - GL_TEXTURE0);
gl.uniform1i(source_Cube_texture_uniform_location, source_Cube_texture_unit - GL_TEXTURE0);
gl.uniform1i(channels_to_compare_uniform_location, channels_to_compare);
gl.uniform1i(samplers_to_use_uniform_location, samplers_to_use);
GLU_EXPECT_NO_ERROR(gl.getError(), "glUniform1i");
return true;
}
/** Retrieves and copies data stored in buffer object into allocated memory buffer.
* It is user's responsibility to free allocated memory.
*
* @param bo_id Valid buffer object ID from which data is retrieved.
* @param retrieved_data_ptr_ptr Deref will be used to store retrieved buffer object data.
*
* @return GTFtrue if successful, GTFfalse otherwise.
*/
bool RequiredCase::copyDataFromBufferObject(GLuint bo_id, std::vector<GLint>& retrieved_data)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
GLint buffer_size = 0;
gl.bindBuffer(GL_ARRAY_BUFFER, bo_id);
gl.getBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &buffer_size);
GLU_EXPECT_NO_ERROR(gl.getError(), "glGetBufferParameteriv");
GLint* buffer_data_ptr = NULL;
buffer_data_ptr = (GLint*)gl.mapBufferRange(GL_ARRAY_BUFFER, 0, buffer_size, GL_MAP_READ_BIT);
GLU_EXPECT_NO_ERROR(gl.getError(), "glMapBufferRange");
if (buffer_data_ptr == NULL)
{
m_testCtx.getLog() << tcu::TestLog::Message << "Could not map buffer object." << tcu::TestLog::EndMessage;
return false;
}
// Copy retrieved buffer data.
retrieved_data.resize(buffer_size / sizeof(GLint));
std::memcpy(&retrieved_data[0], buffer_data_ptr, buffer_size);
gl.unmapBuffer(GL_ARRAY_BUFFER);
GLU_EXPECT_NO_ERROR(gl.getError(), "glUnmapBuffer");
return true;
}
/** Allocates a buffer of sufficient size to hold 2x2 texture data represented
* with @param read_type GL type, issues a glReadPixels() call and then compares
* retrieved data with reference data (provided by the caller using reference_*
* arguments).
* Should it happen that the call resulted in an indirect conversion, the function
* calculates an epsilon, taking differences in amount of bits that were used to
* represent the data during any stage of the conversion into consideration.
*
* @param source_tl_pixel_data Describes pixel data that was used to build source
* object's contents (top-left corner).
* @param source_tr_pixel_data Describes pixel data that was used to build source
* object's contents (top-right corner).
* @param source_bl_pixel_data Describes pixel data that was used to build source
* object's contents (bottom-left corner).
* @param source_br_pixel_data Describes pixel data that was used to build source
* object's contents (bottom-right corner).
* @param reference_tl_pixel_data Describes ideal result pixel data. (top-left corner).
* @param reference_tr_pixel_data Describes ideal result pixel data. (top-right corner).
* @param reference_bl_pixel_data Describes ideal result pixel data. (bottom-left corner).
* @param reference_br_pixel_data Describes ideal result pixel data. (bottom-right corner).
* @param read_type GL type that will be used for glReadPixels() call. This
* type should be directly related with data type used in
* all reference_* pixel data arguments.
* @param result_internalformat Effective internal-format, expected to be used by the
* implementation to hold destination object's data.
* @param src_format GL format used for source object's data storage.
* @param src_type GL type used for source object's data storage.
* @param src_attachment_type Object type or texture target of the source object.
* @param dst_attachment_type Object type or texture target of the destination object.
*
* @return GTFtrue if all read pixels were correct, GTFfalse otherwise
**/
bool RequiredCase::compareExpectedResultsByReadingPixels(PixelData source_tl_pixel_data, PixelData source_tr_pixel_data,
PixelData source_bl_pixel_data, PixelData source_br_pixel_data,
PixelData reference_tl_pixel_data,
PixelData reference_tr_pixel_data,
PixelData reference_bl_pixel_data,
PixelData reference_br_pixel_data, GLenum read_type,
GLenum result_internalformat)
{
char* data_traveller_ptr = NULL;
int n = 0;
unsigned int n_bytes_per_result_pixel = 0;
GLenum read_format = GL_NONE;
bool result = true;
PixelData* reference_pixels[] = {
&reference_bl_pixel_data, &reference_br_pixel_data, &reference_tl_pixel_data, &reference_tr_pixel_data,
};
PixelData* source_pixels[] = { &source_bl_pixel_data, &source_br_pixel_data, &source_tl_pixel_data,
&source_tr_pixel_data };
PixelData result_pixels[4];
// Determine which read format should be used for reading.
// Note that GLES3 accepts GL_RGBA_INTEGER format for GL_RGB10_A2UI internalformat
// and GL_RGBA for GL_RGB10_A2 - handle this in a special case.
if (((read_type == GL_UNSIGNED_INT_2_10_10_10_REV) && (result_internalformat == GL_RGB10_A2UI)) ||
(read_type == GL_UNSIGNED_INT) || (read_type == GL_INT))
{
read_format = GL_RGBA_INTEGER;
}
else
{
read_format = GL_RGBA;
}
// Update read_type for GL_HALF_FLOAT
if (read_type == GL_HALF_FLOAT)
{
read_type = GL_FLOAT;
}
// Allocate data buffer
n_bytes_per_result_pixel = getSizeOfPixel(read_format, read_type);
std::vector<char> data(TEXTURE_WIDTH * TEXTURE_HEIGHT * n_bytes_per_result_pixel);
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// Retrieve the data.
gl.readPixels(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT, read_format, read_type, &data[0]);
// Was the operation successful?
GLenum error_code = gl.getError();
if (error_code != GL_NO_ERROR)
{
m_testCtx.getLog() << tcu::TestLog::Message << "glReadPixels() failed with error: [" << error_code << "]"
<< tcu::TestLog::EndMessage;
return false;
}
// Convert the data we read back to pixel data structures
data_traveller_ptr = &data[0];
for (n = 0; n < DE_LENGTH_OF_ARRAY(reference_pixels); ++n)
{
PixelData* result_pixel_ptr = result_pixels + n;
if (!getPixelDataFromRawData(data_traveller_ptr, read_format, read_type, result_pixel_ptr))
{
m_testCtx.getLog() << tcu::TestLog::Message << "GetPixelDataFromRawData failed!"
<< tcu::TestLog::EndMessage;
// Could not convert raw data to pixel data instance!
DE_ASSERT(0);
return false;
} // if (raw data->pixel data conversion failed)
// Move the data traveller
data_traveller_ptr += n_bytes_per_result_pixel;
} // for (all pixels)
// Compare each pixel with reference data. For debugging purposes, compare every single pixel,
// even if at least one comparison has already failed.
DE_ASSERT(DE_LENGTH_OF_ARRAY(reference_pixels) == DE_LENGTH_OF_ARRAY(result_pixels));
for (n = 0; n < DE_LENGTH_OF_ARRAY(reference_pixels); ++n)
{
result &= comparePixelData(result_pixels[n], *(reference_pixels[n]), *(source_pixels[n]), result_internalformat,
(result == 0));
} // For each pixel
if (result == false)
{
// Log a separator line for clarity
m_testCtx.getLog() << tcu::TestLog::Message << "<-- Erroneous test case finishes." << tcu::TestLog::EndMessage;
}
return result;
}
/** Retrieves size (expressed in bytes) of a single pixel represented by
* a @param format format + @param type type pair.
*
* @param format GLES format to consider.
* @param type GLES type to consider.
*
* @return Size of the pixel or 0 if either of the arguments was not recognized.
**/
unsigned int RequiredCase::getSizeOfPixel(GLenum format, GLenum type)
{
int result = 0;
switch (format)
{
case GL_RED:
result = 1;
break;
case GL_RED_INTEGER:
result = 1;
break;
case GL_RG:
result = 2;
break;
case GL_RG_INTEGER:
result = 2;
break;
case GL_RGB:
result = 3;
break;
case GL_RGB_INTEGER:
result = 3;
break;
case GL_RGBA:
result = 4;
break;
case GL_RGBA_INTEGER:
result = 4;
break;
case GL_DEPTH_COMPONENT:
result = 1;
break;
case GL_DEPTH_STENCIL:
result = 2;
break;
case GL_LUMINANCE_ALPHA:
result = 2;
break;
case GL_LUMINANCE:
result = 1;
break;
case GL_ALPHA:
result = 1;
break;
default:
{
DE_ASSERT(0);
result = 0;
}
}
switch (type)
{
case GL_UNSIGNED_BYTE:
result *= 1;
break;
case GL_BYTE:
result *= 1;
break;
case GL_UNSIGNED_SHORT:
result *= 2;
break;
case GL_SHORT:
result *= 2;
break;
case GL_UNSIGNED_INT:
result *= 4;
break;
case GL_INT:
result *= 4;
break;
case GL_HALF_FLOAT:
result *= 2;
break;
case GL_FLOAT:
result *= 4;
break;
case GL_UNSIGNED_SHORT_5_6_5:
result = 2;
break;
case GL_UNSIGNED_SHORT_4_4_4_4:
result = 2;
break;
case GL_UNSIGNED_SHORT_5_5_5_1:
result = 2;
break;
case GL_UNSIGNED_INT_2_10_10_10_REV:
result = 4;
break;
case GL_UNSIGNED_INT_10F_11F_11F_REV:
result = 4;
break;
case GL_UNSIGNED_INT_5_9_9_9_REV:
result = 4;
break;
case GL_UNSIGNED_INT_24_8:
result = 4;
break;
case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
result = 8;
break;
default:
{
DE_ASSERT(0);
result = 0;
}
}
return result;
}
/** Takes a pointer with raw data representation and converts it to
* four instances of _pixel_data corresponding to four corners of a
* quad used for verification purposes. Assumes 2x2 resolution.
*
* @param raw_data Pointer to a buffer storing the data.
* @param raw_data_format Format of the data stored under @param raw_data.
* @param raw_data_type Type of the data stored under @param raw_data.
* @param out_result Deref will be used to store four _pixel_data instances.
* Cannot be NULL, must be capacious enough to hold four
* instances of the structure.
*
* @return GTFtrue if successful, GTFfalse otherwise.
**/
bool RequiredCase::getPixelDataFromRawData(void* raw_data, GLenum raw_data_format, GLenum raw_data_type,
PixelData* out_result)
{
// Sanity checks: format should be equal to one of the values supported
// by glReadPixels()
DE_ASSERT(raw_data_format == GL_RGBA || raw_data_format == GL_RGBA_INTEGER);
if (raw_data_format != GL_RGBA && raw_data_format != GL_RGBA_INTEGER)
{
return false;
}
// Sanity checks: type should be equal to one of the values supported
// by glReadPixels()
DE_ASSERT(raw_data_type == GL_UNSIGNED_BYTE || raw_data_type == GL_UNSIGNED_INT || raw_data_type == GL_INT ||
raw_data_type == GL_FLOAT || raw_data_type == GL_UNSIGNED_INT_2_10_10_10_REV_EXT);
if (raw_data_type != GL_UNSIGNED_BYTE && raw_data_type != GL_UNSIGNED_INT && raw_data_type != GL_INT &&
raw_data_type != GL_FLOAT && raw_data_type != GL_UNSIGNED_INT_2_10_10_10_REV_EXT)
{
return false;
}
// Reset the result structure
deMemset(out_result, 0, sizeof(PixelData));
out_result->data_internalformat = raw_data_format;
out_result->data_type = raw_data_type;
// Fill the fields, depending on user-provided format+type pair
if (raw_data_format == GL_RGBA && raw_data_type == GL_UNSIGNED_BYTE)
{
char* raw_data_ptr = reinterpret_cast<char*>(raw_data);
out_result->alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
out_result->blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
out_result->green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
out_result->red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS;
out_result->red.unsigned_byte_data = raw_data_ptr[0];
out_result->green.unsigned_byte_data = raw_data_ptr[1];
out_result->blue.unsigned_byte_data = raw_data_ptr[2];
out_result->alpha.unsigned_byte_data = raw_data_ptr[3];
}
else if (raw_data_format == GL_RGBA_INTEGER && raw_data_type == GL_UNSIGNED_INT)
{
unsigned int* raw_data_ptr = reinterpret_cast<unsigned int*>(raw_data);
out_result->alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
out_result->blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
out_result->green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
out_result->red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS;
out_result->red.unsigned_integer_data = raw_data_ptr[0];
out_result->green.unsigned_integer_data = raw_data_ptr[1];
out_result->blue.unsigned_integer_data = raw_data_ptr[2];
out_result->alpha.unsigned_integer_data = raw_data_ptr[3];
}
else if (raw_data_format == GL_RGBA_INTEGER && raw_data_type == GL_INT)
{
signed int* raw_data_ptr = reinterpret_cast<signed int*>(raw_data);
out_result->alpha.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
out_result->blue.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
out_result->green.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
out_result->red.data_type = CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS;
out_result->red.signed_integer_data = raw_data_ptr[0];
out_result->green.signed_integer_data = raw_data_ptr[1];
out_result->blue.signed_integer_data = raw_data_ptr[2];
out_result->alpha.signed_integer_data = raw_data_ptr[3];
}
else if (raw_data_format == GL_RGBA && raw_data_type == GL_FLOAT)
{
float* raw_data_ptr = reinterpret_cast<float*>(raw_data);
out_result->alpha.data_type = CHANNEL_DATA_TYPE_FLOAT;
out_result->blue.data_type = CHANNEL_DATA_TYPE_FLOAT;
out_result->green.data_type = CHANNEL_DATA_TYPE_FLOAT;
out_result->red.data_type = CHANNEL_DATA_TYPE_FLOAT;
out_result->red.float_data = raw_data_ptr[0];
out_result->green.float_data = raw_data_ptr[1];
out_result->blue.float_data = raw_data_ptr[2];
out_result->alpha.float_data = raw_data_ptr[3];
} /* if (raw_data_format == GL_RGBA && raw_data_type == GL_FLOAT) */
else
{
signed int* raw_data_ptr = (signed int*)raw_data;
DE_ASSERT(raw_data_format == GL_RGBA && raw_data_type == GL_UNSIGNED_INT_2_10_10_10_REV);
out_result->alpha.data_type = CHANNEL_DATA_TYPE_UNSIGNED_BYTE_2BITS;
out_result->blue.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
out_result->green.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
out_result->red.data_type = CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS;
out_result->alpha.unsigned_byte_data = ((*raw_data_ptr) >> 30) & ((1 << 2) - 1);
out_result->blue.unsigned_short_data = ((*raw_data_ptr) >> 20) & ((1 << 10) - 1);
out_result->green.unsigned_short_data = ((*raw_data_ptr) >> 10) & ((1 << 10) - 1);
out_result->red.unsigned_short_data = ((*raw_data_ptr)) & ((1 << 10) - 1);
}
return true;
}
/** Checks if downloaded pixel data is valid. Should the rendered values differ
* outside allowed range, the function logs detailed information about the problem.
*
* @param downloaded_pixel Instance of _pixel_data describing a pixel
* that was rendered by the implementation.
* @param reference_pixel Instance of _pixel_data describing ideal
* pixel data.
* @param source_pixel Instance of _pixel_data describing the pixel
* prior to conversion.
* @param result_internalformat Internal format the implementation is expected
* to be using for the converted data.
* @param src_attachment_type Type of the source object used for the conversion.
* @param dst_attachment_type Type of the destination object used for the conversion.
* @param has_test_failed_already 1 if any of the other pixels making up the test 2x2
* data-set has already been determined to be corrupt.
* 0 otherwise.
* @param src_internalformat Internal-format used for source object's data storage.
* @param src_datatype Type used for source object's data storage.
*
* @return 1 if the pixels match, 0 otherwise.
**/
bool RequiredCase::comparePixelData(PixelData downloaded_pixel, PixelData reference_pixel, PixelData source_pixel,
GLenum result_internalformat, bool has_test_failed_already)
{
ChannelData* channel_data[12] = { 0 };
int max_epsilon[4] = { 0 };
int has_pixel_failed = 0;
int n_channel = 0;
bool result = true;
int result_rgba_bits[4] = { 0 };
int source_rgba_bits[4] = { 0 };
// Form channel data so we can later analyse channels one after another in a loop
channel_data[0] = &downloaded_pixel.red;
channel_data[1] = &reference_pixel.red;
channel_data[2] = &source_pixel.red;
channel_data[3] = &downloaded_pixel.green;
channel_data[4] = &reference_pixel.green;
channel_data[5] = &source_pixel.green;
channel_data[6] = &downloaded_pixel.blue;
channel_data[7] = &reference_pixel.blue;
channel_data[8] = &source_pixel.blue;
channel_data[9] = &downloaded_pixel.alpha;
channel_data[10] = &reference_pixel.alpha;
channel_data[11] = &source_pixel.alpha;
// Retrieve number of bits used for source and result data.
getNumberOfBitsForInternalFormat(source_pixel.data_internalformat, source_rgba_bits);
getNumberOfBitsForInternalFormat(result_internalformat, result_rgba_bits);
// Time for actual comparison!
for (unsigned int n = 0; n < sizeof(channel_data) / sizeof(channel_data[0]);
n += 3 /* downloaded + reference + source pixel combinations */, ++n_channel)
{
ChannelData* downloaded_channel_ptr = channel_data[n];
ChannelData* reference_channel_ptr = channel_data[n + 1];
// Calculate maximum epsilon
int max_n_bits = 0;
int min_n_bits = std::numeric_limits<int>::max();
int n_dst_bits = result_rgba_bits[n_channel];
int n_reading_bits = 0;
int n_source_bits = source_rgba_bits[n_channel];
getNumberOfBitsForChannelDataType(downloaded_channel_ptr->data_type, &n_reading_bits);
if (max_n_bits < n_dst_bits && n_dst_bits != 0)
{
max_n_bits = n_dst_bits;
} /* if (max_n_bits < n_dst_bits && n_dst_bits != 0) */
if (max_n_bits < n_reading_bits && n_reading_bits != 0)
{
max_n_bits = n_reading_bits;
}
if (max_n_bits < n_source_bits && n_source_bits != 0)
{
max_n_bits = n_source_bits;
}
if (n_dst_bits != 0)
{
min_n_bits = n_dst_bits;
}
if (min_n_bits > n_reading_bits && n_reading_bits != 0)
{
min_n_bits = n_reading_bits;
}
if (min_n_bits > n_source_bits && n_source_bits != 0)
{
min_n_bits = n_source_bits;
}
if (max_n_bits != min_n_bits && max_n_bits != 0)
{
DE_ASSERT(min_n_bits != std::numeric_limits<int>::max());
// Allow rounding in either direction
max_epsilon[n_channel] = deCeilFloatToInt32(((1 << max_n_bits) - 1.0f) / ((1 << min_n_bits) - 1));
}
else
{
max_epsilon[n_channel] = 0;
}
// At the moment, we only care about data types that correspond to GL types usable for glReadPixels() calls.
// Please feel free to expand this switch() with support for data types you need.
switch (downloaded_channel_ptr->data_type)
{
case CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS:
{
int delta = (downloaded_channel_ptr->signed_integer_data - reference_channel_ptr->signed_integer_data);
if (abs(delta) > max_epsilon[n_channel])
{
if (result)
{
has_pixel_failed = 1;
result = false;
}
}
break;
}
case CHANNEL_DATA_TYPE_UNSIGNED_BYTE_2BITS:
case CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS:
{
int delta = (downloaded_channel_ptr->unsigned_byte_data - reference_channel_ptr->unsigned_byte_data);
if (abs(delta) > max_epsilon[n_channel])
{
if (result)
{
has_pixel_failed = 1;
result = false;
}
}
break;
}
case CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS:
{
int delta = static_cast<int>(downloaded_channel_ptr->unsigned_integer_data -
reference_channel_ptr->unsigned_integer_data);
if (abs(delta) > max_epsilon[n_channel])
{
if (result)
{
has_pixel_failed = 1;
result = false;
}
}
break;
}
case CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS:
{
int delta = (downloaded_channel_ptr->unsigned_short_data - reference_channel_ptr->unsigned_short_data);
if (abs(delta) > max_epsilon[n_channel])
{
if (result)
{
has_pixel_failed = 1;
result = false;
}
}
break;
} /* case CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS: */
case CHANNEL_DATA_TYPE_FLOAT:
{
int delta = deChopFloatToInt32(downloaded_channel_ptr->float_data - reference_channel_ptr->float_data);
if (abs(delta) > max_epsilon[n_channel])
{
if (result)
{
has_pixel_failed = 1;
result = false;
}
}
break;
}
default:
{
// Unrecognized data type
DE_ASSERT(0);
}
}
if (has_pixel_failed && !has_test_failed_already)
{
m_testCtx.getLog() << tcu::TestLog::Message << "Erroneous test case starts-->" << tcu::TestLog::EndMessage;
has_test_failed_already = true;
}
} // for (all channels)
if (!result)
{
displayPixelComparisonFailureMessage(
channel_data[2] != NULL ? channel_data[2]->unsigned_integer_data : 0,
channel_data[5] != NULL ? channel_data[5]->unsigned_integer_data : 0,
channel_data[8] != NULL ? channel_data[8]->unsigned_integer_data : 0,
channel_data[11] != NULL ? channel_data[11]->unsigned_integer_data : 0, source_pixel.data_internalformat,
source_pixel.data_type, channel_data[1] != NULL ? channel_data[1]->unsigned_integer_data : 0,
channel_data[4] != NULL ? channel_data[4]->unsigned_integer_data : 0,
channel_data[7] != NULL ? channel_data[7]->unsigned_integer_data : 0,
channel_data[10] != NULL ? channel_data[10]->unsigned_integer_data : 0, reference_pixel.data_internalformat,
reference_pixel.data_type, channel_data[0] != NULL ? channel_data[0]->unsigned_integer_data : 0,
channel_data[3] != NULL ? channel_data[3]->unsigned_integer_data : 0,
channel_data[6] != NULL ? channel_data[6]->unsigned_integer_data : 0,
channel_data[9] != NULL ? channel_data[9]->unsigned_integer_data : 0, result_internalformat,
downloaded_pixel.data_type, max_epsilon[0], max_epsilon[1], max_epsilon[2], max_epsilon[3]);
}
return result;
}
/** Retrieves number of bits used for a single pixel, were it
* stored in @param internalformat internal format.
*
* @param internalformat GLES internal format to consider.
* @param out_rgba_bits Deref will be used to store 4 integers
* describing amount of bits that the internal
* format uses for subsequently R, G, B and A
* channels. Cannot be NULL.
*
* @return GTFtrue if successful, GTFfalse otherwise.
**/
bool RequiredCase::getNumberOfBitsForInternalFormat(GLenum internalformat, int* out_rgba_bits)
{
deMemset(out_rgba_bits, 0, sizeof(int) * 4);
switch (internalformat)
{
case GL_LUMINANCE8_OES:
out_rgba_bits[0] = 8;
break;
case GL_R16I:
out_rgba_bits[0] = 16;
break;
case GL_R16UI:
out_rgba_bits[0] = 16;
break;
case GL_R32I:
out_rgba_bits[0] = 32;
break;
case GL_R32UI:
out_rgba_bits[0] = 32;
break;
case GL_R8:
out_rgba_bits[0] = 8;
break;
case GL_R8_SNORM:
out_rgba_bits[0] = 8;
break;
case GL_R8I:
out_rgba_bits[0] = 8;
break;
case GL_R8UI:
out_rgba_bits[0] = 8;
break;
case GL_RG16UI:
out_rgba_bits[0] = 16;
out_rgba_bits[1] = 16;
break;
case GL_RG16I:
out_rgba_bits[0] = 16;
out_rgba_bits[1] = 16;
break;
case GL_RG32I:
out_rgba_bits[0] = 32;
out_rgba_bits[1] = 32;
break;
case GL_RG32UI:
out_rgba_bits[0] = 32;
out_rgba_bits[1] = 32;
break;
case GL_RG8:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
break;
case GL_RG8_SNORM:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
break;
case GL_RG8I:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
break;
case GL_RG8UI:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
break;
case GL_RGB10_A2:
out_rgba_bits[0] = 10;
out_rgba_bits[1] = 10;
out_rgba_bits[2] = 10;
out_rgba_bits[3] = 2;
break;
case GL_RGB10_A2UI:
out_rgba_bits[0] = 10;
out_rgba_bits[1] = 10;
out_rgba_bits[2] = 10;
out_rgba_bits[3] = 2;
break;
case GL_RGB16I:
out_rgba_bits[0] = 16;
out_rgba_bits[1] = 16;
out_rgba_bits[2] = 16;
break;
case GL_RGB16UI:
out_rgba_bits[0] = 16;
out_rgba_bits[1] = 16;
out_rgba_bits[2] = 16;
break;
case GL_RGB32I:
out_rgba_bits[0] = 32;
out_rgba_bits[1] = 32;
out_rgba_bits[2] = 32;
break;
case GL_RGB32UI:
out_rgba_bits[0] = 32;
out_rgba_bits[1] = 32;
out_rgba_bits[2] = 32;
break;
case GL_RGB5_A1:
out_rgba_bits[0] = 5;
out_rgba_bits[1] = 5;
out_rgba_bits[2] = 5;
out_rgba_bits[3] = 1;
break;
case GL_RGB565:
out_rgba_bits[0] = 5;
out_rgba_bits[1] = 6;
out_rgba_bits[2] = 5;
break;
case GL_RGB8:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
break;
case GL_RGB8_SNORM:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
break;
case GL_RGB8I:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
break;
case GL_RGB8UI:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
break;
case GL_RGBA16I:
out_rgba_bits[0] = 16;
out_rgba_bits[1] = 16;
out_rgba_bits[2] = 16;
out_rgba_bits[3] = 16;
break;
case GL_RGBA16UI:
out_rgba_bits[0] = 16;
out_rgba_bits[1] = 16;
out_rgba_bits[2] = 16;
out_rgba_bits[3] = 16;
break;
case GL_RGBA32I:
out_rgba_bits[0] = 32;
out_rgba_bits[1] = 32;
out_rgba_bits[2] = 32;
out_rgba_bits[3] = 32;
break;
case GL_RGBA32UI:
out_rgba_bits[0] = 32;
out_rgba_bits[1] = 32;
out_rgba_bits[2] = 32;
out_rgba_bits[3] = 32;
break;
case GL_RGBA4:
out_rgba_bits[0] = 4;
out_rgba_bits[1] = 4;
out_rgba_bits[2] = 4;
out_rgba_bits[3] = 4;
break;
case GL_RGBA8:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
out_rgba_bits[3] = 8;
break;
case GL_RGBA8_SNORM:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
out_rgba_bits[3] = 8;
break;
case GL_RGBA8I:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
out_rgba_bits[3] = 8;
break;
case GL_RGBA8UI:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
out_rgba_bits[3] = 8;
break;
case GL_SRGB8:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
break;
case GL_SRGB8_ALPHA8:
out_rgba_bits[0] = 8;
out_rgba_bits[1] = 8;
out_rgba_bits[2] = 8;
out_rgba_bits[3] = 8;
break;
case GL_R16F:
out_rgba_bits[0] = 16;
break;
case GL_RG16F:
out_rgba_bits[0] = 16;
out_rgba_bits[1] = 16;
break;
case GL_RGB16F:
out_rgba_bits[0] = 16;
out_rgba_bits[1] = 16;
out_rgba_bits[2] = 16;
break;
case GL_RGBA16F:
out_rgba_bits[0] = 16;
out_rgba_bits[1] = 16;
out_rgba_bits[2] = 16;
out_rgba_bits[3] = 16;
break;
case GL_R32F:
out_rgba_bits[0] = 32;
break;
case GL_RG32F:
out_rgba_bits[0] = 32;
out_rgba_bits[1] = 32;
break;
case GL_RGB32F:
out_rgba_bits[0] = 32;
out_rgba_bits[1] = 32;
out_rgba_bits[2] = 32;
break;
case GL_RGBA32F:
out_rgba_bits[0] = 32;
out_rgba_bits[1] = 32;
out_rgba_bits[2] = 32;
out_rgba_bits[3] = 32;
break;
default:
{
DE_ASSERT(0);
return false;
}
}
return true;
}
/** Browses the conversion database provided by user and looks for conversion rules
* that match the following requirements:
*
* 1) Source object's data internal format equal to @param src_internalformat.
* 2) Source object's data type equal to @param src_type.
* 3) Internal format used for glCopyTexImage2D() call equal to @param copyteximage2d_internalformat.
*
* The function allows to find as many conversion rules matching these requirements as
* available. For any triple, caller should use incrementing values of @param index,
* starting from 0.
*
* Source dataset corresponds to 2x2 image (using up to 4 channels) that the attachment bound to
* read buffer will use prior to glCopyTexImage2D() call.
* Destination dataset corresponds to 2x2 image (using up to 4 channels) that the result texture object
* should match (within acceptable epsilon).
*
* @param index Index of conversion rule the caller is interested in reading.
* @param src_internalformat Source object's data internal format to assume.
* @param src_type Source object's data type to assume.
* @param copyteximage2d_internalformat Internal format to be used for glCopyTexImage2D() call.
* @param out_result_internalformat Deref will be used to store internal format that GLES implementation
* should use for storage of the converted data. Cannot be NULL.
* @param out_dst_type Deref will be used to store type that GLES implementation should use
* for storage of the converted data. Cannot be NULL.
* @param out_src_topleft Deref will be used to store _pixel_data instance describing top-left
* corner of the source dataset. Cannot be NULL.
* @param out_src_topright Deref will be used to store _pixel_data instance describing top-right
* corner of the source dataset. Cannot be NULL.
* @param out_src_bottomleft Deref will be used to store _pixel_data instance describing bottom-left
* corner of the source dataset. Cannot be NULL.
* @param out_src_bottomright Deref will be used to store _pixel_data instance describing bottom-right
* corner of the source dataset. Cannot be NULL.
* @param out_dst_topleft Deref will be used to store _pixel_data instance describing top-left
* corner of the destination dataset.
* @param out_dst_topright Deref will be used to store _pixel_data instance describing top-right
* corner of the destination dataset.
* @param out_dst_bottomleft Deref will be used to store _pixel_data instance describing bottom-left
* corner of the destination dataset.
* @param out_dst_bottomright Deref will be used to store _pixel_data instance describing bottom-right
* corner of the destination dataset.
*
* @return GTFtrue if @param index -th conversion rule was found, GTFfalse otherwise.
**/
bool RequiredCase::findEntryInConversionDatabase(unsigned int index, GLenum src_internalformat, GLenum src_type,
GLenum copyteximage2d_internalformat,
GLenum* out_result_internalformat, GLenum* out_dst_type,
PixelData* out_src_topleft, PixelData* out_src_topright,
PixelData* out_src_bottomleft, PixelData* out_src_bottomright,
PixelData* out_dst_topleft, PixelData* out_dst_topright,
PixelData* out_dst_bottomleft, PixelData* out_dst_bottomright,
PixelCompareChannel* out_channels_to_compare)
{
const int conversion_array_width =
sizeof(copyTexImage2DInternalFormatOrdering) / sizeof(copyTexImage2DInternalFormatOrdering[0]);
int copyteximage2d_index = -1;
int fbo_effective_internalformat_index = -1;
unsigned int n_entry = 0;
unsigned int n_matching_entries = 0;
GLenum result_internalformat = GL_NONE;
int result_internalformat_index = -1;
/* Sanity checks */
DE_ASSERT(out_src_topleft != NULL);
DE_ASSERT(out_src_topright != NULL);
DE_ASSERT(out_src_bottomleft != NULL);
DE_ASSERT(out_src_bottomright != NULL);
DE_ASSERT(out_dst_topleft != NULL);
DE_ASSERT(out_dst_topright != NULL);
DE_ASSERT(out_dst_bottomleft != NULL);
DE_ASSERT(out_dst_bottomright != NULL);
// Retrieve internalformat that converted data will be stored in
copyteximage2d_index = getIndexOfCopyTexImage2DInternalFormat(copyteximage2d_internalformat);
fbo_effective_internalformat_index = getIndexOfFramebufferEffectiveInternalFormat(src_internalformat);
DE_ASSERT(copyteximage2d_index != -1 && fbo_effective_internalformat_index != -1);
if (copyteximage2d_index == -1 || fbo_effective_internalformat_index == -1)
return false;
result_internalformat_index = fbo_effective_internalformat_index * conversion_array_width + copyteximage2d_index;
DE_ASSERT(result_internalformat_index < DE_LENGTH_OF_ARRAY(conversionArray));
if (result_internalformat_index >= DE_LENGTH_OF_ARRAY(conversionArray))
return false;
result_internalformat = conversionArray[result_internalformat_index];
DE_ASSERT(result_internalformat != GL_NONE);
if (result_internalformat == GL_NONE)
return false;
// We use the simplest approach possible to keep the code as readable as possible.
for (n_entry = 0; n_entry < m_conversion_database->n_entries_added; ++n_entry)
{
ConversionDatabaseEntry& entry_ptr = m_conversion_database->entries[n_entry];
if (entry_ptr.src_bottomleft_corner.data_internalformat == src_internalformat &&
entry_ptr.src_bottomleft_corner.data_type == src_type &&
entry_ptr.dst_bottomleft_corner.data_internalformat == result_internalformat)
{
/* Is it the n-th match we're being asked for? */
if (index == n_matching_entries)
{
/* Indeed! */
*out_src_topleft = entry_ptr.src_topleft_corner;
*out_src_topright = entry_ptr.src_topright_corner;
*out_src_bottomleft = entry_ptr.src_bottomleft_corner;
*out_src_bottomright = entry_ptr.src_bottomright_corner;
*out_dst_topleft = entry_ptr.dst_topleft_corner;
*out_dst_topright = entry_ptr.dst_topright_corner;
*out_dst_bottomleft = entry_ptr.dst_bottomleft_corner;
*out_dst_bottomright = entry_ptr.dst_bottomright_corner;
*out_result_internalformat = entry_ptr.dst_topleft_corner.data_internalformat;
*out_dst_type = entry_ptr.dst_topleft_corner.data_type;
*out_channels_to_compare = entry_ptr.channels_to_compare;
return true;
}
else
{
++n_matching_entries;
}
}
}
return false;
}
/** Retrieves index under which user-specified internalformat can be found in
* copy_tex_image_2d_internal_format_ordering array.
*
* @param internalformat GLES internal format to look for.
*
* @return Index >= 0 if successful, -1 otherwise.
**/
int RequiredCase::getIndexOfCopyTexImage2DInternalFormat(GLenum internalformat)
{
int max_index = DE_LENGTH_OF_ARRAY(copyTexImage2DInternalFormatOrdering);
for (int index = 0; index < max_index; ++index)
{
if (copyTexImage2DInternalFormatOrdering[index] == internalformat)
return index;
}
return -1;
}
/** Retrieves index under which user-specified internalformat can be found in
* fbo_effective_internal_format_ordering array.
*
* @param internalformat GLES internal format to look for.
*
* @return Index >= 0 if successful, -1 otherwise.
**/
int RequiredCase::getIndexOfFramebufferEffectiveInternalFormat(GLenum internalformat)
{
int max_index = DE_LENGTH_OF_ARRAY(fboEffectiveInternalFormatOrdering);
for (int index = 0; index < max_index; ++index)
{
if (fboEffectiveInternalFormatOrdering[index] == internalformat)
return index;
}
return -1;
}
/** Takes four pixels (described by _pixel_data structures) making up
* the 2x2 texture used for source objects, and converts the representation
* to raw data that can later be fed to glTexImage2D(), glTexImage3D() etc.
* calls.
*
* NOTE: It is caller's responsibility to free the returned buffer when no
* longer used. Use free() function to deallocate the resource.
*
* @param topleft Instance of _pixel_data describing top-left corner.
* @param topright Instance of _pixel_data describing top-right corner.
* @param bottomleft Instance of _pixel_data describing bottom-left corner.
* @param bottomright Instance of _pixel_data describing bottom-right corner.
*
* @return Pointer to the buffer or NULL if failed.
**/
bool RequiredCase::getRawDataFromPixelData(std::vector<char>& result, PixelData topleft, PixelData topright,
PixelData bottomleft, PixelData bottomright)
{
ChannelOrder channel_order = CHANNEL_ORDER_UNKNOWN;
GLenum format = GL_NONE;
GLenum internalformat = topleft.data_internalformat;
unsigned int n_bytes_needed = 0;
unsigned int n_bytes_per_pixel = 0;
unsigned int n_pixel = 0;
const PixelData* pixels[] = { &bottomleft, &bottomright, &topleft, &topright };
char* result_traveller = DE_NULL;
GLenum type = topleft.data_type;
// Sanity checks
DE_ASSERT(topleft.data_internalformat == topright.data_internalformat);
DE_ASSERT(topleft.data_internalformat == bottomleft.data_internalformat);
DE_ASSERT(topleft.data_internalformat == bottomright.data_internalformat);
DE_ASSERT(topleft.data_type == topright.data_type);
DE_ASSERT(topleft.data_type == bottomleft.data_type);
DE_ASSERT(topleft.data_type == bottomright.data_type);
// Allocate the buffer
if (!getFormatForInternalformat(internalformat, &format))
{
DE_ASSERT(0);
return false;
} // if (no format known for requested internalformat)
if (!getChannelOrderForInternalformatAndType(internalformat, type, &channel_order))
{
DE_ASSERT(0);
return false;
} // if (no channel order known for internalformat+type combination)
// special case for GL_HALF_FLOAT, treat it as a FLOAT
if (type == GL_HALF_FLOAT)
n_bytes_per_pixel = getSizeOfPixel(format, GL_FLOAT);
else
n_bytes_per_pixel = getSizeOfPixel(format, type);
n_bytes_needed = TEXTURE_WIDTH * TEXTURE_HEIGHT * n_bytes_per_pixel;
if (n_bytes_needed == 0)
{
DE_ASSERT(0);
return false;
}
result.resize(n_bytes_needed);
// Fill the raw data buffer with data.
result_traveller = &result[0];
for (n_pixel = 0; n_pixel < sizeof(pixels) / sizeof(pixels[0]); ++n_pixel)
{
const ChannelData* channels[] = { NULL, NULL, NULL, NULL }; /* We need up to four channels */
int n_bits_for_channel_0 = 0;
int n_bits_for_channel_1 = 0;
int n_bits_for_channel_2 = 0;
int n_bits_for_channel_3 = 0;
const PixelData* pixel_ptr = pixels[n_pixel];
switch (channel_order)
{
case CHANNEL_ORDER_ABGR:
{
channels[0] = &pixel_ptr->alpha;
channels[1] = &pixel_ptr->blue;
channels[2] = &pixel_ptr->green;
channels[3] = &pixel_ptr->red;
break;
}
case CHANNEL_ORDER_BGR:
{
channels[0] = &pixel_ptr->blue;
channels[1] = &pixel_ptr->green;
channels[2] = &pixel_ptr->red;
break;
}
case CHANNEL_ORDER_BGRA:
{
channels[0] = &pixel_ptr->blue;
channels[1] = &pixel_ptr->green;
channels[2] = &pixel_ptr->red;
channels[3] = &pixel_ptr->alpha;
break;
}
case CHANNEL_ORDER_R:
{
channels[0] = &pixel_ptr->red;
break;
}
case CHANNEL_ORDER_RG:
{
channels[0] = &pixel_ptr->red;
channels[1] = &pixel_ptr->green;
break;
}
case CHANNEL_ORDER_RGB:
{
channels[0] = &pixel_ptr->red;
channels[1] = &pixel_ptr->green;
channels[2] = &pixel_ptr->blue;
break;
}
case CHANNEL_ORDER_RGBA:
{
channels[0] = &pixel_ptr->red;
channels[1] = &pixel_ptr->green;
channels[2] = &pixel_ptr->blue;
channels[3] = &pixel_ptr->alpha;
break;
}
default:
{
// Unrecognized channel order
DE_ASSERT(0);
}
}
// Pack the channel data, depending on channel sizes
if (((channels[0] != NULL) &&
!getNumberOfBitsForChannelDataType(channels[0]->data_type, &n_bits_for_channel_0)) ||
((channels[1] != NULL) &&
!getNumberOfBitsForChannelDataType(channels[1]->data_type, &n_bits_for_channel_1)) ||
((channels[2] != NULL) &&
!getNumberOfBitsForChannelDataType(channels[2]->data_type, &n_bits_for_channel_2)) ||
((channels[3] != NULL) &&
!getNumberOfBitsForChannelDataType(channels[3]->data_type, &n_bits_for_channel_3)))
{
// Unrecognized data type
DE_ASSERT(0);
return false;
} // if (could not determine number of bits making up any of the channels)
// NOTE: We will read HALF_FLOAT data as FLOAT data (32 bit) to avoid conversion before passing the data to GL
if (channels[0] != NULL && channels[1] != NULL && channels[2] != NULL && channels[3] != NULL)
{
// RGBA32
if (type == GL_HALF_FLOAT || ((n_bits_for_channel_0 == 32) && (n_bits_for_channel_1 == 32) &&
(n_bits_for_channel_2 == 32) && (n_bits_for_channel_3 == 32)))
{
unsigned int* result_traveller32 = (unsigned int*)result_traveller;
*result_traveller32 = channels[0]->unsigned_integer_data;
result_traveller32++;
*result_traveller32 = channels[1]->unsigned_integer_data;
result_traveller32++;
*result_traveller32 = channels[2]->unsigned_integer_data;
result_traveller32++;
*result_traveller32 = channels[3]->unsigned_integer_data;
result_traveller += 4 * 4;
}
else
// RGBA16
if (n_bits_for_channel_0 == 16 && n_bits_for_channel_1 == 16 && n_bits_for_channel_2 == 16 &&
n_bits_for_channel_3 == 16)
{
unsigned short* result_traveller16 = (unsigned short*)result_traveller;
*result_traveller16 = channels[0]->unsigned_short_data;
result_traveller16++;
*result_traveller16 = channels[1]->unsigned_short_data;
result_traveller16++;
*result_traveller16 = channels[2]->unsigned_short_data;
result_traveller16++;
*result_traveller16 = channels[3]->unsigned_short_data;
result_traveller += 8;
}
else
// RGBA4
if (n_bits_for_channel_0 == 4 && n_bits_for_channel_1 == 4 && n_bits_for_channel_2 == 4 &&
n_bits_for_channel_3 == 4)
{
unsigned short* result_traveller16 = (unsigned short*)result_traveller;
*result_traveller16 = (channels[0]->unsigned_byte_data << 12) + (channels[1]->unsigned_byte_data << 8) +
(channels[2]->unsigned_byte_data << 4) + channels[3]->unsigned_byte_data;
result_traveller += 2;
}
else
// RGBA8
if (n_bits_for_channel_0 == 8 && n_bits_for_channel_1 == 8 && n_bits_for_channel_2 == 8 &&
n_bits_for_channel_3 == 8)
{
*result_traveller = channels[0]->unsigned_byte_data;
result_traveller++;
*result_traveller = channels[1]->unsigned_byte_data;
result_traveller++;
*result_traveller = channels[2]->unsigned_byte_data;
result_traveller++;
*result_traveller = channels[3]->unsigned_byte_data;
result_traveller++;
}
else
// RGB5A1
if (n_bits_for_channel_0 == 5 && n_bits_for_channel_1 == 5 && n_bits_for_channel_2 == 5 &&
n_bits_for_channel_3 == 1)
{
unsigned short* result_traveller16 = (unsigned short*)result_traveller;
*result_traveller16 = (channels[0]->unsigned_byte_data << 11) + (channels[1]->unsigned_byte_data << 6) +
(channels[2]->unsigned_byte_data << 1) + channels[3]->unsigned_byte_data;
result_traveller += 2;
}
else
// RGB10A2_REV
if (n_bits_for_channel_0 == 2 && n_bits_for_channel_1 == 10 && n_bits_for_channel_2 == 10 &&
n_bits_for_channel_3 == 10)
{
unsigned int* result_traveller32 = (unsigned int*)result_traveller;
DE_ASSERT(channels[0]->data_type == CHANNEL_DATA_TYPE_UNSIGNED_BYTE_2BITS);
DE_ASSERT(channels[1]->data_type == CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS);
DE_ASSERT(channels[2]->data_type == CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS);
DE_ASSERT(channels[3]->data_type == CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS);
*result_traveller32 = (channels[0]->unsigned_byte_data << 30) +
(channels[1]->unsigned_short_data << 20) +
(channels[2]->unsigned_short_data << 10) + channels[3]->unsigned_short_data;
result_traveller += 4;
}
else
{
// Unsupported bit layout
DE_ASSERT(0);
return false;
}
}
else if (channels[0] != NULL && channels[1] != NULL && channels[2] != NULL)
{
// RGB32
if ((type == GL_HALF_FLOAT) ||
((n_bits_for_channel_0 == 32) && (n_bits_for_channel_1 == 32) && (n_bits_for_channel_2 == 32)))
{
unsigned int* result_traveller32 = (unsigned int*)result_traveller;
*result_traveller32 = channels[0]->unsigned_integer_data;
result_traveller32++;
*result_traveller32 = channels[1]->unsigned_integer_data;
result_traveller32++;
*result_traveller32 = channels[2]->unsigned_integer_data;
result_traveller += 3 * 4;
}
else
// RGB8
if (n_bits_for_channel_0 == 8 && n_bits_for_channel_1 == 8 && n_bits_for_channel_2 == 8)
{
*result_traveller = channels[0]->unsigned_byte_data;
result_traveller++;
*result_traveller = channels[1]->unsigned_byte_data;
result_traveller++;
*result_traveller = channels[2]->unsigned_byte_data;
result_traveller++;
}
else
// RGB565
if (n_bits_for_channel_0 == 5 && n_bits_for_channel_1 == 6 && n_bits_for_channel_2 == 5)
{
unsigned short* result_traveller16 = (unsigned short*)result_traveller;
*result_traveller16 = (channels[0]->unsigned_byte_data << 11) + (channels[1]->unsigned_byte_data << 5) +
(channels[2]->unsigned_byte_data);
result_traveller += 2;
}
else
{
// Unsupported bit layout
DE_ASSERT(0);
return false;
}
}
else if (channels[0] != NULL && channels[1] != NULL)
{
// RG32
if ((type == GL_HALF_FLOAT) || ((n_bits_for_channel_0 == 32) && (n_bits_for_channel_1 == 32)))
{
unsigned int* result_traveller32 = (unsigned int*)result_traveller;
*result_traveller32 = channels[0]->unsigned_integer_data;
result_traveller32++;
*result_traveller32 = channels[1]->unsigned_integer_data;
result_traveller += 8;
}
else
// RG16
if (n_bits_for_channel_0 == 16 && n_bits_for_channel_1 == 16)
{
unsigned short* result_traveller16 = (unsigned short*)result_traveller;
*result_traveller16 = channels[0]->unsigned_short_data;
result_traveller16++;
*result_traveller16 = channels[1]->unsigned_short_data;
result_traveller += 4;
}
else
// RG8
if (n_bits_for_channel_0 == 8 && n_bits_for_channel_1 == 8)
{
*result_traveller = channels[0]->unsigned_byte_data;
result_traveller++;
*result_traveller = channels[1]->unsigned_byte_data;
result_traveller++;
}
else
{
// Unsupported bit layout
DE_ASSERT(0);
return false;
}
}
else if (channels[0] != NULL)
{
// R32
if (type == GL_HALF_FLOAT || n_bits_for_channel_0 == 32)
{
unsigned int* result_traveller32 = (unsigned int*)result_traveller;
*result_traveller32 = channels[0]->unsigned_integer_data;
;
result_traveller += 4;
}
else
// R16
if (n_bits_for_channel_0 == 16)
{
unsigned short* result_traveller16 = (unsigned short*)result_traveller;
*result_traveller16 = channels[0]->unsigned_short_data;
result_traveller += 2;
}
else
// R8
if (n_bits_for_channel_0 == 8)
{
*result_traveller = channels[0]->unsigned_byte_data;
result_traveller++;
}
else
{
// Unsupported bit layout
DE_ASSERT(0);
return false;
}
}
else
{
// Unrecognized channel data layout.
DE_ASSERT(0);
return false;
}
} // for (all pixels)
return true;
}
/** Retrieves number of bits used for a single channel, were it stored in
* @param channel_data_type internal channel data type.
*
* @param channel_data_type Channel data type to consider.
* @param out_n_bits Deref will be used to store the amount of bits.
* Cannot be NULL.
*
* @return GTFtrue if successful, GTFfalse otherwise.
**/
bool RequiredCase::getNumberOfBitsForChannelDataType(ChannelDataType channel_data_type, int* out_n_bits)
{
DE_ASSERT(out_n_bits != NULL);
switch (channel_data_type)
{
case CHANNEL_DATA_TYPE_SIGNED_BYTE_8BITS:
*out_n_bits = 8;
return true;
case CHANNEL_DATA_TYPE_SIGNED_INTEGER_32BITS:
*out_n_bits = 32;
return true;
case CHANNEL_DATA_TYPE_SIGNED_SHORT_16BITS:
*out_n_bits = 16;
return true;
case CHANNEL_DATA_TYPE_UNSIGNED_BYTE_1BIT:
*out_n_bits = 1;
return true;
case CHANNEL_DATA_TYPE_UNSIGNED_BYTE_2BITS:
*out_n_bits = 2;
return true;
case CHANNEL_DATA_TYPE_UNSIGNED_BYTE_4BITS:
*out_n_bits = 4;
return true;
case CHANNEL_DATA_TYPE_UNSIGNED_BYTE_5BITS:
*out_n_bits = 5;
return true;
case CHANNEL_DATA_TYPE_UNSIGNED_BYTE_6BITS:
*out_n_bits = 6;
return true;
case CHANNEL_DATA_TYPE_UNSIGNED_BYTE_8BITS:
*out_n_bits = 8;
return true;
case CHANNEL_DATA_TYPE_UNSIGNED_INTEGER_32BITS:
*out_n_bits = 32;
return true;
case CHANNEL_DATA_TYPE_UNSIGNED_SHORT_10BITS:
*out_n_bits = 10;
return true;
case CHANNEL_DATA_TYPE_UNSIGNED_SHORT_16BITS:
*out_n_bits = 16;
return true;
case CHANNEL_DATA_TYPE_FLOAT:
*out_n_bits = 32;
return true;
case CHANNEL_DATA_TYPE_NONE:
return true;
}
// Unrecognized channel data type
DE_ASSERT(0);
return false;
}
/** Retrieves information on channel order for user-specified internal format+type
* combination.
*
* @param internalformat GLES internal format to consider.
* @param type GLES type to consider.
* @param out_channel_order Deref will be used to store requested information.
* Cannot be NULL.
*
* @return GTFtrue if successful, GTFfalse otherwise.
**/
bool RequiredCase::getChannelOrderForInternalformatAndType(GLenum internalformat, GLenum type,
ChannelOrder* out_channel_order)
{
GLenum format = GL_NONE;
DE_ASSERT(out_channel_order != NULL);
// Determine the order
if (!getFormatForInternalformat(internalformat, &format))
{
DE_ASSERT(0);
return false;
}
switch (format)
{
case GL_RED:
case GL_RED_INTEGER:
// Only one order is sane
*out_channel_order = CHANNEL_ORDER_R;
return true;
case GL_RG:
case GL_RG_INTEGER:
// Only one order is sane
*out_channel_order = CHANNEL_ORDER_RG;
return true;
case GL_RGB:
case GL_RGB_INTEGER:
// Two options here
if (type == GL_UNSIGNED_INT_10F_11F_11F_REV || type == GL_UNSIGNED_INT_5_9_9_9_REV)
*out_channel_order = CHANNEL_ORDER_BGR;
else
*out_channel_order = CHANNEL_ORDER_RGB;
return true;
case GL_RGBA:
case GL_RGBA_INTEGER:
// Two options here
if (type == GL_UNSIGNED_INT_2_10_10_10_REV)
*out_channel_order = CHANNEL_ORDER_ABGR;
else
*out_channel_order = CHANNEL_ORDER_RGBA;
return true;
default:
// Unrecognized format?
DE_ASSERT(0);
return false;
}
return false;
}
/** Creates objects required to support non color-renderable internalformats of texture objects.
* There are different objects created for each combination of float/integer/unsigned integer internalformats
* of source and destination texture objects created.
*
* @param f_src_f_dst_internalformat_ptr Deref will be used to store created object IDs for
* float source and float destination texture object.
* Cannot be NULL.
* @param i_src_i_dst_internalformat_ptr Deref will be used to store created object IDs for
* integer source and integer destination texture object.
* Cannot be NULL.
* @param ui_src_ui_dst_internalformat_ptr Deref will be used to store created object IDs for
* unsigned integer source and unsigned integer destination texture object.
* Cannot be NULL.
* @param source_attachment_type Tells what GL object (or which texture target)
* should be used as a read buffer for a glCopyTexImage2D call.
* @param destination_attachment_type Tells which texture target should be used for
* a glCopyTexImage2D() call.
*
* @return true if successful, false otherwise.
*/
bool RequiredCase::generateObjectsToSupportNonColorRenderableInternalformats()
{
// if (failed to prepare objects for float->float shader-based checks)
if (!prepareSupportForNonRenderableTexture(m_f_src_f_dst_internalformat, DATA_SAMPLER_FLOAT, DATA_SAMPLER_FLOAT,
m_source_attachment_type, m_destination_attachment_type))
{
return false;
}
// if (failed to prepare objects for int->int shader-based checks)
if (!prepareSupportForNonRenderableTexture(m_i_src_i_dst_internalformat, DATA_SAMPLER_INTEGER, DATA_SAMPLER_INTEGER,
m_source_attachment_type, m_destination_attachment_type))
{
return false;
}
// if (failed to prepare objects for uint->uint shader-based checks)
if (!prepareSupportForNonRenderableTexture(m_ui_src_ui_dst_internalformat, DATA_SAMPLER_UNSIGNED_INTEGER,
DATA_SAMPLER_UNSIGNED_INTEGER, m_source_attachment_type,
m_destination_attachment_type))
{
return false;
}
return true;
}
/** Creates and prepares buffer and program objects to be used for non-renderable texture support.
* In case the destination texture's internalformat is not renderable,
* glReadPixels() cannot be issued to retrieve texture object data.
* Instead, a program object is used to retrieve and compare source and destination texture data.
* This function creates and prepares all objects needed to support this approach.
*
* @param objects_ptr Deref will be used for storing generated object ids. Cannot be NULL.
* @param src_texture_sampler_type Type of the sampler to be used for sampling source texture (float/int/uint).
* @param dst_texture_sampler_type Type of the sampler to be used for sampling destination texture (float/int/uint).
* @param source_attachment_type
* @param destination_attachment_type
*
* @return true if the operation succeeded (no error was generated),
* false otherwise.
*/
bool RequiredCase::prepareSupportForNonRenderableTexture(NonRenderableInternalformatSupportObjects& objects,
DataSamplerType src_texture_sampler_type,
DataSamplerType dst_texture_sampler_type,
GLenum source_attachment_type,
GLenum destination_attachment_type)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
const GLuint compare_result_size = NUMBER_OF_POINTS_TO_DRAW * sizeof(GLint);
GLuint destination_buffer_data_size = 0;
GLuint source_buffer_data_size = 0;
const GLchar* varying_names[] = { "compare_result", "src_texture_pixel_values", "dst_texture_pixel_values" };
const GLsizei varying_names_count = DE_LENGTH_OF_ARRAY(varying_names);
// Create program and shader objects.
objects.program_object_id = gl.createProgram();
objects.fragment_shader_object_id = gl.createShader(GL_FRAGMENT_SHADER);
objects.vertex_shader_object_id = gl.createShader(GL_VERTEX_SHADER);
// Generate buffer and transform feedback objects.
gl.genTransformFeedbacks(1, &objects.transform_feedback_object_id);
gl.genBuffers(1, &objects.comparison_result_buffer_object_id);
gl.genBuffers(1, &objects.src_texture_pixels_buffer_object_id);
gl.genBuffers(1, &objects.dst_texture_pixels_buffer_object_id);
gl.genBuffers(1, &objects.src_texture_coordinates_buffer_object_id);
gl.genBuffers(1, &objects.dst_texture_coordinates_buffer_object_id);
// Calculate texture data size depending on source and destination sampler types.
if (!calculateBufferDataSize(src_texture_sampler_type, &source_buffer_data_size))
return false;
if (!calculateBufferDataSize(dst_texture_sampler_type, &destination_buffer_data_size))
return false;
// Initialize buffer objects storage.
gl.bindBuffer(GL_ARRAY_BUFFER, objects.comparison_result_buffer_object_id);
gl.bufferData(GL_ARRAY_BUFFER, compare_result_size, NULL, GL_STATIC_DRAW);
GLU_EXPECT_NO_ERROR(gl.getError(), "glBufferData");
gl.bindBuffer(GL_ARRAY_BUFFER, objects.src_texture_pixels_buffer_object_id);
gl.bufferData(GL_ARRAY_BUFFER, source_buffer_data_size, NULL, GL_STATIC_DRAW);
GLU_EXPECT_NO_ERROR(gl.getError(), "glBufferData");
gl.bindBuffer(GL_ARRAY_BUFFER, objects.dst_texture_pixels_buffer_object_id);
gl.bufferData(GL_ARRAY_BUFFER, destination_buffer_data_size, NULL, GL_STATIC_DRAW);
GLU_EXPECT_NO_ERROR(gl.getError(), "glBufferData");
// Initialize texture coordinates
gl.bindBuffer(GL_ARRAY_BUFFER, objects.src_texture_coordinates_buffer_object_id);
gl.bufferData(GL_ARRAY_BUFFER, TEXTURE_COORDINATES_ARRAY_SIZE, getTexCoordinates(source_attachment_type),
GL_STATIC_DRAW);
GLU_EXPECT_NO_ERROR(gl.getError(), "glBufferData");
gl.vertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 0, 0);
GLU_EXPECT_NO_ERROR(gl.getError(), "glVertexAttribPointer");
gl.bindBuffer(GL_ARRAY_BUFFER, objects.dst_texture_coordinates_buffer_object_id);
gl.bufferData(GL_ARRAY_BUFFER, TEXTURE_COORDINATES_ARRAY_SIZE, getTexCoordinates(destination_attachment_type),
GL_STATIC_DRAW);
GLU_EXPECT_NO_ERROR(gl.getError(), "glBufferData");
gl.vertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0);
GLU_EXPECT_NO_ERROR(gl.getError(), "glVertexAttribPointer");
gl.bindBuffer(GL_ARRAY_BUFFER, 0);
// Bind buffer objects to GL_TRANSFORM_FEEDBACK target at specific indices.
gl.bindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, COMPARISON_RESULT_BUFFER_OBJECT_INDEX,
objects.comparison_result_buffer_object_id, 0, compare_result_size);
gl.bindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, SOURCE_TEXTURE_PIXELS_BUFFER_OBJECT_INDEX,
objects.src_texture_pixels_buffer_object_id, 0, source_buffer_data_size);
gl.bindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, DESTINATION_TEXTURE_PIXELS_BUFFER_OBJECT_INDEX,
objects.dst_texture_pixels_buffer_object_id, 0, destination_buffer_data_size);
// Specify values for transform feedback.
gl.transformFeedbackVaryings(objects.program_object_id, varying_names_count, varying_names, GL_SEPARATE_ATTRIBS);
GLU_EXPECT_NO_ERROR(gl.getError(), "glTransformFeedbackVaryings");
// Prepare program and shader objects.
if (!prepareProgramAndShaderObjectsToSupportNonRenderableTexture(
objects.program_object_id, objects.fragment_shader_object_id, objects.vertex_shader_object_id,
src_texture_sampler_type, dst_texture_sampler_type))
{
return false;
}
// Retrieve uniform locations.
if (!getUniformLocations(objects.program_object_id, &objects.src_2D_texture_uniform_location,
&objects.src_2DArray_texture_uniform_location, &objects.src_3D_texture_uniform_location,
&objects.src_Cube_texture_uniform_location, &objects.dst_2D_texture_uniform_location,
&objects.dst_Cube_texture_uniform_location, &objects.channels_to_compare_uniform_location,
&objects.samplers_to_use_uniform_location))
{
return false;
}
return true;
}
/** Calculate size needed for texture object data storage to successfully
* capture all the data needed.
* For simplicity, we assume all internalformats of our concern use four
* components. It's not a dreadful waste of memory, given amount of data
* we will be checking for later on anyway.
*
* @param _data_sampler_type Type of the sampler used to read the data.
* @param texture_data_size_ptr Deref will be used to stored calculated result.
* Cannot be NULL.
*
* @return true if successful, false otherwise.
*/
bool RequiredCase::calculateBufferDataSize(DataSamplerType sampler_type, GLuint* buffer_data_size_ptr)
{
if (buffer_data_size_ptr == NULL)
{
m_testCtx.getLog() << tcu::TestLog::Message << "NULL pointer passed as a deref to store calculated result."
<< tcu::TestLog::EndMessage;
return false;
}
switch (sampler_type)
{
case DATA_SAMPLER_FLOAT:
*buffer_data_size_ptr = NUMBER_OF_POINTS_TO_DRAW * NUMBER_OF_ELEMENTS_IN_VEC4 * sizeof(GLfloat);
return true;
case DATA_SAMPLER_INTEGER:
*buffer_data_size_ptr = NUMBER_OF_POINTS_TO_DRAW * NUMBER_OF_ELEMENTS_IN_VEC4 * sizeof(GLint);
return true;
case DATA_SAMPLER_UNSIGNED_INTEGER:
*buffer_data_size_ptr = NUMBER_OF_POINTS_TO_DRAW * NUMBER_OF_ELEMENTS_IN_VEC4 * sizeof(GLuint);
return true;
default:
m_testCtx.getLog() << tcu::TestLog::Message << "Unrecognized data sampler type." << tcu::TestLog::EndMessage;
return false;
}
return true;
}
/** Texture coordinates to use when glReadPixels can't be used to read back the data.
* Different coordinates for different attachment types.
*
* @param attachment_type Texture attachment type
*
* @return Array of 4 3-tuples of texture coordinates to use
*/
const float* RequiredCase::getTexCoordinates(GLenum attachment_type) const
{
static const float texture_coordinates[7][NUMBER_OF_POINTS_TO_DRAW * 4] = {
// 2D texture, 3D texture and 2D array
{ 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0 },
// Cube Map NEGATIVE_X
{ -1, .99f, -.99f, 0, -1, .99f, .99f, 0, -1, -.99f, .99f, 0, -1, -.99f, -.99f, 0 },
// Cube Map NEGATIVE_Y
{ -.99f, -1, .99f, 0, .99f, -1, .99f, 0, .99f, -1, -.99f, 0, -.99f, -1, -.99f, 0 },
// Cube Map NEGATIVE_Z
{ .99f, .99f, -1, 0, -.99f, .99f, -1, 0, -.99f, -.99f, -1, 0, .99f, -.99f, -1, 0 },
// Cube Map POSITIVE_X
{ 1, .99f, .99f, 0, 1, .99f, -.99f, 0, 1, -.99f, -.99f, 0, 1, -.99f, .99f, 0 },
// Cube Map POSITIVE_Y
{ -.99f, 1, -.99f, 0, .99f, 1, -.99f, 0, .99f, 1, .99f, 0, -.99f, 1, .99f, 0 },
// Cube Map POSITIVE_Z
{ -.99f, .99f, 1, 0, .99f, .99f, 1, 0, .99f, -.99f, 1, 0, -.99f, -.99f, 1, 0 },
};
switch (attachment_type)
{
case GL_TEXTURE_2D:
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_3D:
return texture_coordinates[0];
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
return texture_coordinates[1];
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
return texture_coordinates[2];
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
return texture_coordinates[3];
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
return texture_coordinates[4];
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
return texture_coordinates[5];
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
return texture_coordinates[6];
default:
DE_ASSERT(!"Invalid attachment type!");
return NULL;
}
}
/** Sets source for shader objects, compiles them and attaches to program object.
* Program object can be used to verify whether copying texture image works correctly if
* non-renderable internalformats are considered.
* If all the operations succeeded, the program object is activated.
*
* @param program_object_id ID of a program object to be initialized.
* The value must be a valid program object ID.
* @param fragment_shader_object_id ID of a fragment shader object to be initialized.
* The value must be a valid fragment shader object ID.
* @param vertex_shader_object_id ID of a vertex shader object to be initialized.
* The value must be a valid vertex shader object ID.
* @param src_texture_sampler_type Sampler to be used for sampling source texture object.
* @param dst_texture_sampler_type Sampler to be used for sampling destination texture object.
*
* @return true if the operation succeeded, false otherwise.
*/
bool RequiredCase::prepareProgramAndShaderObjectsToSupportNonRenderableTexture(GLuint program_object_id,
GLuint fragment_shader_object_id,
GLuint vertex_shader_object_id,
DataSamplerType src_texture_sampler_type,
DataSamplerType dst_texture_sampler_type)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// Attach shader objects to program object.
gl.attachShader(program_object_id, fragment_shader_object_id);
gl.attachShader(program_object_id, vertex_shader_object_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glAttachShader");
if (!setSourceForShaderObjectsUsedForNonRenderableTextureSupport(
fragment_shader_object_id, vertex_shader_object_id, src_texture_sampler_type, dst_texture_sampler_type))
{
return false;
}
if (!compileAndCheckShaderCompilationStatus(fragment_shader_object_id))
return false;
if (!compileAndCheckShaderCompilationStatus(vertex_shader_object_id))
return false;
if (!linkAndCheckProgramLinkStatus(program_object_id))
return false;
return true;
}
/** Assigns source code to fragment/vertex shaders which will then be used to verify texture data..
*
* @param fragment_shader_object_id ID of an already created fragment shader.
* @param vertex_shader_object_id ID of an already created vertex shader.
* @param src_texture_sampler_type Type of sampler to be used for sampling source texture object (float/int/uint).
* @param dst_texture_sampler_type Type of sampler to be used for sampling destination texture object (float/int/uint).
*
* @return true if successful, false otherwise.
*/
bool RequiredCase::setSourceForShaderObjectsUsedForNonRenderableTextureSupport(GLuint fragment_shader_object_id,
GLuint vertex_shader_object_id,
DataSamplerType src_texture_sampler_type,
DataSamplerType dst_texture_sampler_type)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
std::map<std::string, std::string> specializationMap;
const GLchar* fragment_shader_source = { "#version 300 es\n"
"void main()\n"
"{}\n" };
static std::string shader_source[3];
const GLchar* vertex_shader_source = NULL;
const GLchar* source = "#version 300 es\n"
"\n"
" uniform highp ${SAMPLER_PREFIX}sampler2D dst_texture2D;\n"
" uniform highp ${SAMPLER_PREFIX}samplerCube dst_textureCube;\n"
" uniform highp ${SAMPLER_PREFIX}sampler2D src_texture2D;\n"
" uniform highp ${SAMPLER_PREFIX}sampler3D src_texture3D;\n"
" uniform highp ${SAMPLER_PREFIX}sampler2DArray src_texture2DArray;\n"
" uniform highp ${SAMPLER_PREFIX}samplerCube src_textureCube;\n"
" uniform int channels_to_compare;\n"
" uniform int samplers_to_use;\n"
"layout(location = 0) in vec4 dst_texture_coord;\n"
"layout(location = 1) in vec4 src_texture_coord;\n"
"${OUT_QUALIFIER} out ${OUT_TYPE} dst_texture_pixel_values;\n"
"${OUT_QUALIFIER} out ${OUT_TYPE} src_texture_pixel_values;\n"
"flat out int compare_result;\n"
"\n"
"void main()\n"
"{\n"
" ${OUT_TYPE} src_texture_data;\n"
" ${OUT_TYPE} dst_texture_data;\n"
" const ${EPSILON_TYPE} epsilon = ${EPSILON_VALUE};\n"
" int result = 1;\n"
" bool compare_red = (channels_to_compare & 0x1) != 0;\n"
" bool compare_green = (channels_to_compare & 0x2) != 0;\n"
" bool compare_blue = (channels_to_compare & 0x4) != 0;\n"
" bool compare_alpha = (channels_to_compare & 0x8) != 0;\n"
" int src_sampler = samplers_to_use & 0xff;\n"
" int dst_sampler = samplers_to_use >> 8;\n"
"\n"
" if (src_sampler == 0)\n"
" {\n"
" src_texture_data = texture(src_texture2D, src_texture_coord.xy);\n"
" }\n"
" else if (src_sampler == 1)\n"
" {\n"
" src_texture_data = texture(src_texture3D, src_texture_coord.xyz);\n"
" }\n"
" else if (src_sampler == 2)\n"
" {\n"
" src_texture_data = texture(src_texture2DArray, src_texture_coord.xyz);\n"
" }\n"
" else\n"
" {\n"
" src_texture_data = texture(src_textureCube, src_texture_coord.xyz);\n"
" }\n"
"\n"
" if (dst_sampler == 0)\n"
" {\n"
" dst_texture_data = texture(dst_texture2D, dst_texture_coord.xy);\n"
" }\n"
" else\n"
" {\n"
" dst_texture_data = texture(dst_textureCube, dst_texture_coord.xyz);\n"
" }\n"
"\n"
" if (compare_red && ${FN}(src_texture_data.x - dst_texture_data.x) > epsilon)\n"
" {\n"
" result = 0;\n"
" }\n"
" if (compare_green && ${FN}(src_texture_data.y - dst_texture_data.y) > epsilon)\n"
" {\n"
" result = 0;\n"
" }\n"
" if (compare_blue && ${FN}(src_texture_data.z - dst_texture_data.z) > epsilon)\n"
" {\n"
" result = 0;\n"
" }\n"
" if (compare_alpha && ${FN}(src_texture_data.w - dst_texture_data.w) > epsilon)\n"
" {\n"
" result = 0;\n"
" }\n"
"\n"
" compare_result = result;\n"
" dst_texture_pixel_values = dst_texture_data;\n"
" src_texture_pixel_values = src_texture_data;\n"
"}\n";
switch (src_texture_sampler_type)
{
case DATA_SAMPLER_FLOAT:
{
switch (dst_texture_sampler_type)
{
case DATA_SAMPLER_FLOAT:
{
specializationMap["SAMPLER_PREFIX"] = " ";
specializationMap["OUT_QUALIFIER"] = " ";
specializationMap["OUT_TYPE"] = " vec4";
specializationMap["EPSILON_TYPE"] = "float";
specializationMap["EPSILON_VALUE"] = "(1.0/255.0)";
specializationMap["FN"] = "abs";
shader_source[0] = tcu::StringTemplate(source).specialize(specializationMap);
vertex_shader_source = shader_source[0].c_str();
break;
}
default:
{
m_testCtx.getLog() << tcu::TestLog::Message << "Unrecognized sampler type for destination texture object."
<< tcu::TestLog::EndMessage;
return false;
}
}
break;
}
case DATA_SAMPLER_INTEGER:
{
switch (dst_texture_sampler_type)
{
case DATA_SAMPLER_INTEGER:
{
specializationMap["SAMPLER_PREFIX"] = "i";
specializationMap["OUT_QUALIFIER"] = "flat";
specializationMap["OUT_TYPE"] = "ivec4";
specializationMap["EPSILON_TYPE"] = "int";
specializationMap["EPSILON_VALUE"] = "0";
specializationMap["FN"] = "abs";
shader_source[1] = tcu::StringTemplate(source).specialize(specializationMap);
vertex_shader_source = shader_source[1].c_str();
break;
}
default:
{
m_testCtx.getLog() << tcu::TestLog::Message
<< "Unrecognized type of internalformat of destination texture object."
<< tcu::TestLog::EndMessage;
return false;
}
}
break;
}
case DATA_SAMPLER_UNSIGNED_INTEGER:
{
switch (dst_texture_sampler_type)
{
case DATA_SAMPLER_UNSIGNED_INTEGER:
{
specializationMap["SAMPLER_PREFIX"] = "u";
specializationMap["OUT_QUALIFIER"] = "flat";
specializationMap["OUT_TYPE"] = "uvec4";
specializationMap["EPSILON_TYPE"] = "uint";
specializationMap["EPSILON_VALUE"] = "0u";
specializationMap["FN"] = "";
shader_source[2] = tcu::StringTemplate(source).specialize(specializationMap);
vertex_shader_source = shader_source[2].c_str();
break;
}
default:
{
m_testCtx.getLog() << tcu::TestLog::Message
<< "Unrecognized type of internalformat of destination texture object."
<< tcu::TestLog::EndMessage;
return false;
}
}
break;
}
default:
{
m_testCtx.getLog() << tcu::TestLog::Message << "Unrecognized type of internalformat of source texture object."
<< tcu::TestLog::EndMessage;
return false;
}
}
// Set shader source for fragment shader object.
gl.shaderSource(fragment_shader_object_id, 1 /* part */, &fragment_shader_source, NULL);
GLU_EXPECT_NO_ERROR(gl.getError(), "glShaderSource");
// Set shader source for vertex shader object.
gl.shaderSource(vertex_shader_object_id, 1 /* part */, &vertex_shader_source, NULL);
GLU_EXPECT_NO_ERROR(gl.getError(), "glShaderSource");
return true;
}
/** Compiles a shader object and returns compilation status.
*
* @param shader_object_id ID of a shader object to be compiled.
*
* @return true in case operation succeeded (no error was generated and compilation was successful),
* false otherwise.
*/
bool RequiredCase::compileAndCheckShaderCompilationStatus(GLuint shader_object_id)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// Compile shader object.
gl.compileShader(shader_object_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glCompileShader");
// Check if compilation was successful.
GLint shader_compile_status = GL_FALSE;
gl.getShaderiv(shader_object_id, GL_COMPILE_STATUS, &shader_compile_status);
GLU_EXPECT_NO_ERROR(gl.getError(), "glGetShaderiv");
if (GL_FALSE == shader_compile_status)
{
m_testCtx.getLog() << tcu::TestLog::Message << "Shader object compilation failed." << tcu::TestLog::EndMessage;
// Retrieve shader info log in case of failed compilation.
GLint info_log_length = 0;
gl.getShaderiv(shader_object_id, GL_INFO_LOG_LENGTH, &info_log_length);
if (info_log_length != 0)
{
std::vector<char> log(info_log_length + 1, 0);
gl.getShaderInfoLog(shader_object_id, info_log_length, NULL, &log[0]);
m_testCtx.getLog() << tcu::TestLog::Message << "Shader info log = [" << &log[0] << "]"
<< tcu::TestLog::EndMessage;
}
return false;
}
return true;
}
/** Links a program object and returns link status.
*
* @param program_object_id ID of a program object to be linked.
*
* @return true in case of the operation succeeded (no error was generated and linking end up with success),
* false otherwise.
*/
bool RequiredCase::linkAndCheckProgramLinkStatus(GLuint program_object_id)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
gl.linkProgram(program_object_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glLinkProgram");
// Check if link opearation was successful.
GLint program_link_status = GL_FALSE;
gl.getProgramiv(program_object_id, GL_LINK_STATUS, &program_link_status);
GLU_EXPECT_NO_ERROR(gl.getError(), "glGetProgramiv");
if (GL_FALSE == program_link_status)
{
m_testCtx.getLog() << tcu::TestLog::Message << "Program object linking failed." << tcu::TestLog::EndMessage;
// Retrieve program info log in case of failed linking.
GLint info_log_length = 0;
gl.getProgramiv(program_object_id, GL_INFO_LOG_LENGTH, &info_log_length);
if (info_log_length != 0)
{
std::vector<char> log(info_log_length + 1, 0);
gl.getProgramInfoLog(program_object_id, info_log_length, NULL, &log[0]);
m_testCtx.getLog() << tcu::TestLog::Message << "Program info log = [" << &log[0] << "]"
<< tcu::TestLog::EndMessage;
}
return false;
}
return true;
}
/** Retrieve locations of uniforms (source and destination texture samples)
* and store them in derefs.
*
* @param program_object_id ID of a program object for which uniform locations are to be retrieved.
* @param source_2D_texture_uniform_location_ptr Deref used to store uniform location for a 2D source texture.
* Cannot be NULL.
* @param source_2DArray_texture_uniform_location_ptr Deref used to store uniform location for a 2DArray source texture.
* Cannot be NULL.
* @param source_3D_texture_uniform_location_ptr Deref used to store uniform location for a 3D source texture.
* Cannot be NULL.
* @param source_Cube_texture_uniform_location_ptr Deref used to store uniform location for a Cube source texture.
* Cannot be NULL.
* @param destination_2D_texture_uniform_location_ptr Deref used to store uniform location for a 2D destination texture.
* Cannot be NULL.
* @param destination_Cube_texture_uniform_location_ptr Deref used to store uniform location for a Cube destination texture.
* Cannot be NULL.
* @param channels_to_compare_uniform_location_ptr Deref used to store uniform location for a channels_to_compare.
* Cannot be NULL.
* @param samplers_to_use_uniform_location_ptr Deref used to store uniform location for a samplers_to_use.
* Cannot be NULL.
*
* @return true if the operation succeeded (no error was generated and valid uniform locations were returned),
* false otherwise.
*/
bool RequiredCase::getUniformLocations(GLuint program_object_id, GLint* source_2D_texture_uniform_location_ptr,
GLint* source_2DArray_texture_uniform_location_ptr,
GLint* source_3D_texture_uniform_location_ptr,
GLint* source_Cube_texture_uniform_location_ptr,
GLint* destination_2D_texture_uniform_location_ptr,
GLint* destination_Cube_texture_uniform_location_ptr,
GLint* channels_to_compare_uniform_location_ptr,
GLint* samplers_to_use_uniform_location_ptr)
{
if (source_2D_texture_uniform_location_ptr == NULL || source_2DArray_texture_uniform_location_ptr == NULL ||
source_3D_texture_uniform_location_ptr == NULL || source_Cube_texture_uniform_location_ptr == NULL ||
destination_2D_texture_uniform_location_ptr == NULL || destination_Cube_texture_uniform_location_ptr == NULL ||
channels_to_compare_uniform_location_ptr == NULL || samplers_to_use_uniform_location_ptr == NULL)
{
m_testCtx.getLog() << tcu::TestLog::Message << "NULL pointers passed." << tcu::TestLog::EndMessage;
return false;
}
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// Set active program object.
gl.useProgram(program_object_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glUseProgram");
GLint destination_2D_texture_uniform_location = -1;
destination_2D_texture_uniform_location = gl.getUniformLocation(program_object_id, "dst_texture2D");
if (destination_2D_texture_uniform_location == -1)
return false;
GLint destination_Cube_texture_uniform_location = -1;
destination_Cube_texture_uniform_location = gl.getUniformLocation(program_object_id, "dst_textureCube");
if (destination_Cube_texture_uniform_location == -1)
return false;
GLint source_2D_texture_uniform_location = -1;
source_2D_texture_uniform_location = gl.getUniformLocation(program_object_id, "src_texture2D");
if (source_2D_texture_uniform_location == -1)
return false;
GLint source_2DArray_texture_uniform_location = -1;
source_2DArray_texture_uniform_location = gl.getUniformLocation(program_object_id, "src_texture2DArray");
if (source_2DArray_texture_uniform_location == -1)
return false;
GLint source_3D_texture_uniform_location = -1;
source_3D_texture_uniform_location = gl.getUniformLocation(program_object_id, "src_texture3D");
if (source_3D_texture_uniform_location == -1)
return false;
GLint source_Cube_texture_uniform_location = -1;
source_Cube_texture_uniform_location = gl.getUniformLocation(program_object_id, "src_textureCube");
if (source_Cube_texture_uniform_location == -1)
return false;
GLint channels_to_compare_uniform_location = -1;
channels_to_compare_uniform_location = gl.getUniformLocation(program_object_id, "channels_to_compare");
if (channels_to_compare_uniform_location == -1)
return false;
GLint samplers_to_use_uniform_location = -1;
samplers_to_use_uniform_location = gl.getUniformLocation(program_object_id, "samplers_to_use");
if (samplers_to_use_uniform_location == -1)
return false;
// We are now ready to store retrieved locations.
*source_2D_texture_uniform_location_ptr = source_2D_texture_uniform_location;
*source_2DArray_texture_uniform_location_ptr = source_2DArray_texture_uniform_location;
*source_3D_texture_uniform_location_ptr = source_3D_texture_uniform_location;
*source_Cube_texture_uniform_location_ptr = source_Cube_texture_uniform_location;
*destination_2D_texture_uniform_location_ptr = destination_2D_texture_uniform_location;
*destination_Cube_texture_uniform_location_ptr = destination_Cube_texture_uniform_location;
*channels_to_compare_uniform_location_ptr = channels_to_compare_uniform_location;
*samplers_to_use_uniform_location_ptr = samplers_to_use_uniform_location;
// Restore default settings.
gl.useProgram(0);
GLU_EXPECT_NO_ERROR(gl.getError(), "glUseProgram");
return true;
}
/** Display error message with detailed information.
* The function should be issued only when pixel comparison failed.
*
* @param src_attachment_type Source attachment type.
* @param dst_attachment_type Destination attachment type.
* @param source_pixel_r R channel source pixel value.
* @param source_pixel_g G channel source pixel value.
* @param source_pixel_b B channel source pixel value.
* @param source_pixel_a A channel source pixel value.
* @param source_internalformat Source internalformat.
* @param source_type Source type.
* @param reference_pixel_r R channel reference pixel value.
* @param reference_pixel_g G channel reference pixel value.
* @param reference_pixel_b B channel reference pixel value.
* @param reference_pixel_a A channel reference pixel value.
* @param reference_internalformat Reference internalformat.
* @param reference_type Reference type.
* @param result_pixel_r R channel result pixel value.
* @param result_pixel_g G channel result pixel value.
* @param result_pixel_b B channel result pixel value.
* @param result_pixel_a A channel result pixel value.
* @param result_internalformat Result internalformat.
* @param result_type Type internalformat.
* @param max_epsilon_r Maximum value for an epsilon used for comparison R channel pixel values.
* @param max_epsilon_g Maximum value for an epsilon used for comparison G channel pixel values.
* @param max_epsilon_b Maximum value for an epsilon used for comparison B channel pixel values.
* @param max_epsilon_a Maximum value for an epsilon used for comparison A channel pixel values.
*/
void RequiredCase::displayPixelComparisonFailureMessage(
GLint source_pixel_r, GLint source_pixel_g, GLint source_pixel_b, GLint source_pixel_a,
GLenum source_internalformat, GLenum source_type, GLint reference_pixel_r, GLint reference_pixel_g,
GLint reference_pixel_b, GLint reference_pixel_a, GLenum reference_internalformat, GLenum reference_type,
GLint result_pixel_r, GLint result_pixel_g, GLint result_pixel_b, GLint result_pixel_a,
GLenum result_internalformat, GLenum result_type, GLint max_epsilon_r, GLint max_epsilon_g, GLint max_epsilon_b,
GLint max_epsilon_a)
{
m_testCtx.getLog() << tcu::TestLog::Message << "Conversion failed for source ["
<< getTargetName(m_source_attachment_type) << "] and destination ["
<< getTargetName(m_destination_attachment_type) << "FBO attachment types."
<< "\nSource pixel: [" << source_pixel_r << ", " << source_pixel_g << ", "
<< source_pixel_b << ", " << source_pixel_a << "]\nSource internalformat: ["
<< getInternalformatString(source_internalformat) << "]\nSource type: ["
<< glu::getTypeStr(source_type).toString() << "]\nReference pixel: ["
<< reference_pixel_r << ", " << reference_pixel_g << ", " << reference_pixel_b << ", "
<< reference_pixel_a << "]\nReference internalformat: ["
<< getInternalformatString(reference_internalformat) << "]\nReference type: ["
<< glu::getTypeStr(reference_type).toString() << "]\nResult pixel: ["
<< result_pixel_r << ", " << result_pixel_g << ", " << result_pixel_b << ", " << result_pixel_a
<< "]\nResult internalformat: [" << getInternalformatString(result_internalformat)
<< "]\nType used for glReadPixels(): [" << glu::getTypeStr(result_type).toString()
<< "]\nMaximum epsilon: [" << max_epsilon_r << ", " << max_epsilon_g << ", "
<< max_epsilon_b << ", " << max_epsilon_a << "]" << tcu::TestLog::EndMessage;
}
/** Returns sampler type (float/integer/unsigned integer) that should be used for
* sampling a texture using data stored in specific internalformat.
*
* @param internalformat Internalformat to use for the query.
*
* @return Sampler type to9 be used..
*/
DataSamplerType RequiredCase::getDataSamplerTypeForInternalformat(GLenum internalformat)
{
if (isInternalFormatCompatibleWithFPSampler(internalformat))
return DATA_SAMPLER_FLOAT;
else if (isInternalFormatCompatibleWithIntegerSampler(internalformat))
return DATA_SAMPLER_INTEGER;
else if (isInternalFormatCompatibleWithUnsignedIntegerSampler(internalformat))
return DATA_SAMPLER_UNSIGNED_INTEGER;
else
{
// Unrecognized internal format
DE_ASSERT(0);
}
return DATA_SAMPLER_FLOAT;
}
/** Tells whether internal format @param internalformat is compatible with a floating-point
* texture sampling function.
*
* @param internalformat GLES internal format to consider.
*
* @return true if yes, false otherwise.
**/
bool RequiredCase::isInternalFormatCompatibleWithFPSampler(GLenum internalformat)
{
switch (internalformat)
{
// FP texture() GLSL function should be used for sampling textures using
// the following internalformats
case GL_ALPHA:
case GL_ALPHA8_OES:
case GL_DEPTH_COMPONENT16:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH24_STENCIL8:
case GL_LUMINANCE:
case GL_LUMINANCE8_OES:
case GL_LUMINANCE_ALPHA:
case GL_LUMINANCE8_ALPHA8_OES:
case GL_R8:
case GL_R8_SNORM:
case GL_RG8:
case GL_RG8_SNORM:
case GL_RGB:
case GL_RGB5_A1:
case GL_RGB10_A2:
case GL_RGB565:
case GL_RGB8:
case GL_RGB8_SNORM:
case GL_RGBA:
case GL_RGBA4:
case GL_RGBA8:
case GL_RGBA8_SNORM:
case GL_SRGB8:
case GL_SRGB8_ALPHA8:
// These are strictly floating-point internal formats
case GL_DEPTH_COMPONENT32F:
case GL_DEPTH32F_STENCIL8:
case GL_R11F_G11F_B10F:
case GL_R16F:
case GL_R32F:
case GL_RG16F:
case GL_RG32F:
case GL_RGB16F:
case GL_RGB32F:
case GL_RGB9_E5:
case GL_RGBA16F:
case GL_RGBA32F:
return true;
}
return false;
}
/** Tells whether internal format @param internalformat is compatible with integer
* texture sampling function.
*
* @param internalformat GLES internal format to consider.
*
* @return true if yes, false otherwise.
**/
bool RequiredCase::isInternalFormatCompatibleWithIntegerSampler(GLenum internalformat)
{
switch (internalformat)
{
case GL_R16I:
case GL_R32I:
case GL_R8I:
case GL_RG16I:
case GL_RG32I:
case GL_RG8I:
case GL_RGB16I:
case GL_RGB32I:
case GL_RGB8I:
case GL_RGBA16I:
case GL_RGBA32I:
case GL_RGBA8I:
return true;
}
return false;
}
/** Tells whether internal format @param internalformat is compatible with unsigned integer
* texture sampling function.
*
* @param internalformat GLES internal format to consider.
*
* @return true if yes, false otherwise.
**/
bool RequiredCase::isInternalFormatCompatibleWithUnsignedIntegerSampler(GLenum internalformat)
{
switch (internalformat)
{
case GL_R16UI:
case GL_R32UI:
case GL_R8UI:
case GL_RG16UI:
case GL_RG32UI:
case GL_RG8UI:
case GL_RGB10_A2UI:
case GL_RGB16UI:
case GL_RGB32UI:
case GL_RGB8UI:
case GL_RGBA16UI:
case GL_RGBA32UI:
case GL_RGBA8UI:
return true;
}
return false;
}
/** Deletes all objects which were created to support non-renderable texture internalformats.
*
* @param objects Reference to generated object.
*/
void RequiredCase::destroyObjectsSupportingNonRenderableInternalformats(
NonRenderableInternalformatSupportObjects& objects)
{
unbindAndDestroyBufferObject(objects.comparison_result_buffer_object_id);
unbindAndDestroyBufferObject(objects.src_texture_pixels_buffer_object_id);
unbindAndDestroyBufferObject(objects.dst_texture_pixels_buffer_object_id);
unbindAndDestroyBufferObject(objects.src_texture_coordinates_buffer_object_id);
unbindAndDestroyBufferObject(objects.dst_texture_coordinates_buffer_object_id);
destroyTransformFeedbackObject(objects.transform_feedback_object_id);
destroyProgramAndShaderObjects(objects.program_object_id, objects.fragment_shader_object_id,
objects.vertex_shader_object_id);
objects.comparison_result_buffer_object_id = 0;
objects.dst_texture_pixels_buffer_object_id = 0;
objects.dst_2D_texture_uniform_location = -1;
objects.dst_Cube_texture_uniform_location = -1;
objects.fragment_shader_object_id = 0;
objects.transform_feedback_object_id = 0;
objects.program_object_id = 0;
objects.src_2D_texture_uniform_location = -1;
objects.src_2DArray_texture_uniform_location = -1;
objects.src_3D_texture_uniform_location = -1;
objects.src_Cube_texture_uniform_location = -1;
objects.src_texture_pixels_buffer_object_id = 0;
objects.vertex_shader_object_id = 0;
objects.channels_to_compare_uniform_location = -1;
objects.samplers_to_use_uniform_location = -1;
objects.src_texture_coordinates_buffer_object_id = 0;
objects.dst_texture_coordinates_buffer_object_id = 0;
}
/** Unbind and destroy buffer object which was created for transform feedback purposes.
*
* @param bo_id ID of a buffer object (which was created for transform feedback purposes) to be deleted.
* If not zero, it is assumed that the value corresponds to valid buffer object ID.
*/
void RequiredCase::unbindAndDestroyBufferObject(GLuint bo_id)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// Set zero buffer object to be used for GL_TRANSFORM_FEEDBACK_BUFFER.
gl.bindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, COMPARISON_RESULT_BUFFER_OBJECT_INDEX, 0);
gl.bindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, SOURCE_TEXTURE_PIXELS_BUFFER_OBJECT_INDEX, 0);
gl.bindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, DESTINATION_TEXTURE_PIXELS_BUFFER_OBJECT_INDEX, 0);
gl.bindBuffer(GL_ARRAY_BUFFER, 0);
if (bo_id != 0)
{
gl.deleteBuffers(1, &bo_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glDeleteBuffers");
}
}
/** Unbind and destroy transform feedback object.
*
* @param transform_feedback_object_id ID of a transform feedback object to be deleted.
* If not zero, it is assumed that the value corresponds
* to valid transform feedback object ID.
*/
void RequiredCase::destroyTransformFeedbackObject(GLuint transform_feedback_object_id)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// Set zero transform feedback object to be used.
gl.bindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);
if (transform_feedback_object_id != 0)
{
gl.deleteTransformFeedbacks(1, &transform_feedback_object_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glDestroyTransformFeedbackObject");
}
}
/** Destroy program and shader objects.
*
* @param program_object_id ID of a program object to be deleted.
* If not zero, it is assumed that the value corresponds to valid program object ID.
* @param fragment_shader_id ID of a fragment shader object to be deleted.
* If not zero, it is assumed that the value corresponds to valid shader object ID.
* @param vertex_shader_id ID of a vertex shader object to be deleted.
* If not zero, it is assumed that the value corresponds to valid shader object ID.
*/
void RequiredCase::destroyProgramAndShaderObjects(GLuint program_object_id, GLuint fragment_shader_id,
GLuint vertex_shader_id)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// Use zero program object.
gl.useProgram(0);
// Try to destroy fragment shader object.
if (fragment_shader_id != 0)
{
gl.deleteShader(fragment_shader_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glDeleteShader");
}
// Try to destroy vertex shader object.
if (vertex_shader_id != 0)
{
gl.deleteShader(vertex_shader_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glDeleteShader");
}
// Try to destroy program object.
if (program_object_id != 0)
{
gl.deleteProgram(program_object_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glDeleteProgram");
}
}
void RequiredCase::unbindColorAttachments()
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
switch (m_source_attachment_type)
{
case GL_RENDERBUFFER:
gl.framebufferRenderbuffer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0);
break;
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_3D:
gl.framebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 0, 0, 0);
break;
default:
gl.framebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_source_attachment_type, 0, 0);
break;
}
if (gl.getError() != GL_NO_ERROR)
{
m_testCtx.getLog() << tcu::TestLog::Message << "Could not unbind texture objects from read/draw framebuffers"
<< tcu::TestLog::EndMessage;
}
}
void RequiredCase::restoreBindings(GLenum src_attachment_point, GLenum dst_attachment_point, GLint bound_draw_fbo_id,
GLint bound_read_fbo_id)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
gl.disableVertexAttribArray(SRC_TEXTURE_COORDS_ATTRIB_INDEX);
gl.disableVertexAttribArray(DST_TEXTURE_COORDS_ATTRIB_INDEX);
gl.activeTexture(src_attachment_point);
gl.bindTexture(getGeneralTargetForDetailedTarget(m_source_attachment_type), 0);
gl.activeTexture(dst_attachment_point);
gl.bindTexture(getGeneralTargetForDetailedTarget(m_destination_attachment_type), 0);
gl.activeTexture(GL_TEXTURE0);
// Restore previous framebuffer bindings.
gl.bindFramebuffer(GL_DRAW_FRAMEBUFFER, bound_draw_fbo_id);
gl.bindFramebuffer(GL_READ_FRAMEBUFFER, bound_read_fbo_id);
}
/* SPECIFICATION:
*
* This conformance test verifies that glCopyTexImage2D() implementation does NOT
* accept internalformats that are incompatible with effective internalformat of
* current read buffer.
*
* The test starts from creating a framebuffer object, which is then bound to
* GL_READ_FRAMEBUFFER target. It then enters two-level loop:
*
* a) First level determines source attachment type: this could either be a 2D texture/cube-map
* face mip-map, a specific mip-map of a slice coming from a 2D texture array OR a 3D texture,
* or finally a render-buffer. All of these can be bound to an attachment point that is
* later pointed to by read buffer configuration.
* b) Second level configures attachment type of destination. Since glCopyTexImage2D()
* specification limits accepted targets, only 2D texture or cube-map face targets are
* accepted.
*
* For each viable source/destination configuration, the test then enters another two-level loop:
*
* I) First sub-level determines what internal format should be used for the source attachment.
* All texture formats required from a conformant GLES3.0 implementation are iterated over.
* II) Second sub-level determines internal format that should be passed as a parameter to
* a glCopyTexImage2D() call.
*
* For each internal format pair, the test creates and configures a corresponding GL object and
* attaches it to the read framebuffer. The test also uses a pre-generated texture object that
* should be re-configured with each glCopyTexImage2D) call.
*
* The test then loops over all supported format+type combinations for the internal-format considered
* and feeds them into actual glCopyTexImage2D() call. Since we're dealing with a negative test, these
* calls are only made if a source/destination internalformat combination is spec-wise invalid and
* should result in an error. If the implementation accepts a pair that would require indirect
* conversions outside scope of the specification, the test should fail.
*/
class ForbiddenCase : public TestBase
{
public:
ForbiddenCase(deqp::Context& context, GLenum source_attachment_types, GLenum destination_attachment_types);
virtual ~ForbiddenCase();
virtual tcu::TestNode::IterateResult iterate(void);
protected:
bool execute(GLenum src_internal_format, GLenum dst_internal_format, GLuint src_object_id, GLuint dst_object_id);
};
ForbiddenCase::ForbiddenCase(deqp::Context& context, GLenum source_attachment_types,
GLenum destination_attachment_types)
: TestBase(context, source_attachment_types, destination_attachment_types)
{
}
ForbiddenCase::~ForbiddenCase()
{
}
tcu::TestNode::IterateResult ForbiddenCase::iterate(void)
{
glu::RenderContext& renderContext = m_context.getRenderContext();
const Functions& gl = renderContext.getFunctions();
// Create a FBO we will be using throughout the test
GLuint fbo_id = 0;
gl.genFramebuffers(1, &fbo_id);
gl.bindFramebuffer(GL_READ_FRAMEBUFFER, fbo_id);
// We will be reading from zeroth color attachment
gl.readBuffer(GL_COLOR_ATTACHMENT0);
// Make sure the pixel storage is configured accordingly to our data sets
gl.pixelStorei(GL_UNPACK_ALIGNMENT, 1);
GLU_EXPECT_NO_ERROR(gl.getError(), "glPixelStorei");
// Sanity checks
DE_ASSERT(m_destination_attachment_type == GL_TEXTURE_2D ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_POSITIVE_Z);
// Determine general attachment type
GLenum general_attachment_type = getGeneralTargetForDetailedTarget(m_source_attachment_type);
if (general_attachment_type == GL_NONE)
{
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
return STOP;
}
// Set up source object
GLuint src_object_id = generateGLObject(m_source_attachment_type);
if (src_object_id == 0)
{
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
return STOP;
}
// Set up destination object
GLuint dst_object_id = generateGLObject(m_destination_attachment_type);
if (dst_object_id == 0)
{
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
return STOP;
}
// Run through all FBO internal formats
bool result = true;
int dstInternalFormatsCount = DE_LENGTH_OF_ARRAY(copyTexImage2DInternalFormatOrdering);
const int fboInternalFormatsCount = DE_LENGTH_OF_ARRAY(fboEffectiveInternalFormatOrdering);
for (int fboInternalFormatIndex = 0; fboInternalFormatIndex < fboInternalFormatsCount; ++fboInternalFormatIndex)
{
GLenum fboInternalIormat = fboEffectiveInternalFormatOrdering[fboInternalFormatIndex];
// Run through all destination internal formats
for (int dstInternalFormatUndex = 0; dstInternalFormatUndex < dstInternalFormatsCount; ++dstInternalFormatUndex)
{
GLenum dstInternalFormat = copyTexImage2DInternalFormatOrdering[dstInternalFormatUndex];
if (!execute(fboInternalIormat, dstInternalFormat, src_object_id, dst_object_id))
{
// At least one conversion was invalid or failed. Test should
// fail, but let's continue iterating over internalformats.
result = false;
}
}
}
// Release GL objects before we continue
if (dst_object_id != 0)
destroyGLObject(m_destination_attachment_type, dst_object_id);
if (src_object_id != 0)
destroyGLObject(m_source_attachment_type, src_object_id);
if (result)
m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
else
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
return STOP;
}
/** This function verifies if glCopyTexImage2D() implementation forbids conversions that
* are considered forbidden by GLES3.0.3 spec. For more detailed description, please
* consult specification of copy_tex_image_conversions_forbidden conformance test.
*
* @param src_internalformat GLES internalformat that read buffer should use.
* @param src_object_id ID of the source GL object of @param source_attachment_type
* type.
* @param dst_internalformat GLES internalformat that should be used for gl.readPixels() call.
* This should NOT be the expected effective internalformat!
* @param dst_object_id ID of the destination GL object of
* @param destination_attachment_type type.
*
* @return true if successful, false otherwise.
*/
bool ForbiddenCase::execute(GLenum src_internal_format, GLenum dst_internal_format, GLuint src_object_id,
GLuint dst_object_id)
{
// Allocate the max possible size for the texture data (4 compoenents of 4 bytes each)
static char fbo_data[TEXTURE_WIDTH * TEXTURE_HEIGHT * 4 * 4];
GLenum fbo_format = GL_NONE;
GLenum fbo_type = GL_NONE;
GLenum general_destination_attachment_type = getGeneralTargetForDetailedTarget(m_destination_attachment_type);
int n_src_pair = 0;
bool result = true;
// Sanity checks
DE_ASSERT(m_destination_attachment_type == GL_TEXTURE_2D ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ||
m_destination_attachment_type == GL_TEXTURE_CUBE_MAP_POSITIVE_Z);
// Skip the internalformat if it's non-renderable and we're trying to set up a renderbuffer source.
if (m_source_attachment_type == GL_RENDERBUFFER && !isValidRBOInternalFormat(src_internal_format))
return true;
// Try using all compatible format+type pairs for
const Functions& gl = m_context.getRenderContext().getFunctions();
while (getFormatAndTypeCompatibleWithInternalformat(src_internal_format, n_src_pair, &fbo_format, &fbo_type))
{
// Do not test internal formats that are not deemed renderable by GLES implementation we're testing
if (!isColorRenderableInternalFormat(src_internal_format))
break;
// Set up data to be used for source. Note we don't really care much about the data anyway because we want to run
// negative tests, but in case the conversion is incorrectly allowed, we do not want this fact to be covered by
// missing source attachment data
if (!configureGLObject(1, m_source_attachment_type, src_object_id, src_internal_format, fbo_format, fbo_type,
fbo_data))
return false;
// Good. Check if the conversion is forbidden - if so, we can run a negative test! */
if (!isFBOEffectiveInternalFormatCompatibleWithDestinationInternalFormat(src_internal_format,
dst_internal_format))
{
#if 0
m_testCtx.getLog() << tcu::TestLog::Message
<< "Testing conversion [" << getInternalformatString(src_internal_format)
<< "]=>[" << getInternalformatString(dst_internal_format)
<< "] for source target [" << GetTargetName(m_source_attachment_type)
<< "] and destination target [" << GetTargetName(m_destination_attachment_type) << "]",
<< tcu::TestLog::EndMessage;
#endif
// Ask the implementation to perform the conversion!
gl.bindTexture(general_destination_attachment_type, dst_object_id);
gl.copyTexImage2D(m_destination_attachment_type, 0, dst_internal_format, 0 /* x */, 0 /* y */,
TEXTURE_WIDTH, TEXTURE_HEIGHT, 0 /* border */);
gl.bindTexture(general_destination_attachment_type, 0);
// Has the conversion failed as expected?
GLenum error_code = gl.getError();
if (error_code == GL_NO_ERROR)
{
m_testCtx.getLog() << tcu::TestLog::Message << "[" << getInternalformatString(src_internal_format)
<< "]=>[" << getInternalformatString(dst_internal_format)
<< "] conversion [src target=" << getTargetName(m_source_attachment_type)
<< ", dst target=" << getTargetName(m_destination_attachment_type)
<< "] supported contrary to GLES3.0 spec." << tcu::TestLog::EndMessage;
// This test is now considered failed
result = false;
}
else if (error_code != GL_INVALID_OPERATION)
{
m_testCtx.getLog() << tcu::TestLog::Message << "[" << getInternalformatString(src_internal_format)
<< "]=>[" << getInternalformatString(dst_internal_format)
<< "] conversion [src target=" << getTargetName(m_source_attachment_type)
<< ", dst target=" << getTargetName(m_destination_attachment_type) << "] caused ["
<< error_code << "] error instead of GL_INVALID_OPERATION."
<< tcu::TestLog::EndMessage;
// This test is now considered failed
result = false;
}
}
n_src_pair++;
// If we're copying from a renderbuffer, we don't really care about compatible format+type pairs, as
// the effective internalformat is explicitly configured by gl.renderbufferStorage() call.
if (m_source_attachment_type == GL_RENDERBUFFER)
break;
} // for (all compatible format+type pairs)
return result;
}
CopyTexImageConversionsTests::CopyTexImageConversionsTests(deqp::Context& context)
: TestCaseGroup(context, "copy_tex_image_conversions", "")
{
}
void CopyTexImageConversionsTests::init()
{
// Types of objects that can be used as source attachments for conversion process
const GLenum sourceAttachmentTypes[] = { GL_TEXTURE_2D,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
GL_TEXTURE_CUBE_MAP_POSITIVE_X,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
GL_TEXTURE_2D_ARRAY,
GL_TEXTURE_3D,
GL_RENDERBUFFER };
// Types of objects that can be used as destination attachments for conversion process
const GLenum destinationAttachmentTypes[] = {
GL_TEXTURE_2D,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
GL_TEXTURE_CUBE_MAP_POSITIVE_X,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
};
// Set up conversion database
de::SharedPtr<ConversionDatabase> conversionDatabase(new ConversionDatabase());
TestCaseGroup* requiredGroup = new deqp::TestCaseGroup(m_context, "required", "");
TestCaseGroup* forbiddenGroup = new deqp::TestCaseGroup(m_context, "forbidden", "");
for (int srcAttachmentIndex = 0; srcAttachmentIndex < DE_LENGTH_OF_ARRAY(sourceAttachmentTypes);
++srcAttachmentIndex)
{
GLenum srcAttachmentType = sourceAttachmentTypes[srcAttachmentIndex];
for (int dstAttachmentIndex = 0; dstAttachmentIndex < DE_LENGTH_OF_ARRAY(destinationAttachmentTypes);
++dstAttachmentIndex)
{
GLenum dstAttachmentType = destinationAttachmentTypes[dstAttachmentIndex];
requiredGroup->addChild(
new RequiredCase(m_context, conversionDatabase, srcAttachmentType, dstAttachmentType));
forbiddenGroup->addChild(new ForbiddenCase(m_context, srcAttachmentType, dstAttachmentType));
}
}
addChild(forbiddenGroup);
addChild(requiredGroup);
}
} // es3cts namespace
|
; A073675: Rearrangement of natural numbers such that a(n) is the smallest proper divisor of n not included earlier but if no such divisor exists then a(n) is the smallest proper multiple of n not included earlier, subject always to the condition that a(n) is not equal to n.
; Submitted by Jon Maiga
; 2,1,6,8,10,3,14,4,18,5,22,24,26,7,30,32,34,9,38,40,42,11,46,12,50,13,54,56,58,15,62,16,66,17,70,72,74,19,78,20,82,21,86,88,90,23,94,96,98,25,102,104,106,27,110,28,114,29,118,120,122,31,126,128,130,33,134,136,138,35,142,36,146,37,150,152,154,39,158,160,162,41,166,168,170,43,174,44,178,45,182,184,186,47,190,48,194,49,198,200
add $0,1
mul $0,2
mov $1,1
mov $2,$0
lpb $0
dif $0,2
sub $1,3
pow $1,2
lpe
mul $1,$2
div $1,4
mov $0,$1
|
; A134449: Sum of even products minus sum of odd products of different pairs of numbers from 1 to n.
; 0,2,5,29,39,129,150,374,410,860,915,1707,1785,3059,3164,5084,5220,7974,8145,11945,12155,17237,17490,24114,24414,32864,33215,43799,44205,57255,57720,73592,74120,93194,93789,116469,117135,143849,144590,175790,176610,212772,213675,255299,256289,303899,304980,359124,360300,421550,422825,491777,493155,570429,571914,658154,659750,755624,757335,863535,865365,982607,984560,1113584,1115664,1257234,1259445,1414349,1416695,1585745,1588230,1772262,1774890,1974764,1977539,2194139,2197065,2431299,2434380,2687180,2690420,2962742,2966145,3258969,3262539,3576869,3580610,3917474,3921390,4281840,4285935,4671047,4675325,5086199,5090664,5528424,5533080,5998874,6003725,6498725
mov $3,$0
mov $4,$0
lpb $3
mov $0,$4
sub $3,1
sub $0,$3
mov $2,15
mov $5,1
add $5,$0
mov $7,5
add $7,$0
gcd $7,2
pow $5,$7
mul $5,9
mul $5,$0
mul $2,$5
mov $6,$7
add $6,$2
div $6,270
add $1,$6
lpe
mov $0,$1
|
/*
* CIOTrace.cpp
*
* Created on: Jun 1, 2019
* Author: avner
*/
#include <string>
#include <memory>
#include <string.h>
#include <sstream>
#include "CIOTrace.h"
#include "CGetProcessInfo.h"
#include "constants.h"
#include "CStraceOutputParser.h"
using namespace std;
CIOTrace::CIOTrace(bool reportOnline, bool incomplete, bool followFork, tProcessId attachProcessId, const std::string command) :
m_bReportOnline(reportOnline),
m_bIncludeIncomplete(incomplete),
m_bFollowFork(followFork),
m_nAttachProcess(attachProcessId),
m_sCommand(command)
{
// TODO Auto-generated constructor stub
}
CIOTrace::~CIOTrace() {
// TODO Auto-generated destructor stub
}
void CIOTrace::printReport(){
LOG(eReport)<< "Filename, Read bytes, Written bytes, Opened, Read op, Write op"<<endl;
tFileInfoMap::iterator l_oIter=m_oFilesInfoMap.begin();
while (l_oIter!=m_oFilesInfoMap.end())
{
LOG(eReport)<<
l_oIter->first.c_str()<<CSV_SEP<<
l_oIter->second.getRead()<<CSV_SEP<<
l_oIter->second.getWritten()<<CSV_SEP<<
l_oIter->second.getOpened()<<CSV_SEP<<
l_oIter->second.getReadOp()<<CSV_SEP<<
l_oIter->second.getWriteOp()<<endl;
++l_oIter;
}
}
bool CIOTrace::monitor()
{
int status;
char l_sLine[LINE_MAX_BUFF];
const char *TRACE_CMD= "strace -o \\!cat -e read,write,open,openat,close ";
string l_sStraceCommand= string(TRACE_CMD) + string(m_bFollowFork ? " -f " : "") +
(m_nAttachProcess!=0 ? string("-p ") + to_string(m_nAttachProcess) : m_sCommand);
LOG(eInfo) << l_sStraceCommand << endl;
FILE* fp = popen(l_sStraceCommand.c_str() , "r");
if (fp == NULL)
{
LOG(eFatal) << "Failed to execute strace, make sure strace is installed" << endl;
return EXIT_ERROR;
}
while (fgets(l_sLine, LINE_MAX_BUFF, fp) != NULL)
{
processLine(l_sLine);
}
status = pclose(fp);
if (status == -1) {
LOG(eFatal) << "Failed to close strace process" << endl;
return false;
}
return true;
}
void CIOTrace::addProcessFilesAndSocketsToActiveFiles(tProcessId a_nPid)
{
vector<CGetProcessInfo::tFile> activeFiles= CGetProcessInfo::getProcessOpenFiles(a_nPid);
for (CGetProcessInfo::tFile file : activeFiles)
AddActiveFile(a_nPid, file.m_nFileNum, file.m_sFileName, false);
}
const char *g_saStdPrefixes[] =
{
"stdin_",
"stdout_",
"stderr_"
};
void CIOTrace::RemoveActiveFile(tProcessId a_nPid, tFileNum a_nFileNum)
{
if (!m_oActiveFilesMap.erase(CActiveFileId(a_nPid, a_nFileNum)))
{
LOG(eError)<< "Didn't find file id "<< a_nFileNum <<endl;
}
else
{
LOG(eInfo)<< "file id removed from active files maps" << a_nFileNum <<endl;
}
}
void CIOTrace::AddActiveFile(tProcessId a_nPid, tFileNum a_nFileNum, const std::string & a_sFileName, bool a_bOpenOp)
{
string l_sFullName;
if (a_nFileNum < 3)
l_sFullName = string(g_saStdPrefixes[a_nFileNum]) + a_sFileName;
else
l_sFullName = a_sFileName;
tActiveFiles::iterator l_oIter=m_oActiveFilesMap.find(CActiveFileId(a_nPid,a_nFileNum));
if (l_oIter!=m_oActiveFilesMap.end())
{
LOG(eFatal) << "Trying to add file while file num already open pid=" << a_nPid << " desc id=" <<a_nFileNum << " replacing with "<< a_sFileName << endl;
RemoveActiveFile(a_nPid, a_nFileNum);
}
LOG(eInfo) << "added file " << l_sFullName << " desc id="<< a_nFileNum << " pid="<<a_nPid<< endl;
pair<tActiveFiles::iterator, bool> l_oIterNewActiveFile;
l_oIterNewActiveFile=m_oActiveFilesMap.insert(tActiveFiles::value_type(CActiveFileId(a_nPid, a_nFileNum), CActiveFileInfo(l_sFullName)));
tFileInfoMap::iterator l_oFileInfoIter = m_oFilesInfoMap.find(l_sFullName);
if (l_oFileInfoIter==m_oFilesInfoMap.end())
{
pair<tFileInfoMap::iterator, bool> l_oFileInfoIter;
l_oFileInfoIter=m_oFilesInfoMap.insert(
tFileInfoMap::value_type(l_sFullName, CFileInfo()));
l_oIterNewActiveFile.first->second.setFileInfoIter(l_oFileInfoIter.first);
}
else
{
if (a_bOpenOp)
l_oFileInfoIter->second.open();
l_oIterNewActiveFile.first->second.setFileInfoIter(l_oFileInfoIter);
}
}
string CIOTrace::genIncompleteFilenameName(tProcessId a_nPid, tFileNum a_nFileID)
{
ostringstream commandStream;
switch (a_nFileID)
{
case 0:
commandStream << "descriptor_pid_"<<a_nPid<<"_stdin_desc_id_"<<a_nFileID;
break;
case 1:
commandStream << "descriptor_pid_"<<a_nPid<<"_stdout_desc_id_"<<a_nFileID;
break;
case 2:
commandStream << "descriptor_pid_"<<a_nPid<<"_stderr_desc_id_"<<a_nFileID;
break;
default:
addProcessFilesAndSocketsToActiveFiles(a_nPid);
CActiveFileInfo *l_opFile=GetActiveFile(a_nPid, a_nFileID);
// In case the file was added to active list, we return empty string
if (!l_opFile)
commandStream <<"descriptor_pid_"<< a_nPid << "_desc_id_" << a_nFileID;
};
return commandStream.str();
}
void CIOTrace::processLine(char *a_sLine)
{
std::unique_ptr<CStraceOutputParser::CStraceOperation> l_oStraceOp=CStraceOutputParser::parseStraceLine(a_sLine, m_bFollowFork);
// Not a strace output line (this can happen since the command line we asked strace to run writes to same pipe)
if (!l_oStraceOp)
{
// We print non strace lines which may have come from the command line we asked strace to run
LOG(ePrint)<< a_sLine<< endl;
return;
}
// In case the flag -f wasn't added to strace, the pid for each line isn't reported
// so we need to use the pid we got for the tracing command
if (!m_bFollowFork)
l_oStraceOp->setPid(m_nAttachProcess);
if (l_oStraceOp->pid()>0)
{
tPidSet::iterator l_oIter= m_oPidSet.find(l_oStraceOp->pid());
if (l_oIter==m_oPidSet.end())
{
string l_sProcName=CGetProcessInfo::getCommandLine(l_oStraceOp->pid());
LOG(ePrint)<< "new pid "<<l_oStraceOp->pid()<<" process "<< l_sProcName;
// Add the files already opened into the active files list
m_oPidSet.insert(tPidSet::value_type(l_oStraceOp->pid()));
addProcessFilesAndSocketsToActiveFiles(l_oStraceOp->pid());
}
else
{
LOG(eInfo) << "Handling pid="<< l_oStraceOp->pid()<<endl;
}
}
if (l_oStraceOp->resumed())
handleUnfinished(*l_oStraceOp);
else
{
switch (l_oStraceOp->opType())
{
case eOpen: // open
handleOpen(dynamic_cast<CStraceOutputParser::CStraceOpenOperation&>(*l_oStraceOp));
return;
break;
case eRead: // read
handleRead(dynamic_cast<CStraceOutputParser::CStraceReadOperation&>(*l_oStraceOp));
return;
break;
case eWrite: // write
handleWrite(dynamic_cast<CStraceOutputParser::CStraceWriteOperation&>(*l_oStraceOp));
return;
break;
case eClose: // close
handleClose(dynamic_cast<CStraceOutputParser::CStraceCloseOperation&>(*l_oStraceOp));
return;
break;
}
}
}
void CIOTrace::addPendingIoOperation(
tProcessId a_nPid,
tIoOp a_nOp,
tFileNum a_nFileId,
std::string a_sFilename)
{
switch (a_nOp)
{
case tIoOp::eRead:
case tIoOp::eWrite:
case tIoOp::eClose:
m_oPedningIoOperations.insert(
tFilePendingInfoMap::value_type(a_nPid, CPendingIoOp(a_nOp, a_nFileId)));
LOG(eInfo)<< "Added incomplete operation data pid="<< a_nPid << ", op=" << a_nOp << "fileid=" << a_nFileId<<endl;
break;
case tIoOp::eOpen:
m_oPedningIoOperations.insert(
tFilePendingInfoMap::value_type(a_nPid, CPendingIoOp(a_nOp, a_sFilename)));
LOG(eInfo) << "Added incomplete operation data pid="<< a_nPid << ", op=" << a_nOp << "file name=" << a_sFilename<<endl;
break;
}
}
CActiveFileInfo *CIOTrace::GetActiveFile(tProcessId a_nPid, tFileNum a_nFileNum)
{
tActiveFiles::iterator l_oIter;
l_oIter=m_oActiveFilesMap.find(CActiveFileId(a_nPid, a_nFileNum));
if (l_oIter==m_oActiveFilesMap.end())
return NULL;
else
return &(l_oIter->second);
}
void CIOTrace::handleOpen(const CStraceOutputParser::CStraceOpenOperation & a_oStraceOp)
{
if (a_oStraceOp.unfinished())
{
addPendingIoOperation(a_oStraceOp.pid(), eOpen, UNKNOWN_NUM, a_oStraceOp.filename());
return;
}
else
{
AddActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum(), a_oStraceOp.filename());
CActiveFileInfo *l_oFile=GetActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum());
if (l_oFile) l_oFile->open();
}
}
void CIOTrace::UpdateRead(CActiveFileInfo *a_opActiveFile, const CStraceOutputParser::CStraceReadOperation & a_oStraceOp)
{
if (m_bReportOnline)
LOG(ePrint)<<a_opActiveFile->getName()<<CSV_SEP<<a_oStraceOp.bytes()<<CSV_SEP<<0<<endl;
a_opActiveFile->read(a_oStraceOp.bytes());
}
void CIOTrace::handleRead(const CStraceOutputParser::CStraceReadOperation & a_oStraceOp)
{
if (a_oStraceOp.unfinished())
{
addPendingIoOperation(a_oStraceOp.pid(), eRead, a_oStraceOp.fileNum(), "");
return;
}
else
{
CActiveFileInfo *l_opActiveFile=GetActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum());
if (l_opActiveFile)
{
UpdateRead(l_opActiveFile, a_oStraceOp);
}
else
{
if (m_bIncludeIncomplete)
{
string l_sIncompleteName = genIncompleteFilenameName(a_oStraceOp.pid(), a_oStraceOp.fileNum());
// If the name returns empty it means that the file name was found already and added
// to the active file list
if (l_sIncompleteName!="")
AddActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum(), l_sIncompleteName.c_str());
CActiveFileInfo *l_opActiveFile=GetActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum());
if (l_opActiveFile)
{
UpdateRead(l_opActiveFile, a_oStraceOp);
}
else
{
LOG(eError) << "couldn't find file read details for " << a_oStraceOp.fileNum()<< endl;
}
}
else {
LOG(eError)<< "couldn't find file read details for "<< a_oStraceOp.fileNum() <<endl;
}
}
}
}
void CIOTrace::updateWrite(CActiveFileInfo *a_opActiveFile, const CStraceOutputParser::CStraceWriteOperation & a_oStraceOp)
{
if (m_bReportOnline)
LOG(ePrint)<<a_opActiveFile->getName()<<CSV_SEP<<0<<a_oStraceOp.bytes()<<CSV_SEP<<endl;
a_opActiveFile->write(a_oStraceOp.bytes());
}
void CIOTrace::handleWrite(const CStraceOutputParser::CStraceWriteOperation & a_oStraceOp)
{
if (a_oStraceOp.unfinished())
{
addPendingIoOperation(a_oStraceOp.pid(), eWrite, a_oStraceOp.fileNum(), string(""));
return;
}
else
{
CActiveFileInfo *l_opActiveFile=GetActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum());
if (l_opActiveFile)
{
updateWrite(l_opActiveFile, a_oStraceOp);
}
else
{
if (m_bIncludeIncomplete)
{
string l_sIncompleteName = genIncompleteFilenameName(a_oStraceOp.pid(), a_oStraceOp.fileNum());
// If the name returns empty it means that the file name was found already and added
// to the active file list
if (l_sIncompleteName!="")
AddActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum(), l_sIncompleteName.c_str());
LOG(eInfo) << "Added active file for descriptor " << a_oStraceOp.fileNum() << endl;
CActiveFileInfo *l_opActiveFile=GetActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum());
if (l_opActiveFile)
{
updateWrite(l_opActiveFile, a_oStraceOp);
}
else
LOG(eError)<< "coultn't find file write details, file num "<< a_oStraceOp.fileNum() <<endl;
}
else
LOG(eError) << "couldn't find file write details, file num " << a_oStraceOp.fileNum() << endl;
}
}
}
void CIOTrace::handleClose(const CStraceOutputParser::CStraceCloseOperation & a_oStraceOp)
{
if (a_oStraceOp.unfinished())
{
addPendingIoOperation(a_oStraceOp.pid(), eClose, a_oStraceOp.fileNum(), "");
}
else
{
CActiveFileInfo *l_opActiveFile=GetActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum());
if (l_opActiveFile)
{
LOG(eInfo) << "closing active file ["<< l_opActiveFile->getName()<<"]"<<endl;
RemoveActiveFile(a_oStraceOp.pid(), a_oStraceOp.fileNum());
}
else
LOG(eError)<< "closing an unknown active file " <<a_oStraceOp.fileNum() << endl;
}
}
void CIOTrace::handleUnfinished(CStraceOutputParser::CStraceOperation & a_opStraceOp)
{
tFilePendingInfoMap::iterator l_oIter;
l_oIter=m_oPedningIoOperations.find(a_opStraceOp.pid());
if (l_oIter==m_oPedningIoOperations.end())
{
LOG(eFatal) << "couldn't find pending operation data" << endl;
return;
}
CPendingIoOp &l_oPendOp = l_oIter->second;
switch (l_oPendOp.op())
{
case eOpen :
{
CStraceOutputParser::CStraceOpenOperation l_oOp=dynamic_cast<CStraceOutputParser::CStraceOpenOperation&>(a_opStraceOp);
l_oOp.setFilename(l_oPendOp.filename());
l_oOp.setComplete();
handleOpen(l_oOp);
}
break;
case eClose:
{
CStraceOutputParser::CStraceCloseOperation & l_oOp=dynamic_cast<CStraceOutputParser::CStraceCloseOperation&>(a_opStraceOp);
l_oOp.setFileNum(l_oPendOp.fileId());
l_oOp.setComplete();
handleClose(l_oOp);
}
break;
case eRead:
{
CStraceOutputParser::CStraceReadOperation & l_oOp=dynamic_cast<CStraceOutputParser::CStraceReadOperation&>(a_opStraceOp);
l_oOp.setFileNum(l_oPendOp.fileId());
l_oOp.setComplete();
handleRead(l_oOp);
}
break;
case eWrite:
{
CStraceOutputParser::CStraceWriteOperation & l_oOp=dynamic_cast<CStraceOutputParser::CStraceWriteOperation&>(a_opStraceOp);
l_oOp.setFileNum(l_oPendOp.fileId());
l_oOp.setComplete();
handleWrite(l_oOp);
}
break;
}
m_oPedningIoOperations.erase(l_oIter);
}
|
; A004232: a(n) = n^2 + prime(n).
; 3,7,14,23,36,49,66,83,104,129,152,181,210,239,272,309,348,385,428,471,514,563,612,665,722,777,832,891,950,1013,1088,1155,1226,1295,1374,1447,1526,1607,1688,1773,1860,1945,2040,2129,2222,2315,2420,2527,2628,2729
mov $9,$0
mov $11,2
mov $13,$0
lpb $11
mov $0,$9
sub $11,1
add $0,$11
sub $0,1
mov $2,$0
mov $5,$0
mov $6,$0
cal $0,40 ; The prime numbers.
add $2,$0
mov $3,$5
sub $3,2
add $4,$2
sub $4,$3
mov $1,$4
mov $8,$6
mul $8,2
add $1,$8
mov $12,$11
lpb $12
mov $10,$1
sub $12,1
lpe
lpe
mov $1,$10
sub $1,1
mov $7,$13
mul $7,$13
add $1,$7
|
#ifndef RESOURCE_SCOPE_HPP
#define RESOURCE_SCOPE_HPP
#include <vector>
#include <memory>
namespace ag {
template <typename D> class ResourceScope {
public:
using Texture1DHandle = typename D::Texture1DHandle;
using Texture2DHandle = typename D::Texture2DHandle;
using Texture3DHandle = typename D::Texture3DHandle;
using SamplerHandle = typename D::SamplerHandle;
using BufferHandle = typename D::BufferHandle;
using GraphicsPipelineHandle = typename D::GraphicsPipelineHandle;
void addTexture1DHandle(Texture1DHandle handle) {
textures1D.emplace_back(std::move(handle));
}
void addTexture2DHandle(Texture2DHandle handle) {
textures2D.emplace_back(std::move(handle));
}
void addTexture3DHandle(Texture3DHandle handle) {
textures3D.emplace_back(std::move(handle));
}
void addSamplerHandle(SamplerHandle handle) {
samplers.emplace_back(std::move(handle));
}
void addBufferHandle(BufferHandle handle) {
buffers.emplace_back(std::move(handle));
}
void addGraphicsPipelineHandle(GraphicsPipelineHandle handle) {
pipelines.emplace_back(std::move(handle));
}
void clear() {
textures1D.clear();
textures2D.clear();
textures3D.clear();
samplers.clear();
buffers.clear();
pipelines.clear();
}
std::vector<Texture1DHandle> textures1D;
std::vector<Texture2DHandle> textures2D;
std::vector<Texture3DHandle> textures3D;
std::vector<SamplerHandle> samplers;
std::vector<BufferHandle> buffers;
std::vector<GraphicsPipelineHandle> pipelines;
};
}
#endif // !RESOURCE_SCOPE_HPP
|
;===============================================================================
;- Program:
;-
;- Filename: .asm
;- Version: 1.0.0
;- Autor: Benj Fassbind
;-
;- Purpose: uP-Schulung
;-
;- Description:
;-
;-
;-
;- Entwicklungsablauf:
;- Version: Datum: Autor: Entwicklungsschritt: Zeit:
;- 1.0.0 01.01.13 FAB Ganzes Programm erstellt Min.
;-
;- Totalzeit: Min.
;-
;- Copyright: Benj Fassbind, Sonneggstrasse 13, 6410 Goldau (2013)
;------------------------------------------------------------------------------
;--- uController ---
.include "m2560def.inc"
;------------------------------------------------------------------------------
; Interrupt-Adresse-Vectors
RJMP Reset ; Ext-Pin, Power-on, Brown-out,Watchdog Reset
RETI ; External Interrupt Request 0
RETI ; External Interrupt Request 1
RETI ; External Interrupt Request 3
RETI ; External Interrupt Request 4
RETI ; External Interrupt Request 5
RETI ; External Interrupt Request 6
RETI ; External Interrupt Request 7
RETI ; Pin Change Interrupt Request 0
RETI ; Pin Change Interrupt Request 1
RETI ; Pin Change Interrupt Request 2
RETI ; Watchdog Time-out Interrupt
RETI ; Timer/Counter2 Compare Match A
RETI ; Timer/Counter2 Compare Match B
RETI ; Timer/Counter2 Overflow
RETI ; Timer/Counter1 Capture Event
RETI ; Timer/Counter1 Compare Match A
RETI ; Timer/Counter1 Compare Match B
RETI ; Timer/Counter1 Compare Match C
RETI ; Timer/Counter1 Overflow
RETI ; Timer/Counter0 Compare Match A
RETI ; Timer/Counter0 Compare Match B
RETI ; Timer/Counter0 Overflow
RETI ; SPI Serial Transfer Complete
RETI ; USART0 Rx Complete
RETI ; USART0 Data Register Empty
RETI ; USART0 Tx Complete
RETI ; Analog Comparator
;--- Include-Files ---
;--- constants ---
.equ LED = PORTB ; Output for LED
.equ LED_D = DDRB ; Data direction Port for LED
.equ SWITCH = PIND ; Input for SWITCH
.equ SWITCH_D = DDRD ; Data direction Port for SWITCH
;--- variables ---
.def mpr = R16 ; multipurpose register
;------------------------------------------------------------------------------
; Main program
;------------------------------------------------------------------------------
;--- Initialisation ---
Reset: SER mpr ; Output:= LED
OUT LED_D, mpr
CLR mpr ; Input:= Switch-values
OUT SWITCH_D, mpr
LDI mpr, LOW(RAMEND) ; Initialise stack
OUT SPL,mpr
LDI mpr, HIGH(RAMEND)
OUT SPH,mpr
;--- Main program: ---
Main: ; main function
; Internal SRAM access: ---
LDI mpr, 0xCD ; mpr = 0xCD
STS 0x200, mpr ; write mpr to sram (addr: 0x001)
CLR mpr ; mpr = 0x00
LDS mpr, 0x200 ; load from sram to mpr (addr: 0x001)
RJMP Main ; endless loop
;------------------------------------------------------------------------------
; Subroutines
;------------------------------------------------------------------------------ |
/**********************************************************************
Sneedacity: A Digital Audio Editor
EffectUI.cpp
Leland Lucius
Sneedacity is copyright (c) 1999-2008 Audacity Team,
copyright (c) 2021 Sneedacity Team.
License: GPL v2. See License.txt.
**********************************************************************/
#include "EffectUI.h"
#include "Effect.h"
#include "EffectManager.h"
#include "../ProjectHistory.h"
#include "../ProjectWindowBase.h"
#include "../TrackPanelAx.h"
#include "RealtimeEffectManager.h"
#if defined(EXPERIMENTAL_EFFECTS_RACK)
#include "../UndoManager.h"
#include <wx/dcmemory.h>
#include <wx/defs.h>
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include <wx/frame.h>
#include <wx/image.h>
#include <wx/imaglist.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/stattext.h>
#include <wx/timer.h>
#include <wx/tglbtn.h>
#include "../commands/CommandContext.h"
#include "../Prefs.h"
#include "../Project.h"
#include "../widgets/wxPanelWrapper.h"
#include "../../images/EffectRack/EffectRack.h"
#define COL_POWER 0
#define COL_EDITOR 1
#define COL_UP 2
#define COL_DOWN 3
#define COL_FAV 4
#define COL_REMOVE 5
#define COL_NAME 6
#define NUMCOLS 7
#define ID_BASE 20000
#define ID_RANGE 100
#define ID_POWER (ID_BASE + (COL_POWER * ID_RANGE))
#define ID_EDITOR (ID_BASE + (COL_EDITOR * ID_RANGE))
#define ID_UP (ID_BASE + (COL_UP * ID_RANGE))
#define ID_DOWN (ID_BASE + (COL_DOWN * ID_RANGE))
#define ID_FAV (ID_BASE + (COL_FAV * ID_RANGE))
#define ID_REMOVE (ID_BASE + (COL_REMOVE * ID_RANGE))
#define ID_NAME (ID_BASE + (COL_NAME * ID_RANGE))
BEGIN_EVENT_TABLE(EffectRack, wxFrame)
EVT_CLOSE(EffectRack::OnClose)
EVT_TIMER(wxID_ANY, EffectRack::OnTimer)
EVT_BUTTON(wxID_APPLY, EffectRack::OnApply)
EVT_TOGGLEBUTTON(wxID_CLEAR, EffectRack::OnBypass)
EVT_COMMAND_RANGE(ID_REMOVE, ID_REMOVE + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnRemove)
EVT_COMMAND_RANGE(ID_POWER, ID_POWER + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnPower)
EVT_COMMAND_RANGE(ID_EDITOR, ID_EDITOR + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnEditor)
EVT_COMMAND_RANGE(ID_UP, ID_UP + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnUp)
EVT_COMMAND_RANGE(ID_DOWN, ID_DOWN + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnDown)
EVT_COMMAND_RANGE(ID_FAV, ID_FAV + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnFav)
END_EVENT_TABLE()
EffectRack::EffectRack( SneedacityProject &project )
: wxFrame( &GetProjectFrame( project ),
wxID_ANY,
_("Effects Rack"),
wxDefaultPosition,
wxDefaultSize,
wxSYSTEM_MENU |
wxCLOSE_BOX |
wxCAPTION |
wxFRAME_NO_TASKBAR |
wxFRAME_FLOAT_ON_PARENT)
, mProject{ project }
{
mBypassing = false;
mNumEffects = 0;
mLastLatency = 0;
mTimer.SetOwner(this);
mPowerPushed = CreateBitmap(power_on_16x16_xpm, false, false);
mPowerRaised = CreateBitmap(power_off_16x16_xpm, true, false);
mSettingsPushed = CreateBitmap(settings_up_16x16_xpm, false, true);
mSettingsRaised = CreateBitmap(settings_down_16x16_xpm, true, true);
mUpDisabled = CreateBitmap(up_9x16_xpm, true, true);
mUpPushed = CreateBitmap(up_9x16_xpm, false, true);
mUpRaised = CreateBitmap(up_9x16_xpm, true, true);
mDownDisabled = CreateBitmap(down_9x16_xpm, true, true);
mDownPushed = CreateBitmap(down_9x16_xpm, false, true);
mDownRaised = CreateBitmap(down_9x16_xpm, true, true);
mFavPushed = CreateBitmap(fav_down_16x16_xpm, false, false);
mFavRaised = CreateBitmap(fav_up_16x16_xpm, true, false);
mRemovePushed = CreateBitmap(remove_16x16_xpm, false, true);
mRemoveRaised = CreateBitmap(remove_16x16_xpm, true, true);
{
auto bs = std::make_unique<wxBoxSizer>(wxVERTICAL);
mPanel = safenew wxPanelWrapper(this, wxID_ANY);
bs->Add(mPanel, 1, wxEXPAND);
SetSizer(bs.release());
}
{
auto bs = std::make_unique<wxBoxSizer>(wxVERTICAL);
{
auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
wxASSERT(mPanel); // To justify safenew
hs->Add(safenew wxButton(mPanel, wxID_APPLY, _("&Apply")), 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
hs->AddStretchSpacer();
mLatency = safenew wxStaticText(mPanel, wxID_ANY, _("Latency: 0"));
hs->Add(mLatency, 0, wxALIGN_CENTER);
hs->AddStretchSpacer();
hs->Add(safenew wxToggleButton(mPanel, wxID_CLEAR, _("&Bypass")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
bs->Add(hs.release(), 0, wxEXPAND);
}
bs->Add(safenew wxStaticLine(mPanel, wxID_ANY), 0, wxEXPAND);
{
auto uMainSizer = std::make_unique<wxFlexGridSizer>(7);
uMainSizer->AddGrowableCol(6);
uMainSizer->SetHGap(0);
uMainSizer->SetVGap(0);
bs->Add((mMainSizer = uMainSizer.release()), 1, wxEXPAND);
}
mPanel->SetSizer(bs.release());
}
wxString oldPath = gPrefs->GetPath();
gPrefs->SetPath(wxT("/EffectsRack"));
size_t cnt = gPrefs->GetNumberOfEntries();
gPrefs->SetPath(oldPath);
EffectManager & em = EffectManager::Get();
for (size_t i = 0; i < cnt; i++)
{
wxString slot;
gPrefs->Read(wxString::Format(wxT("/EffectsRack/Slot%02d"), i), &slot);
Effect *effect = em.GetEffect(slot.AfterFirst(wxT(',')));
if (effect)
{
Add(effect, slot.BeforeFirst(wxT(',')) == wxT("1"), true);
}
}
Fit();
}
EffectRack::~EffectRack()
{
gPrefs->DeleteGroup(wxT("/EffectsRack"));
for (size_t i = 0, cnt = mEffects.size(); i < cnt; i++)
{
if (mFavState[i])
{
Effect *effect = mEffects[i];
gPrefs->Write(wxString::Format(wxT("/EffectsRack/Slot%02d"), i),
wxString::Format(wxT("%d,%s"),
mPowerState[i],
effect->GetID()));
}
}
}
void EffectRack::Add(Effect *effect, bool active, bool favorite)
{
if (mEffects.end() != std::find(mEffects.begin(), mEffects.end(), effect))
{
return;
}
wxBitmapButton *bb;
wxASSERT(mPanel); // To justify safenew
bb = safenew wxBitmapButton(mPanel, ID_POWER + mNumEffects, mPowerRaised);
bb->SetBitmapSelected(mPowerRaised);
bb->SetName(_("Active State"));
bb->SetToolTip(_("Set effect active state"));
mPowerState.push_back(active);
if (active)
{
bb->SetBitmapLabel(mPowerPushed);
bb->SetBitmapSelected(mPowerPushed);
}
else
{
bb->SetBitmapLabel(mPowerRaised);
bb->SetBitmapSelected(mPowerRaised);
}
mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
bb = safenew wxBitmapButton(mPanel, ID_EDITOR + mNumEffects, mSettingsRaised);
bb->SetBitmapSelected(mSettingsPushed);
bb->SetName(_("Show/Hide Editor"));
bb->SetToolTip(_("Open/close effect editor"));
mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
bb = safenew wxBitmapButton(mPanel, ID_UP + mNumEffects, mUpRaised);
bb->SetBitmapSelected(mUpPushed);
bb->SetBitmapDisabled(mUpDisabled);
bb->SetName(_("Move Up"));
bb->SetToolTip(_("Move effect up in the rack"));
mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
bb = safenew wxBitmapButton(mPanel, ID_DOWN + mNumEffects, mDownRaised);
bb->SetBitmapSelected(mDownPushed);
bb->SetBitmapDisabled(mDownDisabled);
bb->SetName(_("Move Down"));
bb->SetToolTip(_("Move effect down in the rack"));
mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
bb = safenew wxBitmapButton(mPanel, ID_FAV + mNumEffects, mFavRaised);
bb->SetBitmapSelected(mFavPushed);
bb->SetName(_("Favorite"));
bb->SetToolTip(_("Mark effect as a favorite"));
mFavState.push_back(favorite);
if (favorite)
{
bb->SetBitmapLabel(mFavPushed);
bb->SetBitmapSelected(mFavPushed);
}
else
{
bb->SetBitmapLabel(mFavRaised);
bb->SetBitmapSelected(mFavRaised);
}
mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
bb = safenew wxBitmapButton(mPanel, ID_REMOVE + mNumEffects, mRemoveRaised);
bb->SetBitmapSelected(mRemovePushed);
bb->SetName(_("Remove"));
bb->SetToolTip(_("Remove effect from the rack"));
mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
wxStaticText *text = safenew wxStaticText(mPanel, ID_NAME + mNumEffects,
effect->GetName().Translation() );
text->SetToolTip(_("Name of the effect"));
mMainSizer->Add(text, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5);
mMainSizer->Layout();
SetSize(GetMinSize());
Fit();
Update();
mEffects.push_back(effect);
mNumEffects++;
if (!mTimer.IsRunning())
{
mTimer.Start(1000);
}
if (active)
{
UpdateActive();
}
}
void EffectRack::OnClose(wxCloseEvent & evt)
{
Show(false);
evt.Veto();
}
void EffectRack::OnTimer(wxTimerEvent & WXUNUSED(evt))
{
int latency = RealtimeEffectManager::Get().GetRealtimeLatency();
if (latency != mLastLatency)
{
mLatency->SetLabel(wxString::Format(_("Latency: %4d"), latency));
mLatency->Refresh();
mLastLatency = latency;
}
}
void EffectRack::OnApply(wxCommandEvent & WXUNUSED(evt))
{
SneedacityProject *project = &mProject;
bool success = false;
auto state = UndoManager::Get( *project ).GetCurrentState();
auto cleanup = finally( [&] {
if(!success)
// This is like a rollback of state
ProjectHistory::Get( *project ).SetStateTo( state, false );
} );
for (size_t i = 0, cnt = mEffects.size(); i < cnt; i++)
{
if (mPowerState[i])
{
if (!EffectUI::DoEffect(mEffects[i]->GetID(),
*project,
EffectManager::kConfigured))
// If any effect fails (or throws), then stop.
return;
}
}
success = true;
// Only after all succeed, do the following.
for (size_t i = 0, cnt = mEffects.size(); i < cnt; i++)
{
if (mPowerState[i])
{
mPowerState[i] = false;
wxBitmapButton *btn =
static_cast<wxBitmapButton *>(FindWindowById(ID_POWER + i));
btn->SetBitmapLabel(mPowerRaised);
btn->SetBitmapSelected(mPowerRaised);
}
}
UpdateActive();
}
void EffectRack::OnBypass(wxCommandEvent & evt)
{
mBypassing = evt.GetInt() != 0;
UpdateActive();
}
void EffectRack::OnPower(wxCommandEvent & evt)
{
wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
int index = GetEffectIndex(btn);
mPowerState[index] = !mPowerState[index];
if (mPowerState[index])
{
btn->SetBitmapLabel(mPowerPushed);
btn->SetBitmapSelected(mPowerPushed);
}
else
{
btn->SetBitmapLabel(mPowerRaised);
btn->SetBitmapSelected(mPowerRaised);
}
UpdateActive();
}
void EffectRack::OnEditor(wxCommandEvent & evt)
{
wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
evt.Skip();
int index = GetEffectIndex(btn);
if (index < 0)
{
return;
}
auto pEffect = mEffects[index];
pEffect->ShowInterface( *GetParent(), EffectUI::DialogFactory,
pEffect->IsBatchProcessing() );
}
void EffectRack::OnUp(wxCommandEvent & evt)
{
wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
evt.Skip();
int index = GetEffectIndex(btn);
if (index <= 0)
{
return;
}
MoveRowUp(index);
}
void EffectRack::OnDown(wxCommandEvent & evt)
{
wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
evt.Skip();
int index = GetEffectIndex(btn);
if (index < 0 || index == (mMainSizer->GetChildren().GetCount() / NUMCOLS) - 1)
{
return;
}
MoveRowUp(index + 1);
}
void EffectRack::OnFav(wxCommandEvent & evt)
{
wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
int index = GetEffectIndex(btn);
mFavState[index] = !mFavState[index];
if (mFavState[index])
{
btn->SetBitmapLabel(mFavPushed);
btn->SetBitmapSelected(mFavPushed);
}
else
{
btn->SetBitmapLabel(mFavRaised);
btn->SetBitmapSelected(mFavRaised);
}
}
void EffectRack::OnRemove(wxCommandEvent & evt)
{
wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
evt.Skip();
int index = GetEffectIndex(btn);
if (index < 0)
{
return;
}
mEffects.erase(mEffects.begin() + index);
mPowerState.erase(mPowerState.begin() + index);
mFavState.erase(mFavState.begin() + index);
if (mEffects.size() == 0)
{
if (mTimer.IsRunning())
{
mTimer.Stop();
}
}
index *= NUMCOLS;
for (int i = 0; i < NUMCOLS; i++)
{
std::unique_ptr<wxWindow> w {mMainSizer->GetItem(index)->GetWindow()};
mMainSizer->Detach(index);
}
mMainSizer->Layout();
Fit();
UpdateActive();
}
wxBitmap EffectRack::CreateBitmap(const char *const xpm[], bool up, bool pusher)
{
wxMemoryDC dc;
wxBitmap pic(xpm);
wxBitmap mod(pic.GetWidth() + 6, pic.GetHeight() + 6);
dc.SelectObject(mod);
#if defined( __WXGTK__ )
wxColour newColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND );
#else
wxColour newColour = wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE );
#endif
dc.SetBackground(wxBrush(newColour));
dc.Clear();
int offset = 3;
if (pusher)
{
if (!up)
{
offset += 1;
}
}
dc.DrawBitmap(pic, offset, offset, true);
dc.SelectObject(wxNullBitmap);
return mod;
}
int EffectRack::GetEffectIndex(wxWindow *win)
{
int col = (win->GetId() - ID_BASE) / ID_RANGE;
int row;
int cnt = mMainSizer->GetChildren().GetCount() / NUMCOLS;
for (row = 0; row < cnt; row++)
{
wxSizerItem *si = mMainSizer->GetItem((row * NUMCOLS) + col);
if (si->GetWindow() == win)
{
break;
}
}
if (row == cnt)
{
return -1;
}
return row;
}
void EffectRack::MoveRowUp(int row)
{
Effect *effect = mEffects[row];
mEffects.erase(mEffects.begin() + row);
mEffects.insert(mEffects.begin() + row - 1, effect);
int state = mPowerState[row];
mPowerState.erase(mPowerState.begin() + row);
mPowerState.insert(mPowerState.begin() + row - 1, state);
state = mFavState[row];
mFavState.erase(mFavState.begin() + row);
mFavState.insert(mFavState.begin() + row - 1, state);
row *= NUMCOLS;
for (int i = 0; i < NUMCOLS; i++)
{
wxSizerItem *si = mMainSizer->GetItem(row + NUMCOLS - 1);
wxWindow *w = si->GetWindow();
int flags = si->GetFlag();
int border = si->GetBorder();
int prop = si->GetProportion();
mMainSizer->Detach(row + NUMCOLS - 1);
mMainSizer->Insert(row - NUMCOLS, w, prop, flags, border);
}
mMainSizer->Layout();
Refresh();
UpdateActive();
}
void EffectRack::UpdateActive()
{
mActive.clear();
if (!mBypassing)
{
for (size_t i = 0, cnt = mEffects.size(); i < cnt; i++)
{
if (mPowerState[i])
{
mActive.push_back(mEffects[i]);
}
}
}
RealtimeEffectManager::Get().RealtimeSetEffects(
{ mActive.begin(), mActive.end() }
);
}
namespace
{
SneedacityProject::AttachedWindows::RegisteredFactory sKey{
[]( SneedacityProject &parent ) -> wxWeakRef< wxWindow > {
auto result = safenew EffectRack( parent );
result->CenterOnParent();
return result;
}
};
}
EffectRack &EffectRack::Get( SneedacityProject &project )
{
return project.AttachedWindows::Get< EffectRack >( sKey );
}
#endif
///////////////////////////////////////////////////////////////////////////////
//
// EffectPanel
//
///////////////////////////////////////////////////////////////////////////////
class EffectPanel final : public wxPanelWrapper
{
public:
EffectPanel(wxWindow *parent)
: wxPanelWrapper(parent)
{
// This fools NVDA into not saying "Panel" when the dialog gets focus
SetName(TranslatableString::Inaudible);
SetLabel(TranslatableString::Inaudible);
mAcceptsFocus = true;
}
virtual ~EffectPanel()
{
}
// ============================================================================
// wxWindow implementation
// ============================================================================
bool AcceptsFocus() const override
{
return mAcceptsFocus;
}
// So that wxPanel is not included in Tab traversal, when required - see wxWidgets bug 15581
bool AcceptsFocusFromKeyboard() const override
{
return mAcceptsFocus;
}
// ============================================================================
// EffectPanel implementation
// ============================================================================
void SetAccept(bool accept)
{
mAcceptsFocus = accept;
}
private:
bool mAcceptsFocus;
};
///////////////////////////////////////////////////////////////////////////////
//
// EffectUIHost
//
///////////////////////////////////////////////////////////////////////////////
#include "../../images/Effect.h"
#include "../AudioIO.h"
#include "../CommonCommandFlags.h"
#include "../Menus.h"
#include "../prefs/GUISettings.h" // for RTL_WORKAROUND
#include "../Project.h"
#include "../ProjectAudioManager.h"
#include "../ShuttleGui.h"
#include "../ViewInfo.h"
#include "../commands/SneedacityCommand.h"
#include "../commands/CommandContext.h"
#include "../widgets/SneedacityMessageBox.h"
#include "../widgets/HelpSystem.h"
#include <wx/bmpbuttn.h>
#include <wx/checkbox.h>
#include <wx/dcclient.h>
#include <wx/dcmemory.h>
#include <wx/menu.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#if defined(__WXMAC__)
#include <Cocoa/Cocoa.h>
#endif
static const int kDummyID = 20000;
static const int kSaveAsID = 20001;
static const int kImportID = 20002;
static const int kExportID = 20003;
static const int kDefaultsID = 20004;
static const int kOptionsID = 20005;
static const int kUserPresetsDummyID = 20006;
static const int kDeletePresetDummyID = 20007;
static const int kMenuID = 20100;
static const int kEnableID = 20101;
static const int kPlayID = 20102;
static const int kRewindID = 20103;
static const int kFFwdID = 20104;
static const int kPlaybackID = 20105;
static const int kCaptureID = 20106;
static const int kUserPresetsID = 21000;
static const int kDeletePresetID = 22000;
static const int kFactoryPresetsID = 23000;
BEGIN_EVENT_TABLE(EffectUIHost, wxDialogWrapper)
EVT_INIT_DIALOG(EffectUIHost::OnInitDialog)
EVT_ERASE_BACKGROUND(EffectUIHost::OnErase)
EVT_PAINT(EffectUIHost::OnPaint)
EVT_CLOSE(EffectUIHost::OnClose)
EVT_BUTTON(wxID_APPLY, EffectUIHost::OnApply)
EVT_BUTTON(wxID_CANCEL, EffectUIHost::OnCancel)
EVT_BUTTON(wxID_HELP, EffectUIHost::OnHelp)
EVT_BUTTON(eDebugID, EffectUIHost::OnDebug)
EVT_BUTTON(kMenuID, EffectUIHost::OnMenu)
EVT_CHECKBOX(kEnableID, EffectUIHost::OnEnable)
EVT_BUTTON(kPlayID, EffectUIHost::OnPlay)
EVT_BUTTON(kRewindID, EffectUIHost::OnRewind)
EVT_BUTTON(kFFwdID, EffectUIHost::OnFFwd)
EVT_MENU(kSaveAsID, EffectUIHost::OnSaveAs)
EVT_MENU(kImportID, EffectUIHost::OnImport)
EVT_MENU(kExportID, EffectUIHost::OnExport)
EVT_MENU(kOptionsID, EffectUIHost::OnOptions)
EVT_MENU(kDefaultsID, EffectUIHost::OnDefaults)
EVT_MENU_RANGE(kUserPresetsID, kUserPresetsID + 999, EffectUIHost::OnUserPreset)
EVT_MENU_RANGE(kDeletePresetID, kDeletePresetID + 999, EffectUIHost::OnDeletePreset)
EVT_MENU_RANGE(kFactoryPresetsID, kFactoryPresetsID + 999, EffectUIHost::OnFactoryPreset)
END_EVENT_TABLE()
EffectUIHost::EffectUIHost(wxWindow *parent,
SneedacityProject &project,
Effect *effect,
EffectUIClientInterface *client)
: wxDialogWrapper(parent, wxID_ANY, effect->GetName(),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
{
#if defined(__WXMAC__)
// Make sure the effect window actually floats above the main window
[ [((NSView *)GetHandle()) window] setLevel:NSFloatingWindowLevel];
#endif
SetName( effect->GetName() );
SetExtraStyle(GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
mParent = parent;
mEffect = effect;
mCommand = NULL;
mClient = client;
mProject = &project;
mInitialized = false;
mSupportsRealtime = false;
mDisableTransport = false;
mEnabled = true;
mPlayPos = 0.0;
mClient->SetHostUI(this);
}
EffectUIHost::EffectUIHost(wxWindow *parent,
SneedacityProject &project,
SneedacityCommand *command,
EffectUIClientInterface *client)
: wxDialogWrapper(parent, wxID_ANY, XO("Some Command") /*command->GetName()*/,
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
{
#if defined(__WXMAC__)
// Make sure the effect window actually floats above the main window
[ [((NSView *)GetHandle()) window] setLevel:NSFloatingWindowLevel];
#endif
//SetName( command->GetName() );
SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
mParent = parent;
mEffect = NULL;
mCommand = command;
mClient = client;
mProject = &project;
mInitialized = false;
mSupportsRealtime = false;
mDisableTransport = false;
mEnabled = true;
mPlayPos = 0.0;
mClient->SetHostUI(this);
}
EffectUIHost::~EffectUIHost()
{
CleanupRealtime();
if (mClient)
{
if (mNeedsResume)
Resume();
mClient->CloseUI();
mClient = NULL;
}
}
// ============================================================================
// wxWindow implementation
// ============================================================================
bool EffectUIHost::TransferDataToWindow()
{
if( mEffect )
return mEffect->TransferDataToWindow();
if( mCommand )
return mCommand->TransferDataToWindow();
return false;
}
bool EffectUIHost::TransferDataFromWindow()
{
if( mEffect)
return mEffect->TransferDataFromWindow();
if( mCommand)
return mCommand->TransferDataFromWindow();
return false;
}
// ============================================================================
// wxDialog implementation
// ============================================================================
int EffectUIHost::ShowModal()
{
#if defined(__WXMSW__)
// Swap the Close and Apply buttons
wxSizer *sz = mApplyBtn->GetContainingSizer();
wxASSERT(mApplyBtn->GetParent()); // To justify safenew
wxButton *apply = safenew wxButton(mApplyBtn->GetParent(), wxID_APPLY);
sz->Replace(mCloseBtn, apply);
sz->Replace(mApplyBtn, mCloseBtn);
sz->Layout();
mApplyBtn->Destroy();
mApplyBtn = apply;
mApplyBtn->SetDefault();
mApplyBtn->SetLabel(wxGetStockLabel(wxID_OK, 0));
mCloseBtn->SetLabel(wxGetStockLabel(wxID_CANCEL, 0));
#else
mApplyBtn->SetLabel(wxGetStockLabel(wxID_OK));
mCloseBtn->SetLabel(wxGetStockLabel(wxID_CANCEL));
#endif
Layout();
return wxDialogWrapper::ShowModal();
}
// ============================================================================
// EffectUIHost implementation
// ============================================================================
wxPanel *EffectUIHost::BuildButtonBar(wxWindow *parent)
{
mSupportsRealtime = mEffect && mEffect->SupportsRealtime();
mIsGUI = mClient->IsGraphicalUI();
mIsBatch = (mEffect && mEffect->IsBatchProcessing()) ||
(mCommand && mCommand->IsBatchProcessing());
int margin = 0;
#if defined(__WXMAC__)
margin = 3; // I'm sure it's needed because of the order things are created...
#endif
const auto bar = safenew wxPanelWrapper(parent, wxID_ANY);
// This fools NVDA into not saying "Panel" when the dialog gets focus
bar->SetName(TranslatableString::Inaudible);
bar->SetLabel(TranslatableString::Inaudible);
ShuttleGui S{ bar, eIsCreating,
false /* horizontal */,
{ -1, -1 } /* minimum size */
};
{
S.SetBorder( margin );
if (!mIsGUI)
{
mMenuBtn = S.Id( kMenuID )
.ToolTip(XO("Manage presets and options"))
.AddButton( XXO("&Manage"), wxALIGN_CENTER | wxTOP | wxBOTTOM );
}
else
{
mMenuBtn = S.Id( kMenuID )
.ToolTip(XO("Manage presets and options"))
.Name(XO("&Manage"))
.AddBitmapButton( CreateBitmap(effect_menu_xpm, true, true) );
mMenuBtn->SetBitmapPressed(CreateBitmap(effect_menu_xpm, false, true));
}
S.AddSpace( 5, 5 );
if (!mIsBatch)
{
if (!mIsGUI)
{
if (mSupportsRealtime)
{
mPlayToggleBtn = S.Id( kPlayID )
.ToolTip(XO("Start and stop playback"))
.AddButton( XXO("Start &Playback"),
wxALIGN_CENTER | wxTOP | wxBOTTOM );
}
else if (mEffect &&
(mEffect->GetType() != EffectTypeAnalyze) &&
(mEffect->GetType() != EffectTypeTool) )
{
mPlayToggleBtn = S.Id( kPlayID )
.ToolTip(XO("Preview effect"))
.AddButton( XXO("&Preview"),
wxALIGN_CENTER | wxTOP | wxBOTTOM );
}
}
else
{
mPlayBM = CreateBitmap(effect_play_xpm, true, false);
mPlayDisabledBM = CreateBitmap(effect_play_disabled_xpm, true, true);
mStopBM = CreateBitmap(effect_stop_xpm, true, false);
mStopDisabledBM = CreateBitmap(effect_stop_disabled_xpm, true, false);
mPlayBtn = S.Id( kPlayID ).AddBitmapButton( mPlayBM );
mPlayBtn->SetBitmapDisabled(mPlayDisabledBM);
mPlayBtn->SetBitmapPressed(CreateBitmap(effect_play_xpm, false, true));
if (!mSupportsRealtime)
{
mPlayBtn->SetToolTip(_("Preview effect"));
#if defined(__WXMAC__)
mPlayBtn->SetName(_("Preview effect"));
#else
mPlayBtn->SetLabel(_("&Preview effect"));
#endif
}
}
if (mSupportsRealtime)
{
if (!mIsGUI)
{
mRewindBtn = S.Id( kRewindID )
.ToolTip(XO("Skip backward"))
.AddButton( XXO("Skip &Backward"),
wxALIGN_CENTER | wxTOP | wxBOTTOM );
}
else
{
mRewindBtn = S.Id( kRewindID )
.ToolTip(XO("Skip backward"))
.Name(XO("Skip &Backward"))
.AddBitmapButton( CreateBitmap(
effect_rewind_xpm, true, true) );
mRewindBtn->SetBitmapDisabled(
CreateBitmap(effect_rewind_disabled_xpm, true, false));
mRewindBtn->SetBitmapPressed(CreateBitmap(effect_rewind_xpm, false, true));
}
if (!mIsGUI)
{
mFFwdBtn = S.Id( kFFwdID )
.ToolTip(XO("Skip forward"))
.AddButton( XXO("Skip &Forward"),
wxALIGN_CENTER | wxTOP | wxBOTTOM );
}
else
{
mFFwdBtn = S.Id( kFFwdID )
.ToolTip(XO("Skip forward"))
.Name(XO("Skip &Forward"))
.AddBitmapButton( CreateBitmap(
effect_ffwd_xpm, true, true) );
mFFwdBtn->SetBitmapDisabled(
CreateBitmap(effect_ffwd_disabled_xpm, true, false));
mFFwdBtn->SetBitmapPressed(CreateBitmap(effect_ffwd_xpm, false, true));
}
S.AddSpace( 5, 5 );
mEnableCb = S.Id( kEnableID )
.Position(wxALIGN_CENTER | wxTOP | wxBOTTOM)
.Name(XO("Enable"))
.AddCheckBox( XXO("&Enable"), mEnabled );
//
}
}
}
bar->GetSizer()->SetSizeHints( bar );
return bar;
}
bool EffectUIHost::Initialize()
{
{
auto gAudioIO = AudioIO::Get();
mDisableTransport = !gAudioIO->IsAvailable(mProject);
mPlaying = gAudioIO->IsStreamActive(); // not exactly right, but will suffice
mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0 && !gAudioIO->IsMonitoring();
}
EffectPanel *w {};
ShuttleGui S{ this, eIsCreating };
{
S.StartHorizontalLay( wxEXPAND );
{
Destroy_ptr<EffectPanel> uw{ safenew EffectPanel( S.GetParent() ) };
RTL_WORKAROUND(uw.get());
// Try to give the window a sensible default/minimum size
uw->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
mParent->GetSize().GetHeight() / 2));
ShuttleGui S1{ uw.get(), eIsCreating };
if (!mClient->PopulateUI(S1))
{
return false;
}
S.Prop( 1 )
.Position(wxEXPAND)
.AddWindow((w = uw.release()));
}
S.EndHorizontalLay();
S.StartPanel();
{
const auto bar = BuildButtonBar( S.GetParent() );
long buttons;
if ( mEffect && mEffect->ManualPage().empty() && mEffect->HelpPage().empty()) {
buttons = eApplyButton | eCloseButton;
this->SetAcceleratorTable(wxNullAcceleratorTable);
}
else {
buttons = eApplyButton | eCloseButton | eHelpButton;
wxAcceleratorEntry entries[1];
#if defined(__WXMAC__)
// Is there a standard shortcut on Mac?
#else
entries[0].Set(wxACCEL_NORMAL, (int) WXK_F1, wxID_HELP);
#endif
wxAcceleratorTable accel(1, entries);
this->SetAcceleratorTable(accel);
}
if (mEffect && mEffect->mUIDebug) {
buttons |= eDebugButton;
}
S.AddStandardButtons(buttons, bar);
}
S.EndPanel();
}
Layout();
Fit();
Center();
mApplyBtn = (wxButton *) FindWindow(wxID_APPLY);
mCloseBtn = (wxButton *) FindWindow(wxID_CANCEL);
UpdateControls();
w->SetAccept(!mIsGUI);
(!mIsGUI ? w : FindWindow(wxID_APPLY))->SetFocus();
LoadUserPresets();
InitializeRealtime();
SetMinSize(GetSize());
return true;
}
void EffectUIHost::OnInitDialog(wxInitDialogEvent & evt)
{
// Do default handling
wxDialogWrapper::OnInitDialog(evt);
#if wxCHECK_VERSION(3, 0, 0)
//#warning "check to see if this still needed in wx3"
#endif
// Pure hackage coming down the pike...
//
// I have no idea why, but if a wxTextCtrl is the first control in the
// panel, then its contents will not be automatically selected when the
// dialog is displayed.
//
// So, we do the selection manually.
wxTextCtrl *focused = wxDynamicCast(FindFocus(), wxTextCtrl);
if (focused)
{
focused->SelectAll();
}
}
void EffectUIHost::OnErase(wxEraseEvent & WXUNUSED(evt))
{
// Ignore it
}
void EffectUIHost::OnPaint(wxPaintEvent & WXUNUSED(evt))
{
wxPaintDC dc(this);
dc.Clear();
}
void EffectUIHost::OnClose(wxCloseEvent & WXUNUSED(evt))
{
DoCancel();
CleanupRealtime();
Hide();
if (mNeedsResume)
Resume();
mClient->CloseUI();
mClient = NULL;
Destroy();
}
void EffectUIHost::OnApply(wxCommandEvent & evt)
{
auto &project = *mProject;
// On wxGTK (wx2.8.12), the default action is still executed even if
// the button is disabled. This appears to affect all wxDialogs, not
// just our Effects dialogs. So, this is a only temporary workaround
// for legacy effects that disable the OK button. Hopefully this has
// been corrected in wx3.
if (!FindWindow(wxID_APPLY)->IsEnabled())
{
return;
}
// Honor the "select all if none" preference...a little hackish, but whatcha gonna do...
if (!mIsBatch &&
mEffect &&
mEffect->GetType() != EffectTypeGenerate &&
mEffect->GetType() != EffectTypeTool &&
ViewInfo::Get( project ).selectedRegion.isPoint())
{
auto flags = AlwaysEnabledFlag;
bool allowed =
MenuManager::Get( project ).ReportIfActionNotAllowed(
mEffect->GetName(),
flags,
WaveTracksSelectedFlag() | TimeSelectedFlag());
if (!allowed)
return;
}
if (!mClient->ValidateUI())
{
return;
}
// This will take care of calling TransferDataFromWindow() for an effect.
if (mEffect && !mEffect->SaveUserPreset(mEffect->GetCurrentSettingsGroup()))
{
return;
}
// This will take care of calling TransferDataFromWindow() for a command.
if (mCommand ){
wxString params;
mCommand->GetAutomationParameters( params );
}
if( mEffect )
mEffect->mUIResultID = evt.GetId();
if (IsModal())
{
mDismissed = true;
EndModal(true);
Close();
return;
}
// Progress dialog no longer yields, so this "shouldn't" be necessary (yet to be proven
// for sure), but it is a nice visual cue that something is going on.
mApplyBtn->Disable();
auto cleanup = finally( [&] { mApplyBtn->Enable(); } );
if( mEffect ) {
CommandContext context( project );
// This is absolute hackage...but easy and I can't think of another way just now.
//
// It should callback to the EffectManager to kick off the processing
EffectUI::DoEffect(mEffect->GetID(), context,
EffectManager::kConfigured);
}
if( mCommand )
// PRL: I don't like the global and would rather pass *mProject!
// But I am preserving old behavior
mCommand->Apply( CommandContext{ project } );
}
void EffectUIHost::DoCancel()
{
if (!mDismissed) {
if( mEffect )
mEffect->mUIResultID = wxID_CANCEL;
if (IsModal())
EndModal(false);
else
Hide();
mDismissed = true;
}
}
void EffectUIHost::OnCancel(wxCommandEvent & WXUNUSED(evt))
{
DoCancel();
Close();
}
void EffectUIHost::OnHelp(wxCommandEvent & WXUNUSED(event))
{
if (mEffect && mEffect->GetFamily() == NYQUISTEFFECTS_FAMILY && (mEffect->ManualPage().empty())) {
// Old ShowHelp required when there is no on-line manual.
// Always use default web browser to allow full-featured HTML pages.
HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->HelpPage(), wxEmptyString, true, true);
}
else if( mEffect )
{
// otherwise use the NEW ShowHelp
HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->ManualPage(), true);
}
}
void EffectUIHost::OnDebug(wxCommandEvent & evt)
{
OnApply(evt);
if( mEffect )
mEffect->mUIResultID = evt.GetId();
}
void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt))
{
wxMenu menu;
if( !mEffect )
return;
LoadUserPresets();
if (mUserPresets.size() == 0)
{
menu.Append(kUserPresetsDummyID, _("User Presets"))->Enable(false);
}
else
{
auto sub = std::make_unique<wxMenu>();
for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
{
sub->Append(kUserPresetsID + i, mUserPresets[i]);
}
menu.Append(0, _("User Presets"), sub.release());
}
menu.Append(kSaveAsID, _("Save Preset..."));
if (mUserPresets.size() == 0)
{
menu.Append(kDeletePresetDummyID, _("Delete Preset"))->Enable(false);
}
else
{
auto sub = std::make_unique<wxMenu>();
for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
{
sub->Append(kDeletePresetID + i, mUserPresets[i]);
}
menu.Append(0, _("Delete Preset"), sub.release());
}
menu.AppendSeparator();
auto factory = mEffect->GetFactoryPresets();
{
auto sub = std::make_unique<wxMenu>();
sub->Append(kDefaultsID, _("Defaults"));
if (factory.size() > 0)
{
sub->AppendSeparator();
for (size_t i = 0, cnt = factory.size(); i < cnt; i++)
{
auto label = factory[i];
if (label.empty())
{
label = _("None");
}
sub->Append(kFactoryPresetsID + i, label);
}
}
menu.Append(0, _("Factory Presets"), sub.release());
}
menu.AppendSeparator();
menu.Append(kImportID, _("Import..."))->Enable(mClient->CanExportPresets());
menu.Append(kExportID, _("Export..."))->Enable(mClient->CanExportPresets());
menu.AppendSeparator();
menu.Append(kOptionsID, _("Options..."))->Enable(mClient->HasOptions());
menu.AppendSeparator();
{
auto sub = std::make_unique<wxMenu>();
sub->Append(kDummyID, wxString::Format(_("Type: %s"),
::wxGetTranslation( mEffect->GetFamily().Translation() )));
sub->Append(kDummyID, wxString::Format(_("Name: %s"), mEffect->GetName().Translation()));
sub->Append(kDummyID, wxString::Format(_("Version: %s"), mEffect->GetVersion()));
sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), mEffect->GetVendor().Translation()));
sub->Append(kDummyID, wxString::Format(_("Description: %s"), mEffect->GetDescription().Translation()));
menu.Append(0, _("About"), sub.release());
}
wxWindow *btn = FindWindow(kMenuID);
wxRect r = btn->GetRect();
btn->PopupMenu(&menu, r.GetLeft(), r.GetBottom());
}
void EffectUIHost::Resume()
{
if (!mClient->ValidateUI()) {
// If we're previewing we should still be able to stop playback
// so don't disable transport buttons.
// mEffect->EnableApply(false); // currently this would also disable transport buttons.
// The preferred behaviour is currently undecided, so for now
// just disallow enabling until settings are valid.
mEnabled = false;
mEnableCb->SetValue(mEnabled);
return;
}
RealtimeEffectManager::Get().RealtimeResumeOne( *mEffect );
}
void EffectUIHost::OnEnable(wxCommandEvent & WXUNUSED(evt))
{
mEnabled = mEnableCb->GetValue();
if (mEnabled) {
Resume();
mNeedsResume = false;
}
else
{
RealtimeEffectManager::Get().RealtimeSuspendOne( *mEffect );
mNeedsResume = true;
}
UpdateControls();
}
void EffectUIHost::OnPlay(wxCommandEvent & WXUNUSED(evt))
{
if (!mSupportsRealtime)
{
if (!mClient->ValidateUI() || !mEffect->TransferDataFromWindow())
{
return;
}
mEffect->Preview(false);
return;
}
if (mPlaying)
{
auto gAudioIO = AudioIO::Get();
mPlayPos = gAudioIO->GetStreamTime();
auto &projectAudioManager = ProjectAudioManager::Get( *mProject );
projectAudioManager.Stop();
}
else
{
auto &viewInfo = ViewInfo::Get( *mProject );
const auto &selectedRegion = viewInfo.selectedRegion;
const auto &playRegion = viewInfo.playRegion;
if ( playRegion.Locked() )
{
mRegion.setTimes(playRegion.GetStart(), playRegion.GetEnd());
mPlayPos = mRegion.t0();
}
else if (selectedRegion.t0() != mRegion.t0() ||
selectedRegion.t1() != mRegion.t1())
{
mRegion = selectedRegion;
mPlayPos = mRegion.t0();
}
if (mPlayPos > mRegion.t1())
{
mPlayPos = mRegion.t1();
}
auto &projectAudioManager = ProjectAudioManager::Get( *mProject );
projectAudioManager.PlayPlayRegion(
SelectedRegion(mPlayPos, mRegion.t1()),
DefaultPlayOptions( *mProject ),
PlayMode::normalPlay );
}
}
void EffectUIHost::OnRewind(wxCommandEvent & WXUNUSED(evt))
{
if (mPlaying)
{
auto gAudioIO = AudioIO::Get();
double seek;
gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
double pos = gAudioIO->GetStreamTime();
if (pos - seek < mRegion.t0())
{
seek = pos - mRegion.t0();
}
gAudioIO->SeekStream(-seek);
}
else
{
mPlayPos = mRegion.t0();
}
}
void EffectUIHost::OnFFwd(wxCommandEvent & WXUNUSED(evt))
{
if (mPlaying)
{
double seek;
gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
auto gAudioIO = AudioIO::Get();
double pos = gAudioIO->GetStreamTime();
if (mRegion.t0() < mRegion.t1() && pos + seek > mRegion.t1())
{
seek = mRegion.t1() - pos;
}
gAudioIO->SeekStream(seek);
}
else
{
// It allows to play past end of selection...probably useless
mPlayPos = mRegion.t1();
}
}
void EffectUIHost::OnPlayback(wxCommandEvent & evt)
{
evt.Skip();
if (evt.GetInt() != 0)
{
if (evt.GetEventObject() != mProject)
{
mDisableTransport = true;
}
else
{
mPlaying = true;
}
}
else
{
mDisableTransport = false;
mPlaying = false;
}
if (mPlaying)
{
mRegion = ViewInfo::Get( *mProject ).selectedRegion;
mPlayPos = mRegion.t0();
}
UpdateControls();
}
void EffectUIHost::OnCapture(wxCommandEvent & evt)
{
evt.Skip();
if (evt.GetInt() != 0)
{
if (evt.GetEventObject() != mProject)
{
mDisableTransport = true;
}
else
{
mCapturing = true;
}
}
else
{
mDisableTransport = false;
mCapturing = false;
}
UpdateControls();
}
void EffectUIHost::OnUserPreset(wxCommandEvent & evt)
{
int preset = evt.GetId() - kUserPresetsID;
mEffect->LoadUserPreset(mEffect->GetUserPresetsGroup(mUserPresets[preset]));
return;
}
void EffectUIHost::OnFactoryPreset(wxCommandEvent & evt)
{
mEffect->LoadFactoryPreset(evt.GetId() - kFactoryPresetsID);
return;
}
void EffectUIHost::OnDeletePreset(wxCommandEvent & evt)
{
auto preset = mUserPresets[evt.GetId() - kDeletePresetID];
int res = SneedacityMessageBox(
XO("Are you sure you want to delete \"%s\"?").Format( preset ),
XO("Delete Preset"),
wxICON_QUESTION | wxYES_NO);
if (res == wxYES)
{
mEffect->RemovePrivateConfigSubgroup(mEffect->GetUserPresetsGroup(preset));
}
LoadUserPresets();
return;
}
void EffectUIHost::OnSaveAs(wxCommandEvent & WXUNUSED(evt))
{
wxTextCtrl *text;
wxString name;
wxDialogWrapper dlg(this, wxID_ANY, XO("Save Preset"));
ShuttleGui S(&dlg, eIsCreating);
S.StartPanel();
{
S.StartVerticalLay(1);
{
S.StartHorizontalLay(wxALIGN_LEFT, 0);
{
text = S.AddTextBox(XXO("Preset name:"), name, 30);
}
S.EndHorizontalLay();
S.SetBorder(10);
S.AddStandardButtons();
}
S.EndVerticalLay();
}
S.EndPanel();
dlg.SetSize(dlg.GetSizer()->GetMinSize());
dlg.Center();
dlg.Fit();
while (true)
{
int rc = dlg.ShowModal();
if (rc != wxID_OK)
{
break;
}
name = text->GetValue();
if (name.empty())
{
SneedacityMessageDialog md(
this,
XO("You must specify a name"),
XO("Save Preset") );
md.Center();
md.ShowModal();
continue;
}
if ( make_iterator_range( mUserPresets ).contains( name ) )
{
SneedacityMessageDialog md(
this,
XO("Preset already exists.\n\nReplace?"),
XO("Save Preset"),
wxYES_NO | wxCANCEL | wxICON_EXCLAMATION );
md.Center();
int choice = md.ShowModal();
if (choice == wxID_CANCEL)
{
break;
}
if (choice == wxID_NO)
{
continue;
}
}
mEffect->SaveUserPreset(mEffect->GetUserPresetsGroup(name));
LoadUserPresets();
break;
}
return;
}
void EffectUIHost::OnImport(wxCommandEvent & WXUNUSED(evt))
{
mClient->ImportPresets();
LoadUserPresets();
return;
}
void EffectUIHost::OnExport(wxCommandEvent & WXUNUSED(evt))
{
// may throw
// exceptions are handled in SneedacityApp::OnExceptionInMainLoop
mClient->ExportPresets();
return;
}
void EffectUIHost::OnOptions(wxCommandEvent & WXUNUSED(evt))
{
mClient->ShowOptions();
return;
}
void EffectUIHost::OnDefaults(wxCommandEvent & WXUNUSED(evt))
{
mEffect->LoadFactoryDefaults();
return;
}
wxBitmap EffectUIHost::CreateBitmap(const char * const xpm[], bool up, bool pusher)
{
wxMemoryDC dc;
wxBitmap pic(xpm);
wxBitmap mod(pic.GetWidth() + 6, pic.GetHeight() + 6, 24);
dc.SelectObject(mod);
#if defined(__WXGTK__)
wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND);
#else
wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
#endif
dc.SetBackground(wxBrush(newColour));
dc.Clear();
int offset = 3;
if (pusher)
{
if (!up)
{
offset += 1;
}
}
dc.DrawBitmap(pic, offset, offset, true);
dc.SelectObject(wxNullBitmap);
return mod;
}
void EffectUIHost::UpdateControls()
{
if (mIsBatch)
{
return;
}
if (mCapturing || mDisableTransport)
{
// Don't allow focus to get trapped
wxWindow *focus = FindFocus();
if (focus == mRewindBtn || focus == mFFwdBtn || focus == mPlayBtn || focus == mEnableCb)
{
mCloseBtn->SetFocus();
}
}
mApplyBtn->Enable(!mCapturing);
if (mEffect && (mEffect->GetType() != EffectTypeAnalyze) && (mEffect->GetType() != EffectTypeTool) )
{
(!mIsGUI ? mPlayToggleBtn : mPlayBtn)->Enable(!(mCapturing || mDisableTransport));
}
if (mSupportsRealtime)
{
mRewindBtn->Enable(!(mCapturing || mDisableTransport));
mFFwdBtn->Enable(!(mCapturing || mDisableTransport));
mEnableCb->Enable(!(mCapturing || mDisableTransport));
wxBitmapButton *bb;
if (mPlaying)
{
if (!mIsGUI)
{
/* i18n-hint: The access key "&P" should be the same in
"Stop &Playback" and "Start &Playback" */
mPlayToggleBtn->SetLabel(_("Stop &Playback"));
mPlayToggleBtn->Refresh();
}
else
{
bb = (wxBitmapButton *) mPlayBtn;
bb->SetBitmapLabel(mStopBM);
bb->SetBitmapDisabled(mStopDisabledBM);
bb->SetToolTip(_("Stop"));
#if defined(__WXMAC__)
bb->SetName(_("Stop &Playback"));
#else
bb->SetLabel(_("Stop &Playback"));
#endif
}
}
else
{
if (!mIsGUI)
{
/* i18n-hint: The access key "&P" should be the same in
"Stop &Playback" and "Start &Playback" */
mPlayToggleBtn->SetLabel(_("Start &Playback"));
mPlayToggleBtn->Refresh();
}
else
{
bb = (wxBitmapButton *) mPlayBtn;
bb->SetBitmapLabel(mPlayBM);
bb->SetBitmapDisabled(mPlayDisabledBM);
bb->SetToolTip(_("Play"));
#if defined(__WXMAC__)
bb->SetName(_("Start &Playback"));
#else
bb->SetLabel(_("Start &Playback"));
#endif
}
}
}
}
void EffectUIHost::LoadUserPresets()
{
mUserPresets.clear();
if( mEffect )
mEffect->GetPrivateConfigSubgroups(mEffect->GetUserPresetsGroup(wxEmptyString), mUserPresets);
std::sort( mUserPresets.begin(), mUserPresets.end() );
return;
}
void EffectUIHost::InitializeRealtime()
{
if (mSupportsRealtime && !mInitialized)
{
RealtimeEffectManager::Get().RealtimeAddEffect(mEffect);
wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
&EffectUIHost::OnPlayback,
this);
wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
&EffectUIHost::OnCapture,
this);
mInitialized = true;
}
}
void EffectUIHost::CleanupRealtime()
{
if (mSupportsRealtime && mInitialized)
{
RealtimeEffectManager::Get().RealtimeRemoveEffect(mEffect);
mInitialized = false;
}
}
wxDialog *EffectUI::DialogFactory( wxWindow &parent, EffectHostInterface *pHost,
EffectUIClientInterface *client)
{
auto pEffect = dynamic_cast< Effect* >( pHost );
if ( ! pEffect )
return nullptr;
// Make sure there is an associated project, whose lifetime will
// govern the lifetime of the dialog, even when the dialog is
// non-modal, as for realtime effects
auto project = FindProjectFromWindow(&parent);
if ( !project )
return nullptr;
Destroy_ptr<EffectUIHost> dlg{
safenew EffectUIHost{ &parent, *project, pEffect, client} };
if (dlg->Initialize())
{
// release() is safe because parent will own it
return dlg.release();
}
return nullptr;
};
#include "../PluginManager.h"
#include "../ProjectSettings.h"
#include "../ProjectWindow.h"
#include "../SelectUtilities.h"
#include "../TrackPanel.h"
#include "../WaveTrack.h"
#include "../commands/CommandManager.h"
/// DoEffect() takes a PluginID and executes the associated effect.
///
/// At the moment flags are used only to indicate whether to prompt for
// parameters, whether to save the state to history and whether to allow
/// 'Repeat Last Effect'.
/* static */ bool EffectUI::DoEffect(
const PluginID & ID, const CommandContext &context, unsigned flags )
{
SneedacityProject &project = context.project;
const auto &settings = ProjectSettings::Get( project );
auto &tracks = TrackList::Get( project );
auto &trackPanel = TrackPanel::Get( project );
auto &trackFactory = WaveTrackFactory::Get( project );
auto rate = settings.GetRate();
auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
auto &commandManager = CommandManager::Get( project );
auto &window = ProjectWindow::Get( project );
const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
if (!plug)
return false;
EffectType type = plug->GetEffectType();
// Make sure there's no activity since the effect is about to be applied
// to the project's tracks. Mainly for Apply during RTP, but also used
// for batch commands
if (flags & EffectManager::kConfigured)
{
ProjectAudioManager::Get( project ).Stop();
//Don't Select All if repeating Generator Effect
if (!(flags & EffectManager::kConfigured)) {
SelectUtilities::SelectAllIfNone(project);
}
}
auto nTracksOriginally = tracks.size();
wxWindow *focus = wxWindow::FindFocus();
wxWindow *parent = nullptr;
if (focus != nullptr) {
parent = focus->GetParent();
}
bool success = false;
auto cleanup = finally( [&] {
if (!success) {
// For now, we're limiting realtime preview to a single effect, so
// make sure the menus reflect that fact that one may have just been
// opened.
MenuManager::Get(project).UpdateMenus( false );
}
} );
int count = 0;
bool clean = true;
for (auto t : tracks.Selected< const WaveTrack >()) {
if (t->GetEndTime() != 0.0)
clean = false;
count++;
}
EffectManager & em = EffectManager::Get();
em.SetSkipStateFlag( false );
if (auto effect = em.GetEffect(ID)) {
#if defined(EXPERIMENTAL_EFFECTS_RACK)
if (effect->SupportsRealtime())
{
EffectRack::Get( context.project ).Add(effect);
}
#endif
effect->SetUIFlags(flags);
success = effect->DoEffect(
rate,
&tracks,
&trackFactory,
selectedRegion,
&window,
(flags & EffectManager::kConfigured) == 0
? DialogFactory
: nullptr
);
}
else
success = false;
if (!success)
return false;
if (em.GetSkipStateFlag())
flags = flags | EffectManager::kSkipState;
if (!(flags & EffectManager::kSkipState))
{
auto shortDesc = em.GetCommandName(ID);
auto longDesc = em.GetCommandDescription(ID);
ProjectHistory::Get( project ).PushState(longDesc, shortDesc);
}
if (!(flags & EffectManager::kDontRepeatLast))
{
// Remember a successful generator, effect, analyzer, or tool Process
auto shortDesc = em.GetCommandName(ID);
/* i18n-hint: %s will be the name of the effect which will be
* repeated if this menu item is chosen */
auto lastEffectDesc = XO("Repeat %s").Format(shortDesc);
auto& menuManager = MenuManager::Get(project);
switch ( type ) {
case EffectTypeGenerate:
commandManager.Modify(wxT("RepeatLastGenerator"), lastEffectDesc);
menuManager.mLastGenerator = ID;
menuManager.mRepeatGeneratorFlags = EffectManager::kConfigured;
break;
case EffectTypeProcess:
commandManager.Modify(wxT("RepeatLastEffect"), lastEffectDesc);
menuManager.mLastEffect = ID;
menuManager.mRepeatEffectFlags = EffectManager::kConfigured;
break;
case EffectTypeAnalyze:
commandManager.Modify(wxT("RepeatLastAnalyzer"), lastEffectDesc);
menuManager.mLastAnalyzer = ID;
menuManager.mLastAnalyzerRegistration = MenuCreator::repeattypeplugin;
menuManager.mRepeatAnalyzerFlags = EffectManager::kConfigured;
break;
case EffectTypeTool:
commandManager.Modify(wxT("RepeatLastTool"), lastEffectDesc);
menuManager.mLastTool = ID;
menuManager.mLastToolRegistration = MenuCreator::repeattypeplugin;
menuManager.mRepeatToolFlags = EffectManager::kConfigured;
if (shortDesc == NYQUIST_PROMPT_NAME) {
menuManager.mRepeatToolFlags = EffectManager::kRepeatNyquistPrompt; //Nyquist Prompt is not configured
}
break;
}
}
//STM:
//The following automatically re-zooms after sound was generated.
// IMO, it was disorienting, removing to try out without re-fitting
//mchinen:12/14/08 reapplying for generate effects
if (type == EffectTypeGenerate)
{
if (count == 0 || (clean && selectedRegion.t0() == 0.0))
window.DoZoomFit();
// trackPanel->Refresh(false);
}
// PRL: RedrawProject explicitly because sometimes history push is skipped
window.RedrawProject();
if (focus != nullptr && focus->GetParent()==parent) {
focus->SetFocus();
}
// A fix for Bug 63
// New tracks added? Scroll them into view so that user sees them.
// Don't care what track type. An analyser might just have added a
// Label track and we want to see it.
if( tracks.size() > nTracksOriginally ){
// 0.0 is min scroll position, 1.0 is max scroll position.
trackPanel.VerticalScroll( 1.0 );
}
else {
auto pTrack = *tracks.Selected().begin();
if (!pTrack)
pTrack = *tracks.Any().begin();
if (pTrack) {
TrackFocus::Get(project).Set(pTrack);
pTrack->EnsureVisible();
}
}
return true;
}
///////////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(EffectDialog, wxDialogWrapper)
EVT_BUTTON(wxID_OK, EffectDialog::OnOk)
END_EVENT_TABLE()
EffectDialog::EffectDialog(wxWindow * parent,
const TranslatableString & title,
int type,
int flags,
int additionalButtons)
: wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags)
{
mType = type;
mAdditionalButtons = additionalButtons;
}
void EffectDialog::Init()
{
long buttons = eOkButton;
if ((mType != EffectTypeAnalyze) && (mType != EffectTypeTool))
{
buttons |= eCancelButton;
if (mType == EffectTypeProcess)
{
buttons |= ePreviewButton;
}
}
ShuttleGui S(this, eIsCreating);
S.SetBorder(5);
S.StartVerticalLay(true);
{
PopulateOrExchange(S);
S.AddStandardButtons(buttons|mAdditionalButtons);
}
S.EndVerticalLay();
Layout();
Fit();
SetMinSize(GetSize());
Center();
}
/// This is a virtual function which will be overridden to
/// provide the actual parameters that we want for each
/// kind of dialog.
void EffectDialog::PopulateOrExchange(ShuttleGui & WXUNUSED(S))
{
return;
}
bool EffectDialog::TransferDataToWindow()
{
ShuttleGui S(this, eIsSettingToDialog);
PopulateOrExchange(S);
return true;
}
bool EffectDialog::TransferDataFromWindow()
{
ShuttleGui S(this, eIsGettingFromDialog);
PopulateOrExchange(S);
return true;
}
bool EffectDialog::Validate()
{
return true;
}
void EffectDialog::OnPreview(wxCommandEvent & WXUNUSED(evt))
{
return;
}
void EffectDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
{
// On wxGTK (wx2.8.12), the default action is still executed even if
// the button is disabled. This appears to affect all wxDialogs, not
// just our Effects dialogs. So, this is a only temporary workaround
// for legacy effects that disable the OK button. Hopefully this has
// been corrected in wx3.
if (FindWindow(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
{
EndModal(true);
}
return;
}
|
; A350362: 2-tone chromatic number of an n-cycle.
; Submitted by Christian Krause
; 6,6,5,5,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
mov $1,$0
div $0,2
cmp $1,4
pow $1,$0
mov $0,$1
add $0,5
|
/*
Ryan Zubery
CSCI 480
Assignment 2
*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cmath>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#include "pic.h"
int g_vMousePos[2] = {0, 0};
int g_iLeftMouseButton = 0; /* 1 if pressed, 0 if not */
typedef enum { ROTATE, TRANSLATE, SCALE } CONTROLSTATE;
CONTROLSTATE g_ControlState = ROTATE;
/* state of the world */
float g_vLandRotate[3] = {0.0, 0.0, 0.0};
float g_vLandTranslate[3] = {0.0, 0.0, 0.0};
float g_vLandScale[3] = {1.0, 1.0, 1.0};
//window width and height
float width = 640.0;
float height = 480.0;
/* total number of splines */
int g_iNumOfSplines;
int indexI = 0;
int indexJ = 1;
double indexU = 0.0;
double eyeX = 0.0;
double eyeY = 50.0;
double eyeZ = 0.0;
double forwardX = 0.0;
double forwardY = 0.0;
double forwardZ = 0.0;
double upX = 0.0;
double upY = 1.0;
double upZ = 0.0;
double bX = 0.0;
double bY = 0.0;
double bZ = 0.0;
Pic * groundData;
Pic * skyData;
Pic * ceilingData;
GLuint gTexName;
GLuint sTexName;
GLuint cTexName;
bool doAnimation = false;
/* represents one control point along the spline */
struct point {
double x;
double y;
double z;
};
/* spline struct which contains how many control points, and an array of control points */
struct spline {
int numControlPoints;
struct point *points;
};
/* the spline array */
struct spline *g_Splines;
point catmullRom(double u, struct point p1, struct point p2, struct point p3,
struct point p4)
{
point crPoint;
double x;
double y;
double z;
double s = 0.5;
double uCubed = u * u * u;
double uSquared = u * u;
double coefficientAndBasis[4] =
{(uCubed * -s) + (uSquared * 2 * s) + (u * -s) + (0),
(uCubed * (2 - s)) + (uSquared * (s - 3)) + (0) + (1),
(uCubed * (s - 2)) + (uSquared * (3 - 2 * s)) + (u * s) + (0),
(uCubed * s) + (uSquared * -s) + (0) + (0)};
double cb1 = coefficientAndBasis[0];
double cb2 = coefficientAndBasis[1];
double cb3 = coefficientAndBasis[2];
double cb4 = coefficientAndBasis[3];
double pOfU[3] =
{(cb1 * p1.x) + (cb2 * p2.x) + (cb3 * p3.x) + (cb4 * p4.x),
(cb1 * p1.y) + (cb2 * p2.y) + (cb3 * p3.y) + (cb4 * p4.y),
(cb1 * p1.z) + (cb2 * p2.z) + (cb3 * p3.z) + (cb4 * p4.z)};
crPoint.x = pOfU[0];
crPoint.y = pOfU[1];
crPoint.z = pOfU[2];
return crPoint;
}
void Tangent(double u, struct point p1, struct point p2, struct point p3,
struct point p4)
{
struct point crPoint = catmullRom(u, p1, p2, p3, p4);
eyeX = crPoint.x + 1.0;
eyeY = crPoint.y;
eyeZ = crPoint.z;
//MATH FOR MOVING THE CAMERA
point crPointDeriv;
double s = 0.5;
double uCubedDeriv = 3 * u * u;
double uSquaredDeriv = 2 * u;
double coefficientAndBasisDeriv[4] =
{(uCubedDeriv * -s) + (uSquaredDeriv * 2 * s) + (1 * -s) + (0),
(uCubedDeriv * (2 - s)) + (uSquaredDeriv * (s - 3)) + (0) + (0),
(uCubedDeriv * (s - 2)) + (uSquaredDeriv * (3 - 2 * s)) + (1 * s) + (0),
(uCubedDeriv * s) + (uSquaredDeriv * -s) + (0) + (0)};
double cb1D = coefficientAndBasisDeriv[0];
double cb2D = coefficientAndBasisDeriv[1];
double cb3D = coefficientAndBasisDeriv[2];
double cb4D = coefficientAndBasisDeriv[3];
double pOfUDeriv[3] =
{(cb1D * p1.x) + (cb2D * p2.x) + (cb3D * p3.x) + (cb4D * p4.x),
(cb1D * p1.y) + (cb2D * p2.y) + (cb3D * p3.y) + (cb4D * p4.y),
(cb1D * p1.z) + (cb2D * p2.z) + (cb3D * p3.z) + (cb4D * p4.z)};
crPointDeriv.x = pOfUDeriv[0];
crPointDeriv.y = pOfUDeriv[1];
crPointDeriv.z = pOfUDeriv[2];
double magnitude = sqrt((crPointDeriv.x * crPointDeriv.x) + (crPointDeriv.y * crPointDeriv.y) + (crPointDeriv.z * crPointDeriv.z));
double tanX = crPointDeriv.x / magnitude;
double tanY = crPointDeriv.y / magnitude;
double tanZ = crPointDeriv.z / magnitude;
forwardX = tanX + eyeX;
forwardY = tanY + eyeY;
forwardZ = tanZ + eyeZ;
std::cout << "x: " << forwardX << ", y: " << forwardY << ", z: " << forwardZ << std::endl;
if(u == 0.0)
{
struct point v;
v.x = 1.0;
v.y = 0.0;
v.z = 0.0;
//T x V
upX = (tanY * v.z) - (tanZ * v.y);
upY = (tanZ * v.x) - (tanX * v.z);
upZ = (tanX * v.y) - (tanY * v.x);
//T x N
bX = (tanY * upZ) - (tanZ * upY);
bY = (tanZ * upX) - (tanX * upZ);
bZ = (tanX * upY) - (tanY * upX);
}
else
{
//B0 x T1
upX = (bY * tanZ) - (bZ * tanY);
upY = (bZ * tanX) - (bX * tanZ);
upZ = (bX * tanY) - (bY * tanX);
//T1 x N1
bX = (tanY * upZ) - (tanZ * upY);
bY = (tanZ * upX) - (tanX * upZ);
bZ = (tanX * upY) - (tanY * upX);
}
double upMagnitude = sqrt((upX * upX) + (upY * upY) + (upZ * upZ));
upX /= upMagnitude;
upY /= upMagnitude;
upZ /= upMagnitude;
double bMagnitude = sqrt((bX * bX) + (bY * bY) + (bZ * bZ));
bX /= bMagnitude;
bY /= bMagnitude;
bZ /= bMagnitude;
}
void initTexture()
{
groundData = jpeg_read("ground.jpg", NULL);
glGenTextures(1, &gTexName);
glBindTexture(GL_TEXTURE_2D, gTexName);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, groundData->pix);
skyData = jpeg_read("sky.jpg", NULL);
glGenTextures(1, &sTexName);
glBindTexture(GL_TEXTURE_2D, sTexName);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, skyData->pix);
ceilingData = jpeg_read("ceiling.jpg", NULL);
glGenTextures(1, &cTexName);
glBindTexture(GL_TEXTURE_2D, cTexName);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, ceilingData->pix);
}
void myinit()
{
/* setup gl view here */
glClearColor(0.0, 0.0, 0.0, 0.0);
//enable depth buffering
glEnable(GL_DEPTH_TEST);
}
void display()
{
//clear buffers
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//clear matrix
glLoadIdentity();
//look at matrix
if(doAnimation)
{
gluLookAt(eyeX, eyeY, eyeZ, forwardX, forwardY, forwardZ, upX, upY, upZ);
}
else
{
gluLookAt(0.0, 50.0, 10.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
}
glScalef(g_vLandScale[0], g_vLandScale[1], g_vLandScale[2]);
glTranslatef(g_vLandTranslate[0], g_vLandTranslate[1], g_vLandTranslate[2]);
glRotatef(g_vLandRotate[0], 1.0, 0.0, 0.0);
glRotatef(g_vLandRotate[1], 0.0, 1.0, 0.0);
glRotatef(g_vLandRotate[2], 0.0, 0.0, 1.0);
//GROUND
glBindTexture(GL_TEXTURE_2D, gTexName);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glEnable(GL_TEXTURE_2D);
glBegin(GL_QUADS);
glTexCoord2d(0.0, 0.0); glVertex3d(50.0, 0.0, 50.0);
glTexCoord2d(0.0, 1.0); glVertex3d(50.0, 0.0, -50.0);
glTexCoord2d(1.0, 0.0); glVertex3d(-50.0, 0.0, -50.0);
glTexCoord2d(1.0, 1.0); glVertex3d(-50.0, 0.0, 50.0);
glEnd();
glDisable(GL_TEXTURE_2D);
//GROUND
//SKY
glBindTexture(GL_TEXTURE_2D, sTexName);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glEnable(GL_TEXTURE_2D);
//right side
glBegin(GL_QUADS);
glTexCoord2d(0.0, 1.0); glVertex3d(50.0, 0.0, 50.0);
glTexCoord2d(0.0, 0.0); glVertex3d(50.0, 50.0, 50.0);
glTexCoord2d(1.0, 0.0); glVertex3d(50.0, 50.0, -50.0);
glTexCoord2d(1.0, 1.0); glVertex3d(50.0, 0.0, -50.0);
glEnd();
//left side
glBegin(GL_QUADS);
glTexCoord2d(0.0, 1.0); glVertex3d(-50.0, 00.0, 50.0);
glTexCoord2d(0.0, 0.0); glVertex3d(-50.0, 50.0, 50.0);
glTexCoord2d(1.0, 0.0); glVertex3d(-50.0, 50.0, -50.0);
glTexCoord2d(1.0, 1.0); glVertex3d(-50.0, 0.0, -50.0);
glEnd();
//front side
glBegin(GL_QUADS);
glTexCoord2d(0.0, 1.0); glVertex3d(-50.0, 0.0, 50.0);
glTexCoord2d(0.0, 0.0); glVertex3d(-50.0, 50.0, 50.0);
glTexCoord2d(1.0, 0.0); glVertex3d(50.0, 50.0, 50.0);
glTexCoord2d(1.0, 1.0); glVertex3d(50.0, 0.0, 50.0);
glEnd();
//back side
glBegin(GL_QUADS);
glTexCoord2d(0.0, 1.0); glVertex3d(-50.0, 0.0, -50.0);
glTexCoord2d(0.0, 0.0); glVertex3d(-50.0, 50.0, -50.0);
glTexCoord2d(1.0, 0.0); glVertex3d(50.0, 50.0, -50.0);
glTexCoord2d(1.0, 1.0); glVertex3d(50.0, 0.0, -50.0);
glEnd();
glDisable(GL_TEXTURE_2D);
//SKY
//CEILING
glBindTexture(GL_TEXTURE_2D, cTexName);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glEnable(GL_TEXTURE_2D);
glBegin(GL_QUADS);
glTexCoord2d(0.0, 1.0); glVertex3d(50.0, 50.0, 50.0);
glTexCoord2d(0.0, 0.0); glVertex3d(50.0, 50.0, -50.0);
glTexCoord2d(1.0, 0.0); glVertex3d(-50.0, 50.0, -50.0);
glTexCoord2d(1.0, 1.0); glVertex3d(-50.0, 50.0, 50.0);
glEnd();
glDisable(GL_TEXTURE_2D);
//CEILING
//helper square
/*
glBegin(GL_POLYGON);
glTexCoord2d(0.0, 1.0); glVertex3f(0.0, 0.0, 0.0);
glTexCoord2d(0.0, 0.0); glVertex3f(0.0, 1.0, 0.0);
glTexCoord2d(1.0, 0.0); glVertex3f(1.0, 1.0, 0.0);
glTexCoord2d(1.0, 1.0); glVertex3f(1.0, 0.0, 0.0);
glEnd();
*/
//rail one
for(int i = 0; i < g_iNumOfSplines; i++)
{
glLineWidth(50.0f);
glBegin(GL_LINE_STRIP);
for(int j = 1; j < g_Splines[i].numControlPoints - 2; j++)
{
struct point p1 = g_Splines[i].points[j - 1];
struct point p2 = g_Splines[i].points[j];
struct point p3 = g_Splines[i].points[j + 1];
struct point p4 = g_Splines[i].points[j + 2];
for(double u = 0; u <= 1.0; u += 0.01)
{
struct point mPoint = catmullRom(u, p1, p2, p3, p4);
glVertex3d(mPoint.x, mPoint.y, mPoint.z);
}
}
glEnd();
}
//bars
for(int i = 0; i < g_iNumOfSplines; i++)
{
for(int j = 1; j < g_Splines[i].numControlPoints - 2; j++)
{
struct point p1 = g_Splines[i].points[j - 1];
struct point p2 = g_Splines[i].points[j];
struct point p3 = g_Splines[i].points[j + 1];
struct point p4 = g_Splines[i].points[j + 2];
struct point mPoint = catmullRom(0, p1, p2, p3, p4);
glLineWidth(50.0f);
glBegin(GL_LINE_STRIP);
glVertex3d(mPoint.x - 0.25, mPoint.y, mPoint.z);
glVertex3d(mPoint.x + 2.25, mPoint.y, mPoint.z);
glEnd();
}
}
//rail two
for(int i = 0; i < g_iNumOfSplines; i++)
{
glLineWidth(50.0f);
glBegin(GL_LINE_STRIP);
for(int j = 1; j < g_Splines[i].numControlPoints - 2; j++)
{
struct point p1 = g_Splines[i].points[j - 1];
struct point p2 = g_Splines[i].points[j];
struct point p3 = g_Splines[i].points[j + 1];
struct point p4 = g_Splines[i].points[j + 2];
for(double u = 0; u <= 1.0; u += 0.01)
{
struct point mPoint = catmullRom(u, p1, p2, p3, p4);
glVertex3d(mPoint.x + 2.0, mPoint.y, mPoint.z);
}
}
glEnd();
}
//swap buffers
glutSwapBuffers();
}
void reshape(int w, int h)
{
//set up image size
glViewport(0, 0, width * 2, height * 2);
//projection related changes, sets field of view to 60 degrees
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, width/height, 0.5, 300.0);
//modelview related changes
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void doIdle()
{
if(doAnimation)
{
if(indexI < g_iNumOfSplines)
{
if(indexJ < g_Splines[indexI].numControlPoints - 2)
{
struct point p1 = g_Splines[indexI].points[indexJ - 1];
struct point p2 = g_Splines[indexI].points[indexJ];
struct point p3 = g_Splines[indexI].points[indexJ + 1];
struct point p4 = g_Splines[indexI].points[indexJ + 2];
if(indexU <= 1.0)
{
Tangent(indexU, p1, p2, p3, p4);
indexU += 0.01;
}
else
{
indexU = 0.0;
indexJ++;
}
}
else
{
indexJ = 1;
indexI++;
}
}
}
/* make the screen update */
glutPostRedisplay();
}
/* converts mouse drags into information about
rotation/translation/scaling */
void mousedrag(int x, int y)
{
int vMouseDelta[2] = {x-g_vMousePos[0], y-g_vMousePos[1]};
switch (g_ControlState)
{
case TRANSLATE:
if (g_iLeftMouseButton)
{
g_vLandTranslate[0] += vMouseDelta[0]*0.01;
g_vLandTranslate[1] -= vMouseDelta[1]*0.01;
}
break;
case ROTATE:
if (g_iLeftMouseButton)
{
g_vLandRotate[0] += vMouseDelta[1];
g_vLandRotate[1] += vMouseDelta[0];
}
break;
case SCALE:
if (g_iLeftMouseButton)
{
g_vLandScale[0] *= 1.0+vMouseDelta[0]*0.01;
g_vLandScale[1] *= 1.0-vMouseDelta[1]*0.01;
}
break;
}
glutPostRedisplay();
g_vMousePos[0] = x;
g_vMousePos[1] = y;
}
void mouseidle(int x, int y)
{
g_vMousePos[0] = x;
g_vMousePos[1] = y;
}
void mousebutton(int button, int state, int x, int y)
{
switch (button)
{
case GLUT_LEFT_BUTTON:
g_iLeftMouseButton = (state==GLUT_DOWN);
break;
/*case GLUT_RIGHT_BUTTON:
g_iRightMouseButton = (state==GLUT_DOWN);
break;*/
}
g_vMousePos[0] = x;
g_vMousePos[1] = y;
}
void keyboard(unsigned char key, int x, int y)
{
//points on 'a'
if(key == 'a')
{
glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
glutPostRedisplay();
}
//wireframe on 's'
else if(key == 's')
{
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glutPostRedisplay();
}
//filled triangles on 'd'
else if(key == 'd')
{
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glutPostRedisplay();
}
//button controls for mac because CTRL and ALT don't work
//q to toggle scale, e for rotate, w for translate (then use mouse)
if(key == 'q')
{
g_ControlState = SCALE;
}
else if(key == 'w')
{
g_ControlState = ROTATE;
}
else if(key == 'e')
{
g_ControlState = TRANSLATE;
}
if(key == 'x')
{
doAnimation = !doAnimation;
}
}
int loadSplines(char *argv) {
char *cName = (char *)malloc(128 * sizeof(char));
FILE *fileList;
FILE *fileSpline;
int iType, i = 0, j, iLength;
/* load the track file */
fileList = fopen(argv, "r");
if (fileList == NULL) {
printf ("can't open file\n");
exit(1);
}
/* stores the number of splines in a global variable */
fscanf(fileList, "%d", &g_iNumOfSplines);
g_Splines = (struct spline *)malloc(g_iNumOfSplines * sizeof(struct spline));
/* reads through the spline files */
for (j = 0; j < g_iNumOfSplines; j++) {
i = 0;
fscanf(fileList, "%s", cName);
fileSpline = fopen(cName, "r");
if (fileSpline == NULL) {
printf ("can't open file\n");
exit(1);
}
/* gets length for spline file */
fscanf(fileSpline, "%d %d", &iLength, &iType);
/* allocate memory for all the points */
g_Splines[j].points = (struct point *)malloc(iLength * sizeof(struct point));
g_Splines[j].numControlPoints = iLength;
/* saves the data to the struct */
while (fscanf(fileSpline, "%lf %lf %lf",
&g_Splines[j].points[i].x,
&g_Splines[j].points[i].y,
&g_Splines[j].points[i].z) != EOF) {
std::cout << g_Splines[j].points[i].x << ", " << g_Splines[j].points[i].y << ", " << g_Splines[j].points[i].z << std::endl;
i++;
}
}
free(cName);
return 0;
}
int main (int argc, char ** argv)
{
if (argc<2)
{
printf ("usage: %s <trackfile>\n", argv[0]);
exit(0);
}
loadSplines(argv[1]);
glutInit(&argc,argv);
//creates a window that's double buffered and with depth testing
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(0, 0);
glutInitWindowSize(width, height);
glutCreateWindow("Ryan's Assignment 2");
initTexture();
/* tells glut to use a particular display function to redraw */
glutDisplayFunc(display);
//tells glut to use a particular reshape function
glutReshapeFunc(reshape);
/* replace with any animate code */
glutIdleFunc(doIdle);
/* callback for mouse drags */
glutMotionFunc(mousedrag);
/* callback for idle mouse movement */
glutPassiveMotionFunc(mouseidle);
/* callback for mouse button changes */
glutMouseFunc(mousebutton);
//callback for keyboard input
glutKeyboardFunc(keyboard);
/* do initialization */
myinit();
glutMainLoop();
return 0;
}
|
include ksamd64.inc
include CallConv.inc
extern InstrumentationCallback:proc
EXTERNDEF __imp_RtlCaptureContext:QWORD
.code
InstrumentationCallbackProxy proc
push rsp ; Back-up RSP, R10, and RAX to preserve them
push r10
push rax
mov rax, 1 ; Set RAX to 1 for comparison
cmp gs:[2ech], rax ; See if the recursion flag has been set
je resume ; Jump and restore the registers if it has and resume
pop rax
pop r10
pop rsp
mov gs:[2e0h], rsp ; Win10 TEB InstrumentationCallbackPreviousSp
mov gs:[2d8h], r10 ; Win10 TEB InstrumentationCallbackPreviousPc
mov r10, rcx ; Save original RCX
sub rsp, 4d0h ; Alloc stack space for CONTEXT structure
and rsp, -10h ; RSP must be 16 byte aligned before calls
mov rcx, rsp
mov rdx, 0h
sub rsp, 20h
call __imp_RtlCaptureContext ; Save the current register state. RtlCaptureContext does not require shadow space
mov r8, [rcx+78h] ; The value of RAX from the CONTEXT object stored at RSP
mov rdx, gs:[2d8h] ; The saved RIP address
sub rsp, 20h
call InstrumentationCallback ; Call main instrumentation routine
resume:
pop rax
pop r10
pop rsp
jmp r10
InstrumentationCallbackProxy endp
end |
//
// detail/impl/reactive_serial_port_service.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP
#define BOOST_ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#if defined(BOOST_ASIO_HAS_SERIAL_PORT)
#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
#include <cstring>
#include <boost/asio/detail/reactive_serial_port_service.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
namespace detail {
reactive_serial_port_service::reactive_serial_port_service(
boost::asio::io_service& io_service)
: descriptor_service_(io_service)
{
}
void reactive_serial_port_service::shutdown_service()
{
descriptor_service_.shutdown_service();
}
boost::system::error_code reactive_serial_port_service::open(
reactive_serial_port_service::implementation_type& impl,
const std::string& device, boost::system::error_code& ec)
{
if (is_open(impl))
{
ec = boost::asio::error::already_open;
return ec;
}
descriptor_ops::state_type state = 0;
int fd = descriptor_ops::open(device.c_str(),
O_RDWR | O_NONBLOCK | O_NOCTTY, ec);
if (fd < 0)
return ec;
int s = descriptor_ops::fcntl(fd, F_GETFL, ec);
if (s >= 0)
s = descriptor_ops::fcntl(fd, F_SETFL, s | O_NONBLOCK, ec);
if (s < 0)
{
boost::system::error_code ignored_ec;
descriptor_ops::close(fd, state, ignored_ec);
return ec;
}
// Set up default serial port options.
termios ios;
errno = 0;
s = descriptor_ops::error_wrapper(::tcgetattr(fd, &ios), ec);
if (s >= 0)
{
#if defined(_BSD_SOURCE)
::cfmakeraw(&ios);
#else
ios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK
| ISTRIP | INLCR | IGNCR | ICRNL | IXON);
ios.c_oflag &= ~OPOST;
ios.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
ios.c_cflag &= ~(CSIZE | PARENB);
ios.c_cflag |= CS8;
#endif
ios.c_iflag |= IGNPAR;
ios.c_cflag |= CREAD | CLOCAL;
errno = 0;
s = descriptor_ops::error_wrapper(::tcsetattr(fd, TCSANOW, &ios), ec);
}
if (s < 0)
{
boost::system::error_code ignored_ec;
descriptor_ops::close(fd, state, ignored_ec);
return ec;
}
// We're done. Take ownership of the serial port descriptor.
if (descriptor_service_.assign(impl, fd, ec))
{
boost::system::error_code ignored_ec;
descriptor_ops::close(fd, state, ignored_ec);
}
return ec;
}
boost::system::error_code reactive_serial_port_service::do_set_option(
reactive_serial_port_service::implementation_type& impl,
reactive_serial_port_service::store_function_type store,
const void* option, boost::system::error_code& ec)
{
termios ios;
errno = 0;
descriptor_ops::error_wrapper(::tcgetattr(
descriptor_service_.native_handle(impl), &ios), ec);
if (ec)
return ec;
if (store(option, ios, ec))
return ec;
errno = 0;
descriptor_ops::error_wrapper(::tcsetattr(
descriptor_service_.native_handle(impl), TCSANOW, &ios), ec);
return ec;
}
boost::system::error_code reactive_serial_port_service::do_get_option(
const reactive_serial_port_service::implementation_type& impl,
reactive_serial_port_service::load_function_type load,
void* option, boost::system::error_code& ec) const
{
termios ios;
errno = 0;
descriptor_ops::error_wrapper(::tcgetattr(
descriptor_service_.native_handle(impl), &ios), ec);
if (ec)
return ec;
return load(option, ios, ec);
}
} // namespace detail
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
#endif // defined(BOOST_ASIO_HAS_SERIAL_PORT)
#endif // BOOST_ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP
|
// Rank of a String
#include<iostream>
using namespace std;
int factorial(int num) {
int answer = 1;
while(num > 0) {
answer *= num;
num--;
}
return answer;
}
int findRank(string str) {
int count = 0;
int answer = 0;
int fact = factorial(str.size());
int j = str.size();
for(int i = 0; i < str.size(); i++) {
count = 0;
fact /= (j--);
for(int j = i+1; j < str.size(); j++) {
if(str[j] < str[i]) count++;
}
answer = answer + count*(fact);
}
return answer;
}
main() {
cout << findRank("STRING");
return 0;
}
|
; A034266: Partial sums of A027818.
; 0,1,15,99,435,1485,4257,10725,24453,51480,101530,189618,338130,579462,959310,1540710,2408934,3677355,5494401,8051725,11593725,16428555,22940775,31605795,43006275,57850650,76993956,101461140,132473044,171475260,220170060,280551612,354944700,446047173,556976355,691319655,853189623,1047283705,1278948957,1554251985,1880054385,2264093964,2715072030,3242747046,3858034950,4573116450,5401551610,6358402050,7460361090,8725892175,10175375925,11831266161,13718255265,15863449239,18296552835,21050065135
lpb $0
sub $0,1
mov $2,$0
max $2,0
seq $2,27818 ; a(n) = (n+1)*binomial(n+6,6).
add $1,$2
lpe
mov $0,$1
|
; A023522: Sum of exponents in prime-power factorization of p(n)*p(n-1) - 1.
; 1,2,2,3,2,4,3,3,4,2,3,3,2,4,4,3,3,4,4,2,4,4,3,5,4,3,5,5,3,5,3,4,2,4,3,5,4,4,6,4,3,3,3,4,3,4,5,4,4,3,3,3,4,4,5,4,4,3,5,2,3,5,3,4,6,3,4,3,3,4,3,5,8,3,4,6,8,3,6,3,3,5,3,4,3,3,5,4,2,5,5,5,3,5,4,4,7,3,5,5
seq $0,124669 ; Product of successive primes minus 2.
seq $0,1222 ; Number of prime divisors of n counted with multiplicity (also called bigomega(n) or Omega(n)).
|
#ifndef FM_STATE_PILOT_DISCONNECTING_HPP
#define FM_STATE_PILOT_DISCONNECTING_HPP
#include "state/IState.hpp"
namespace fm
{
namespace state
{
namespace pilot
{
/**
* Created by: Bartosz Nawrot
* Date: 2018-11-25
* Description:
*/
class Disconnecting : public IState
{
public:
Disconnecting(IState&);
State start() override;
State handleUserEvent(const event::input::user::UserEvent&) override;
State handleConnectionEvent(const event::input::connection::ConnectionEvent&) override;
std::string toString() const override;
};
} // pilot
} // state
} // fm
#endif // FM_STATE_PILOT_DISCONNECTING_HPP
|
setrepeat 2
frame 0, 16
frame 1, 16
frame 2, 16
frame 1, 16
dorepeat 1
endanim
|
title ASK6
ASSUME CS:KODIKAS, DS:DEDOMENA, SS:SOROS
KODIKAS SEGMENT PUBLIC
MAIN PROC NEAR
MOV AX, DEDOMENA
MOV DS, AX
MOV DI,OFFSET PIN
PUSH DI
MOV SI,10
PUSH SI
MOV BP,OFFSET TOTAL
PUSH BP
CALL SUM_PIN
LEA DX,MESS
MOV AH,9
INT 21H
MOV DI,TOTAL
PUSH DI
CALL PRINT_HEX
MOV AH,4ch
INT 21h
MAIN ENDP
SUM_PIN PROC NEAR
V1:
MOV BP,SP
V2:
MOV AX,0
V3:
MOV BX,[BP+6]
V4:
MOV CX,[BP+4]
V5:
MOV DL,[BX]
V6:
MOV DH,0
ADD AX,DX
V7:
INC BX
V8:
LOOP V5
v9:
MOV BX,[BP+2]
v10:
MOV [BX],AX
V11:
RET
SUM_PIN ENDP
PRINT_HEX PROC
H1:
MOV BP,SP
MOV CX,4
H2:
MOV BX,[BP+2]
H3:
XOR DL,DL
PUSH CX
MOV CX,4
H4:
SHL BX,1
RCL DL,1
H5:
LOOP H4
POP CX
H6:
CMP DL,9
JA GRAMMA
ADD DL,48
JMP H7
GRAMMA:
ADD DL,55
H7:
MOV AH,2
INT 21H
H8:
LOOP H3
H9:
RET
PRINT_HEX ENDP
KODIKAS ENDS
DEDOMENA SEGMENT
TOTAL DW 0
PIN DB 76,42,69,23,91,35,18,50,80,100
MESS db 10,13,'TO ATHRISMA TON STOIXION TOY PINAKA EINAI : $'
DEDOMENA ENDS
SOROS SEGMENT STACK
DB 256 DUP(0)
SOROS ENDS
END MAIN |
;
; Z88dk Generic Floating Point Math Library
;
; Shift c ix de b right by a
;
; $Id: rshift.asm,v 1.5 2016-06-21 21:16:49 dom Exp $:
SECTION code_fp
PUBLIC rshift
PUBLIC rsh8
.rshift LD B,0
.RSH2 SUB 8
JR C,RSH4 ;c => 7 or fewer shifts remain
LD B,E ;shift c ix de b right by 8...
LD E,D
LD D,IXL
EX AF,AF'
LD A,IXH
LD IXL,A
EX AF,AF'
LD IXH,C
LD C,0 ;...end of shifting
JR RSH2
;
.RSH4 ADD A,9
LD L,A
.RSH6 XOR A
DEC L
RET Z ;z => requested shift is complete
LD A,C
.rsh8 RRA ;shift c ix de b right by one...
LD C,A
LD A,IXH
RRA
LD IXH,A
LD A,IXL
RRA
LD IXL,A
RR D
RR E
RR B ;...end of shifting
JR RSH6
|
; A186432: Triangle associated with the set S of squares {0,1,4,9,16,...}.
; Submitted by Christian Krause
; 1,1,1,1,12,1,1,30,30,1,1,56,140,56,1,1,90,420,420,90,1,1,132,990,1848,990,132,1,1,182,2002,6006,6006,2002,182,1,1,240,3640,16016,25740,16016,3640,240,1,1,306,6120,37128,87516,87516,37128,6120,306,1,1,380,9690,77520,251940,369512,251940,77520,9690,380,1
mov $2,$0
seq $2,86645 ; Triangle read by rows: T(n, k) = binomial(2n, 2k).
mov $1,$2
lpb $2
mul $1,2
mov $2,2
lpe
mov $0,$1
|
%ifdef CONFIG
{
"RegData": {
"RAX": "0x00000000C5727F5A",
"RBX": "0x00000000FAC690D7",
"RCX": "0x000000002AAF1F77",
"RDX": "0x00000000ADBE9F64",
"RSI": "0x00000000ADBE9F64",
"RDI": "0x00000000ADBE9F64"
}
}
%endif
; This is a clone of the F2_F1 crc32 test with manually coded crc32 with prefix 66 instead of F2
; This can't user operand size override on 32-bit instructions for testing since it WILL override to 16-bit
mov rax, 0
mov rbx, 0
mov rcx, 0
mov rdx, 0
mov rsi, 0
mov rdi, 0
mov rbp, 0
lea rsp, [rel .data]
; crc32 eax, word [rel .data]
db 0xf2 ; Prefix
db 0x66 ; Operand size override
db 0x0f, 0x38, 0xf1, 0x05
dd 0x0000006c
; crc32 ebx, dword [rel .data + 2]
db 0xf2 ; Prefix
db 0x0f, 0x38, 0xf1, 0x1d,
dd 0x00000065
; crc32 rcx, qword [rel .data + 8]
db 0xf2 ; Prefix
db 0x66 ; Operand size override
db 0x48, 0x0f, 0x38, 0xf1, 0x0d,
dd 0x00000060
mov rbp, 0
.again16:
cmp rbp, 128
je .done16
; crc32 edx, word [rsp + rbp * 2]
db 0xf2 ; Prefix
db 0x66 ; Operand size override
db 0x0f, 0x38, 0xf1, 0x14, 0x6c
add rbp, 1
jmp .again16
.done16:
mov rbp, 0
.again32:
cmp rbp, 64
je .done32
; crc32 esi, dword [rsp + rbp * 4]
db 0xf2 ; Prefix
db 0x0f, 0x38, 0xf1, 0x34, 0xac
add rbp, 1
jmp .again32
.done32:
mov rbp, 0
.again64:
cmp rbp, 32
je .done64
; crc32 rdi, qword [rsp + rbp * 8]
db 0xf2 ; Prefix
db 0x66 ; Operand size override
db 0x48, 0x0f, 0x38, 0xf1, 0x3c, 0xec
add rbp, 1
jmp .again64
.done64:
hlt
align 16
; 256bytes of random data
.data:
db 0xe0, 0xfc, 0x2b, 0xa1, 0x06, 0x4f, 0x6c, 0xa7, 0x0f, 0x06, 0x6a, 0x1e, 0x7f, 0x76, 0x80, 0x9b
db 0xe0, 0x56, 0xed, 0xaa, 0xf3, 0xc3, 0x68, 0x68, 0xde, 0xe6, 0xe6, 0x94, 0xe2, 0xe9, 0xfc, 0xf0
db 0x6e, 0x35, 0xa8, 0x54, 0xd7, 0xab, 0x8b, 0x6c, 0x77, 0x5f, 0x92, 0xca, 0x25, 0xa6, 0x7e, 0x27
db 0xc7, 0xcd, 0x73, 0xec, 0x95, 0xd6, 0x6f, 0x6a, 0xbb, 0xae, 0xf2, 0xbb, 0x27, 0xb9, 0xa1, 0xdd
db 0x73, 0x4d, 0xd1, 0xc7, 0xd5, 0x2c, 0x31, 0x88, 0xfe, 0xe7, 0xdb, 0xfd, 0x1e, 0x1e, 0x09, 0x7f
db 0x14, 0xfa, 0x4e, 0x95, 0xef, 0xe6, 0x9a, 0xf2, 0xa0, 0x42, 0x62, 0x9a, 0xa4, 0xa8, 0x73, 0x82
db 0x0e, 0x0f, 0x16, 0x82, 0x38, 0x07, 0x12, 0x32, 0x07, 0x35, 0x92, 0xc1, 0x63, 0x07, 0x78, 0xb3
db 0xcb, 0x46, 0x19, 0x57, 0x2b, 0x37, 0x2a, 0x46, 0x1f, 0x04, 0x0e, 0x79, 0x3d, 0xcd, 0x8d, 0xa3
db 0x2b, 0xf3, 0x86, 0x2f, 0xab, 0xba, 0x57, 0x30, 0x2e, 0xd6, 0x2c, 0xf0, 0x46, 0x4f, 0x3f, 0xef
db 0xef, 0xd1, 0xbb, 0x85, 0x34, 0x4b, 0x3c, 0xde, 0x9e, 0x48, 0xa3, 0xb9, 0x8d, 0x71, 0xe3, 0x9d
db 0x09, 0x72, 0xfb, 0xde, 0x8a, 0x32, 0x50, 0x9d, 0x69, 0x98, 0xf1, 0xf6, 0x52, 0xeb, 0xf7, 0xee
db 0xd6, 0x99, 0xc2, 0xff, 0x30, 0x1c, 0x02, 0xce, 0x70, 0x05, 0xb2, 0xf1, 0x56, 0x9c, 0x0e, 0xa6
db 0x18, 0x62, 0xc4, 0xe2, 0x86, 0x38, 0x76, 0x30, 0x2f, 0xa1, 0xe4, 0xa7, 0x0e, 0x5d, 0x53, 0xeb
db 0x14, 0x45, 0xe0, 0xb7, 0xe1, 0xe8, 0x02, 0x68, 0x1a, 0xfe, 0x8e, 0xc1, 0x8f, 0xf2, 0xeb, 0x46
db 0x7f, 0x5d, 0x6a, 0x23, 0x46, 0x97, 0x2e, 0x03, 0x98, 0x12, 0x32, 0x8f, 0x54, 0x76, 0x59, 0xac
db 0xc8, 0x76, 0x5f, 0xc8, 0x71, 0x0c, 0xd3, 0xb6, 0xc5, 0x19, 0xea, 0xab, 0xa6, 0x2c, 0x1d, 0x88
|
; A036153: a(n) = 2^n mod 179.
; 1,2,4,8,16,32,64,128,77,154,129,79,158,137,95,11,22,44,88,176,173,167,155,131,83,166,153,127,75,150,121,63,126,73,146,113,47,94,9,18,36,72,144,109,39,78,156,133,87,174,169,159,139,99,19,38,76,152,125,71,142,105,31,62,124,69,138,97,15,30,60,120,61,122,65,130,81,162,145,111,43,86,172,165,151,123,67,134,89,178,177,175,171,163,147,115,51,102,25,50
mov $1,1
lpb $0
sub $0,1
mul $1,2
mod $1,179
lpe
mov $0,$1
|
; A038155: a(n) = (n!/2) * Sum_{k=0..n-2} 1/k!.
; 0,0,1,6,30,160,975,6846,54796,493200,4932045,54252550,651030666,8463398736,118487582395,1777313736030,28437019776600,483429336202336,8701728051642201,165332832981201990,3306656659624039990,69439789852104840000,1527675376746306480231,35136533665165049045566,843276807963961177093860,21081920199099029427346800,548129925176574765111017125,14799507979767518657997462726,414386223433490522423928956706,12017200479571225150293939744880,360516014387136754508818192346835
lpb $0
sub $0,1
add $1,$2
add $2,1
mul $1,$2
lpe
div $1,2
mov $0,$1
|
;
;
;
; This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
;
; Copyright 2007-2019 Broadcom Inc. All rights reserved.
;
;
; This is the default program for the White Knight 5670.
;
; To start it, use the following commands from BCM,
; where unit 0 is the 5670 and units 1 and 2 are the 5690s:
;
; 0:led load wk5670.hex
; 1:led load wk5690.hex
; 1:led auto on
; 2:led load wk5690.hex
; 2:led auto on
; *:led start
;
; The 3 programs should be started all at once so that blinking
; is in sync across the 5690s.
;
; The White Knight has 14 columns of 4 LEDs each as shown below:
;
; 5690 Unit 1 5690 Unit 2 5670 Unit 0
; ----------------------- ----------------------- --------------
; L01 L03 L05 L07 L09 L11 L01 L03 L05 L07 L09 L11 E1 E2
; A01 A03 A05 A07 A09 A11 A01 A03 A05 A07 A09 A11 L1 L2
; L02 L04 L06 L08 L10 L12 L02 L04 L06 L08 L10 L12 T1 T2
; A02 A04 A06 A08 A10 A12 A02 A04 A06 A08 A10 A12 R1 R2
;
; This program runs only on the 5670 and controls only the rightmost
; two columns of LEDs. The wk5690 program runs on each 5690.
;
; There is one bit per LED with the following colors:
; ZERO Green
; ONE Black
;
; The bits are shifted out in the following order:
; E1, L1, T1, R1, E2, L2, T2, R2
;
; Current implementation:
; E1 reflects port 1 higig link enable
; L1 reflects port 1 higig link up
; T1 reflects port 1 higig transmit activity
; R1 reflects port 1 higig receive activity
;
; Note:
; To provide consistent behavior, the gigabit LED patterns match
; those in sdk5605.asm and the higig LEDs match those in sdk5670.asm.
;
; E1 E2
; L1 L2
; T1 T2
; R1 R2
port 3 ; 5670 port 3 (right)
call put
port 6 ; 5670 port 6 (left)
call put
send 8
put:
pushst LINKEN
tinv
pack
pushst LINKUP
tinv
pack
pushst TX
tinv
pack
pushst RX
tinv
pack
ret
;
; Symbolic names for the bits of the port status fields
;
RX equ 0x0 ; received packet
TX equ 0x1 ; transmitted packet
COLL equ 0x2 ; collision indicator
SPEED_C equ 0x3 ; 100 Mbps
SPEED_M equ 0x4 ; 1000 Mbps
DUPLEX equ 0x5 ; half/full duplex
FLOW equ 0x6 ; flow control capable
LINKUP equ 0x7 ; link down/up status
LINKEN equ 0x8 ; link disabled/enabled status
ZERO equ 0xE ; always 0
ONE equ 0xF ; always 1
|
; A277823: a(n) = A048724(A065621(n)).
; 3,6,9,12,23,18,29,24,43,46,33,36,63,58,53,48,83,86,89,92,71,66,77,72,123,126,113,116,111,106,101,96,163,166,169,172,183,178,189,184,139,142,129,132,159,154,149,144,243,246,249,252,231,226,237,232,219,222,209,212,207,202,197,192,323,326,329,332,343,338,349,344,363,366,353,356,383,378,373,368,275,278,281,284,263,258,269,264,315,318,305,308,303,298,293,288,483,486,489,492
mul $0,4
add $0,3
seq $0,48725 ; a(n) = Xmult(n,5) or rule90(n,1).
div $0,4
|
/**
* @file
* @brief Item creation routines.
**/
#include "AppHdr.h"
#include "makeitem.h"
#include <algorithm>
#include "art-enum.h" // unrand -> magic staff silliness
#include "artefact.h"
#include "colour.h"
#include "describe.h"
#include "dungeon.h"
#include "item-name.h"
#include "item-prop.h"
#include "item-status-flag-type.h"
#include "items.h"
#include "libutil.h" // map_find
#include "mpr.h"
#include "randbook.h"
#include "skills.h" // is_removed_skill
#include "spl-book.h"
#include "state.h"
#include "stepdown.h"
#include "stringutil.h"
#include "tag-version.h"
static void _setup_fallback_randart(const int unrand_id,
item_def &item,
int &force_type,
int &item_level);
int create_item_named(string name, coord_def pos, string *error)
{
trim_string(name);
item_list ilist;
const string err = ilist.add_item(name, false);
if (!err.empty())
{
if (error)
*error = err;
return NON_ITEM;
}
item_spec ispec = ilist.get_item(0);
int item = dgn_place_item(ispec, pos);
if (item != NON_ITEM)
link_items();
else if (error)
*error = "Failed to create item '" + name + "'";
return item;
}
bool got_curare_roll(const int item_level)
{
return one_chance_in(item_level > 27 ? 6 :
item_level < 2 ? 15 :
(364 - 7 * item_level) / 25);
}
/// A mapping from randomly-described object types to their per-game descript
static map<object_class_type, item_description_type> _type_to_idesc = {
{OBJ_WANDS, IDESC_WANDS},
{OBJ_POTIONS, IDESC_POTIONS},
{OBJ_JEWELLERY, IDESC_RINGS},
{OBJ_SCROLLS, IDESC_SCROLLS},
{OBJ_STAVES, IDESC_STAVES},
};
/**
* Initialize the randomized appearance of a given item.
*
* For e.g. wand names, potions colors, helmet tiles...
*
* XXX: could this be moved into a constructor or reset method...?
*
* @param item The item to have its appearance initialized.
*/
void item_colour(item_def &item)
{
// Compute random tile/colour choice.
item.rnd = 1 + random2(255); // reserve 0 for uninitialized
// reserve the high bit for marking 1 in 10 books "visually special"
if (item.base_type == OBJ_BOOKS)
{
if (one_chance_in(10))
item.rnd |= 128;
else
item.rnd = 1 + random2(127); // can't just trim the high bit,
// since it might be the only set bit
}
if (is_unrandom_artefact(item))
return; // don't stomp on item.special!
// initialize item appearance.
// we don't actually *need* to store this now, but we *do* need to store
// it in appearance at some point, since sub_type isn't public information
// for un-id'd items, and therefore can't be used to do a lookup at the
// time item names/colours are calculated.
// it would probably be better to store this at the time that item_def is
// generated (get_item_known_info), but that requires some save compat work
// (and would be wrong if we ever try to get item colour/names directly...?)
// possibly a todo for a later date.
if (auto idesc = map_find(_type_to_idesc, item.base_type))
item.subtype_rnd = you.item_description[*idesc][item.sub_type];
}
// Does Xom consider an item boring?
static bool _is_boring_item(int type, int sub_type)
{
switch (type)
{
case OBJ_SCROLLS:
// These scrolls increase knowledge and thus reduce risk.
switch (sub_type)
{
case SCR_IDENTIFY:
case SCR_MAGIC_MAPPING:
return true;
default:
break;
}
break;
case OBJ_JEWELLERY:
return sub_type == AMU_NOTHING;
default:
break;
}
return false;
}
static weapon_type _determine_weapon_subtype(int item_level)
{
if (item_level > 6 && one_chance_in(30)
&& x_chance_in_y(10 + item_level, 100))
{
return random_choose(WPN_LAJATANG,
WPN_FUSTIBALUS,
WPN_TRIPLE_CROSSBOW,
WPN_DEMON_WHIP,
WPN_DEMON_BLADE,
WPN_DEMON_TRIDENT,
WPN_DOUBLE_SWORD,
WPN_EVENINGSTAR,
WPN_EXECUTIONERS_AXE,
WPN_QUICK_BLADE,
WPN_TRIPLE_SWORD);
}
else if (x_chance_in_y(item_level, 20))
{
// Pick a weapon based on rarity.
while (true)
{
const int wpntype = random2(NUM_WEAPONS);
if (x_chance_in_y(weapon_rarity(wpntype), 10))
return static_cast<weapon_type>(wpntype);
}
}
else if (x_chance_in_y(item_level, item_level+7))
{
return random_choose(WPN_QUARTERSTAFF,
WPN_FALCHION,
WPN_LONG_SWORD,
WPN_WAR_AXE,
WPN_TRIDENT,
WPN_FLAIL,
WPN_RAPIER);
}
else
{
return random_choose(WPN_HUNTING_SLING,
WPN_SPEAR,
WPN_HAND_AXE,
WPN_MACE,
// Not worth _weighted for one doubled type.
WPN_DAGGER, WPN_DAGGER,
WPN_CLUB,
WPN_WHIP,
WPN_SHORT_SWORD);
}
}
static bool _try_make_item_unrand(item_def& item, int &force_type, int agent)
{
if (player_in_branch(BRANCH_PANDEMONIUM) && agent == NO_AGENT)
return false;
int idx = find_okay_unrandart(item.base_type, force_type,
player_in_branch(BRANCH_ABYSS)
&& agent == NO_AGENT);
// if an idx was found that exists, the unrand was generated via
// acquirement or similar; replace it with a fallback randart.
if (idx != -1 && get_unique_item_status(idx))
{
int item_level;
_setup_fallback_randart(idx, item, force_type, item_level);
return false;
}
if (idx != -1 && make_item_unrandart(item, idx))
return true;
return false;
}
static bool _weapon_disallows_randart(int sub_type)
{
// Clubs are never randarts.
return sub_type == WPN_CLUB;
}
// Return whether we made an artefact.
static bool _try_make_weapon_artefact(item_def& item, int force_type,
int item_level, bool force_randart,
int agent)
{
if (item_level > 2 && x_chance_in_y(101 + item_level * 3, 4000)
|| force_randart)
{
// Make a randart or unrandart.
// 1 in 20 randarts are unrandarts.
if (one_chance_in(item_level == ISPEC_GOOD_ITEM ? 7 : 20)
&& !force_randart)
{
if (_try_make_item_unrand(item, force_type, agent))
return true;
if (item.base_type == OBJ_STAVES)
{
// TODO: this is a bit messy: a fallback randart for an unrand
// enhancer stave can be generated this way, and this code won't
// currently respect an explicit request for an enhancer stave
// as a fallback.
item.base_type = OBJ_WEAPONS;
force_type = WPN_QUARTERSTAFF;
}
// update sub type for fallback randarts (otherwise, the call will
// not have changed this value)
if (force_type != OBJ_RANDOM)
item.sub_type = force_type;
}
if (_weapon_disallows_randart(item.sub_type))
return false;
// Mean enchantment +6.
item.plus = 12 - biased_random2(7,2);
item.plus -= biased_random2(7,2);
item.plus -= biased_random2(7,2);
// On weapons, an enchantment of less than 0 is never viable.
item.plus = max(static_cast<int>(item.plus), random2(2));
// The rest are normal randarts.
make_item_randart(item);
return true;
}
return false;
}
/**
* The number of times to try finding a brand for a given item.
*
* Result may vary from call to call.
*/
static int _num_brand_tries(const item_def& item, int item_level)
{
if (item_level >= ISPEC_GIFT)
return 5;
if (is_demonic(item) || x_chance_in_y(101 + item_level, 300))
return 1;
return 0;
}
brand_type determine_weapon_brand(const item_def& item, int item_level)
{
// Forced ego.
if (item.brand != 0)
return static_cast<brand_type>(item.brand);
const weapon_type wpn_type = static_cast<weapon_type>(item.sub_type);
const int tries = _num_brand_tries(item, item_level);
brand_type rc = SPWPN_NORMAL;
for (int count = 0; count < tries && rc == SPWPN_NORMAL; ++count)
rc = choose_weapon_brand(wpn_type);
ASSERT(is_weapon_brand_ok(item.sub_type, rc, true));
return rc;
}
// Reject brands which are outright bad for the item. Unorthodox combinations
// are ok, since they can happen on randarts.
bool is_weapon_brand_ok(int type, int brand, bool /*strict*/)
{
item_def item;
item.base_type = OBJ_WEAPONS;
item.sub_type = type;
if (brand <= SPWPN_NORMAL)
return true;
if (type == WPN_QUICK_BLADE && brand == SPWPN_SPEED)
return false;
switch ((brand_type)brand)
{
// Universal brands.
case SPWPN_NORMAL:
case SPWPN_VENOM:
case SPWPN_PROTECTION:
case SPWPN_SPEED:
case SPWPN_VORPAL:
case SPWPN_CHAOS:
case SPWPN_HOLY_WRATH:
case SPWPN_ELECTROCUTION:
case SPWPN_FLAMING:
case SPWPN_FREEZING:
break;
// Melee-only brands.
case SPWPN_DRAINING:
case SPWPN_VAMPIRISM:
case SPWPN_PAIN:
case SPWPN_DISTORTION:
case SPWPN_ANTIMAGIC:
case SPWPN_REAPING: // only exists on Sword of Zonguldrok
if (is_range_weapon(item))
return false;
break;
case SPWPN_SPECTRAL:
if (is_range_weapon(item)
|| (basic_hands_reqd(item, SIZE_MEDIUM) == HANDS_ONE
&& type != WPN_CLUB))
{
// only on two-handers and clubs
return false;
}
break;
// Ranged-only brands.
case SPWPN_PENETRATION:
case SPWPN_ACID: // Only exists on Punk
if (!is_range_weapon(item))
return false;
break;
#if TAG_MAJOR_VERSION == 34
// Removed brands.
case SPWPN_RETURNING:
case SPWPN_REACHING:
case SPWPN_ORC_SLAYING:
case SPWPN_FLAME:
case SPWPN_FROST:
case SPWPN_DRAGON_SLAYING:
case SPWPN_EVASION:
return false;
#endif
case SPWPN_CONFUSE:
case SPWPN_FORBID_BRAND:
case SPWPN_DEBUG_RANDART:
case NUM_SPECIAL_WEAPONS:
case NUM_REAL_SPECIAL_WEAPONS:
die("invalid brand %d on weapon %d (%s)", brand, type,
item.name(DESC_PLAIN).c_str());
break;
}
return true;
}
static void _roll_weapon_type(item_def& item, int item_level)
{
for (int i = 0; i < 1000; ++i)
{
item.sub_type = _determine_weapon_subtype(item_level);
if (is_weapon_brand_ok(item.sub_type, item.brand, true))
return;
}
item.brand = SPWPN_NORMAL; // fall back to no brand
}
/// Plusses for a non-artefact weapon with positive plusses.
int determine_nice_weapon_plusses(int item_level)
{
const int chance = (item_level >= ISPEC_GIFT ? 200 : item_level);
// Odd-looking, but this is how the algorithm compacts {dlb}.
int plus = 0;
for (int i = 0; i < 4; ++i)
{
plus += random2(3);
if (random2(425) > 35 + chance)
break;
}
return plus;
}
void set_artefact_brand(item_def &item, int brand)
{
item.props[ARTEFACT_PROPS_KEY].get_vector()[ARTP_BRAND].get_short() = brand;
}
static void _generate_weapon_item(item_def& item, bool allow_uniques,
int force_type, int item_level,
int agent = NO_AGENT)
{
// Determine weapon type.
if (force_type != OBJ_RANDOM)
item.sub_type = force_type;
else
_roll_weapon_type(item, item_level);
// Fall back to an ordinary item if randarts not allowed for this type.
if (item_level == ISPEC_RANDART && _weapon_disallows_randart(item.sub_type))
item_level = ISPEC_GOOD_ITEM;
// Forced randart.
if (item_level == ISPEC_RANDART)
{
int ego = item.brand;
for (int i = 0; i < 100; ++i)
if (_try_make_weapon_artefact(item, force_type, 0, true, agent)
&& is_artefact(item))
{
if (ego > SPWPN_NORMAL)
set_artefact_brand(item, ego);
if (randart_is_bad(item)) // recheck, the brand changed
{
force_type = item.sub_type;
item.clear();
item.quantity = 1;
item.base_type = OBJ_WEAPONS;
item.sub_type = force_type;
continue;
}
return;
}
// fall back to an ordinary item
item_level = ISPEC_GOOD_ITEM;
}
// If we make the unique roll, no further generation necessary.
if (allow_uniques
&& _try_make_weapon_artefact(item, force_type, item_level, false, agent))
{
return;
}
ASSERT(!is_artefact(item));
// Artefacts handled, let's make a normal item.
const bool force_good = item_level >= ISPEC_GIFT;
const bool forced_ego = item.brand > 0;
const bool no_brand = item.brand == SPWPN_FORBID_BRAND;
if (no_brand)
set_item_ego_type(item, OBJ_WEAPONS, SPWPN_NORMAL);
// If it's forced to be a good item, reroll clubs.
while (force_good && force_type == OBJ_RANDOM && item.sub_type == WPN_CLUB)
_roll_weapon_type(item, item_level);
item.plus = 0;
if (item_level < 0)
{
// Thoroughly damaged, could had been good once.
if (!no_brand && (forced_ego || one_chance_in(4)))
{
// Brand is set as for "good" items.
set_item_ego_type(item, OBJ_WEAPONS,
determine_weapon_brand(item, 2 + 2 * env.absdepth0));
}
item.plus -= 1 + random2(3);
}
else if ((force_good || is_demonic(item) || forced_ego
|| x_chance_in_y(51 + item_level, 200))
&& (!item.is_mundane() || force_good))
{
// Make a better item (possibly ego).
if (!no_brand)
{
set_item_ego_type(item, OBJ_WEAPONS,
determine_weapon_brand(item, item_level));
}
// if acquired item still not ego... enchant it up a bit.
if (force_good && item.brand == SPWPN_NORMAL)
item.plus += 2 + random2(3);
item.plus += determine_nice_weapon_plusses(item_level);
// squash boring items.
if (!force_good && item.brand == SPWPN_NORMAL && item.plus < 3)
item.plus = 0;
}
}
// Remember to update the code in is_missile_brand_ok if adding or altering
// brands that are applied to missiles. {due}
static special_missile_type _determine_missile_brand(const item_def& item,
int item_level)
{
// Forced ego.
if (item.brand != 0)
return static_cast<special_missile_type>(item.brand);
special_missile_type rc = SPMSL_NORMAL;
// Weight of SPMSL_NORMAL
// Gifts from Trog/Oka can be unbranded boomerangs/javelins
// but not poisoned darts
int nw = item_level >= ISPEC_GOOD_ITEM ? 0 :
item_level == ISPEC_GIFT ? 120
: random2(2000 - 55 * item_level);
// Weight of SPMSL_POISONED
int pw = item_level >= ISPEC_GIFT ? 0 : random2(2000 - 55 * item_level);
switch (item.sub_type)
{
case MI_THROWING_NET:
case MI_STONE:
case MI_LARGE_ROCK:
case MI_SLING_BULLET:
case MI_ARROW:
case MI_BOLT:
rc = SPMSL_NORMAL;
break;
case MI_DART:
// Curare is special cased, all the others aren't.
if (got_curare_roll(item_level))
{
rc = SPMSL_CURARE;
break;
}
rc = random_choose_weighted(60, SPMSL_BLINDING,
20, SPMSL_FRENZY,
pw, SPMSL_POISONED);
break;
case MI_JAVELIN:
rc = random_choose_weighted(90, SPMSL_SILVER,
nw, SPMSL_NORMAL);
break;
case MI_BOOMERANG:
rc = random_choose_weighted(30, SPMSL_SILVER,
30, SPMSL_DISPERSAL,
nw, SPMSL_NORMAL);
break;
}
ASSERT(is_missile_brand_ok(item.sub_type, rc, true));
return rc;
}
bool is_missile_brand_ok(int type, int brand, bool strict)
{
// Launcher ammo can never be branded.
if ((type == MI_STONE
|| type == MI_LARGE_ROCK
|| type == MI_SLING_BULLET
|| type == MI_ARROW
|| type == MI_BOLT)
&& brand != SPMSL_NORMAL
&& strict)
{
return false;
}
// Never generates, only used for chaos-branded missiles.
if (brand == SPMSL_FLAME || brand == SPMSL_FROST)
return false;
// In contrast, darts should always be branded.
// And all of these brands save poison are unique to darts.
switch (brand)
{
case SPMSL_POISONED:
if (type == MI_DART)
return true;
break;
case SPMSL_CURARE:
#if TAG_MAJOR_VERSION == 34
case SPMSL_PARALYSIS:
#endif
case SPMSL_FRENZY:
return type == MI_DART;
case SPMSL_BLINDING:
// possible on ex-pies
return type == MI_DART || (type == MI_BOOMERANG && !strict);
default:
if (type == MI_DART)
return false;
}
// Everything else doesn't matter.
if (brand == SPMSL_NORMAL)
return true;
// In non-strict mode, everything other than darts is mostly ok.
if (!strict)
return true;
// Not a missile?
if (type == 0)
return true;
// Specifics
switch (brand)
{
case SPMSL_POISONED:
return false;
case SPMSL_CHAOS:
return type == MI_BOOMERANG || type == MI_JAVELIN;
case SPMSL_DISPERSAL:
return type == MI_BOOMERANG;
case SPMSL_SILVER:
return type == MI_JAVELIN || type == MI_BOOMERANG;
default: break;
}
// Assume no, if we've gotten this far.
return false;
}
static void _generate_missile_item(item_def& item, int force_type,
int item_level)
{
const bool no_brand = (item.brand == SPMSL_FORBID_BRAND);
if (no_brand)
item.brand = SPMSL_NORMAL;
item.plus = 0;
if (force_type != OBJ_RANDOM)
item.sub_type = force_type;
else
{
item.sub_type =
random_choose_weighted(50, MI_STONE,
20, MI_ARROW,
12, MI_BOLT,
12, MI_SLING_BULLET,
10, MI_DART,
3, MI_BOOMERANG,
2, MI_JAVELIN,
1, MI_THROWING_NET,
1, MI_LARGE_ROCK);
}
// No fancy rocks -- break out before we get to special stuff.
if (item.sub_type == MI_LARGE_ROCK)
{
item.quantity = 2 + random2avg(5,2);
return;
}
else if (item.sub_type == MI_STONE)
{
item.quantity = 1 + random2(7); // sequence points for random2
item.quantity += random2(10);
item.quantity += random2(12);
item.quantity += random2(10);
return;
}
else if (item.sub_type == MI_THROWING_NET) // no fancy nets, either
{
item.quantity = 1 + one_chance_in(4); // and only one, rarely two
return;
}
if (!no_brand)
{
set_item_ego_type(item, OBJ_MISSILES,
_determine_missile_brand(item, item_level));
}
// Reduced quantity if special.
if (item.sub_type == MI_JAVELIN || item.sub_type == MI_BOOMERANG
|| (item.sub_type == MI_DART && get_ammo_brand(item) != SPMSL_POISONED)
#if TAG_MAJOR_VERSION == 34
|| get_ammo_brand(item) == SPMSL_RETURNING
#endif
)
{
item.quantity = random_range(2, 8);
}
else
{
item.quantity = 1 + random2(7); // sequence points for random2
item.quantity += random2(10);
item.quantity += random2(10);
if (get_ammo_brand(item) == SPMSL_NORMAL)
item.quantity += random2(12);
}
}
static bool _armour_disallows_randart(int sub_type)
{
// Scarves are never randarts.
return sub_type == ARM_SCARF;
}
static bool _try_make_armour_artefact(item_def& item, int force_type,
int item_level, bool force_randart,
int agent)
{
if (item_level > 2 && x_chance_in_y(101 + item_level * 3, 4000)
|| force_randart)
{
// Make a randart or unrandart.
// 1 in 20 randarts are unrandarts.
if (one_chance_in(item_level == ISPEC_GOOD_ITEM ? 7 : 20)
&& !force_randart)
{
if (_try_make_item_unrand(item, force_type, agent))
return true;
}
if (_armour_disallows_randart(item.sub_type))
return false;
// The rest are normal randarts.
// 5% of boots become barding.
if (item.sub_type == ARM_BOOTS && one_chance_in(20))
item.sub_type = ARM_BARDING;
// Determine enchantment.
if (one_chance_in(5))
item.plus = 0;
else
{
int max_plus = armour_max_enchant(item);
item.plus = random2(max_plus + 1);
if (one_chance_in(5))
item.plus += random2(max_plus + 6) / 2;
if (one_chance_in(6))
item.plus -= random2(max_plus + 6);
}
// On body armour, an enchantment of less than 0 is never viable.
if (get_armour_slot(item) == EQ_BODY_ARMOUR)
item.plus = max(static_cast<int>(item.plus), random2(2));
// Needs to be done after the barding chance else we get randart
// bardings named Boots of xy.
make_item_randart(item);
// Don't let unenchantable armour get minuses.
if (!armour_is_enchantable(item))
item.plus = 0;
return true;
}
return false;
}
/**
* Generate an appropriate ego for a type of armour.
*
* @param item The type of armour in question.
* @return An ego appropriate to the item type.
* May be SPARM_NORMAL.
*/
static special_armour_type _generate_armour_type_ego(armour_type type)
{
// TODO: move this into data
switch (type)
{
case ARM_KITE_SHIELD:
case ARM_TOWER_SHIELD:
case ARM_BUCKLER:
return random_choose_weighted(1, SPARM_RESISTANCE,
3, SPARM_FIRE_RESISTANCE,
3, SPARM_COLD_RESISTANCE,
3, SPARM_POISON_RESISTANCE,
3, SPARM_POSITIVE_ENERGY,
6, SPARM_REFLECTION,
12, SPARM_PROTECTION);
case ARM_SCARF:
return random_choose_weighted(1, SPARM_RESISTANCE,
1, SPARM_REPULSION,
1, SPARM_INVISIBILITY,
1, SPARM_HARM,
1, SPARM_SHADOWS);
case ARM_CLOAK:
return random_choose(SPARM_POISON_RESISTANCE,
SPARM_WILLPOWER,
SPARM_STEALTH,
SPARM_PRESERVATION);
case ARM_HAT:
return random_choose_weighted(10, SPARM_NORMAL,
3, SPARM_STEALTH,
3, SPARM_WILLPOWER,
2, SPARM_INTELLIGENCE,
2, SPARM_SEE_INVISIBLE);
case ARM_HELMET:
return random_choose(SPARM_SEE_INVISIBLE, SPARM_INTELLIGENCE);
case ARM_GLOVES:
return random_choose(SPARM_DEXTERITY, SPARM_STRENGTH, SPARM_ARCHERY, SPARM_STEALTH);
case ARM_BOOTS:
return random_choose(SPARM_FLYING, SPARM_STEALTH, SPARM_RAMPAGING);
case ARM_BARDING:
return random_choose(SPARM_FLYING, SPARM_STEALTH,
SPARM_COLD_RESISTANCE, SPARM_FIRE_RESISTANCE);
case ARM_ROBE:
return random_choose_weighted(1, SPARM_RESISTANCE,
1, SPARM_ARCHMAGI,
2, SPARM_NORMAL,
2, SPARM_COLD_RESISTANCE,
2, SPARM_FIRE_RESISTANCE,
2, SPARM_POSITIVE_ENERGY,
4, SPARM_WILLPOWER);
case ARM_PLATE_ARMOUR:
return random_choose_weighted(26, SPARM_FIRE_RESISTANCE,
26, SPARM_COLD_RESISTANCE,
19, SPARM_POISON_RESISTANCE,
15, SPARM_WILLPOWER,
7, SPARM_POSITIVE_ENERGY,
7, SPARM_PONDEROUSNESS);
// other body armour
default:
break;
}
// dragon/troll armour, animal hides, and crystal plate are never generated
// with egos. (unless they're artefacts, but those aren't handled here.)
// TODO: deduplicate with armour_is_special() (same except for animal skin)
if (armour_type_is_hide(type)
|| type == ARM_ANIMAL_SKIN
|| type == ARM_CRYSTAL_PLATE_ARMOUR)
{
return SPARM_NORMAL;
}
return random_choose_weighted(7, SPARM_FIRE_RESISTANCE,
7, SPARM_COLD_RESISTANCE,
5, SPARM_POISON_RESISTANCE,
4, SPARM_WILLPOWER,
2, SPARM_POSITIVE_ENERGY);
}
/**
* Generate an appropriate ego for a piece of armour.
*
* @param item The item in question.
* @return The item's current ego, if it already has one;
* otherwise, an ego appropriate to the item.
* May be SPARM_NORMAL.
*/
static special_armour_type _generate_armour_ego(const item_def& item)
{
if (item.brand != SPARM_NORMAL)
return static_cast<special_armour_type>(item.brand);
const special_armour_type ego
= _generate_armour_type_ego(static_cast<armour_type>(item.sub_type));
ASSERT(is_armour_brand_ok(item.sub_type, ego, true));
return ego;
}
bool is_armour_brand_ok(int type, int brand, bool strict)
{
equipment_type slot = get_armour_slot((armour_type)type);
// Currently being too restrictive results in asserts, being too
// permissive will generate such items on "any armour ego:XXX".
// The latter is definitely so much safer -- 1KB
switch ((special_armour_type)brand)
{
case SPARM_FORBID_EGO:
case SPARM_NORMAL:
return true;
case SPARM_FLYING:
if (slot == EQ_BODY_ARMOUR)
return true;
// deliberate fall-through
#if TAG_MAJOR_VERSION == 34
case SPARM_RUNNING:
case SPARM_JUMPING:
#endif
case SPARM_RAMPAGING:
return slot == EQ_BOOTS;
case SPARM_STEALTH:
return slot == EQ_BOOTS || slot == EQ_CLOAK
|| slot == EQ_HELMET || slot == EQ_GLOVES;
case SPARM_ARCHMAGI:
return !strict || type == ARM_ROBE;
case SPARM_PONDEROUSNESS:
return true;
case SPARM_PRESERVATION:
#if TAG_MAJOR_VERSION > 34
return slot == EQ_CLOAK;
#endif
#if TAG_MAJOR_VERSION == 34
if (type == ARM_PLATE_ARMOUR && !strict)
return true;
return slot == EQ_CLOAK;
case SPARM_INVISIBILITY:
return (slot == EQ_CLOAK && !strict) || type == ARM_SCARF;
#endif
case SPARM_REFLECTION:
case SPARM_PROTECTION:
return slot == EQ_SHIELD;
case SPARM_STRENGTH:
case SPARM_DEXTERITY:
if (!strict)
return true;
// deliberate fall-through
case SPARM_ARCHERY:
return slot == EQ_GLOVES;
case SPARM_SEE_INVISIBLE:
case SPARM_INTELLIGENCE:
return slot == EQ_HELMET;
case SPARM_FIRE_RESISTANCE:
case SPARM_COLD_RESISTANCE:
case SPARM_RESISTANCE:
if (type == ARM_FIRE_DRAGON_ARMOUR
|| type == ARM_ICE_DRAGON_ARMOUR
|| type == ARM_GOLD_DRAGON_ARMOUR)
{
return false; // contradictory or redundant
}
return true; // in portal vaults, these can happen on every slot
case SPARM_WILLPOWER:
if (type == ARM_HAT)
return true;
// deliberate fall-through
case SPARM_POISON_RESISTANCE:
case SPARM_POSITIVE_ENERGY:
if (type == ARM_PEARL_DRAGON_ARMOUR && brand == SPARM_POSITIVE_ENERGY)
return false; // contradictory or redundant
return slot == EQ_BODY_ARMOUR || slot == EQ_SHIELD || slot == EQ_CLOAK
|| !strict;
case SPARM_SPIRIT_SHIELD:
return
#if TAG_MAJOR_VERSION == 34
type == ARM_HAT ||
type == ARM_CAP ||
type == ARM_SCARF ||
#endif
slot == EQ_SHIELD || !strict;
case SPARM_REPULSION:
case SPARM_HARM:
#if TAG_MAJOR_VERSION > 34
case SPARM_INVISIBILITY:
#endif
#if TAG_MAJOR_VERSION == 34
case SPARM_CLOUD_IMMUNE:
#endif
case SPARM_SHADOWS:
return type == ARM_SCARF;
case NUM_SPECIAL_ARMOURS:
case NUM_REAL_SPECIAL_ARMOURS:
die("invalid armour brand");
}
return true;
}
/**
* Return the number of plusses required for a type of armour to be notable.
* (From plus alone.)
*
* @param armour_type The type of armour being considered.
* @return The armour plus value required to be interesting.
*/
static int _armour_plus_threshold(equipment_type armour_type)
{
switch (armour_type)
{
// body armour is very common; squelch most of it
case EQ_BODY_ARMOUR:
return 3;
// shields are fairly common
case EQ_SHIELD:
return 2;
// aux armour is relatively uncommon
default:
return 1;
}
}
/**
* Pick an armour type (ex. plate armour), based on item_level
*
* @param item_level The rough power level of the item.
*
* @return The selected armour type.
*/
static armour_type _get_random_armour_type(int item_level)
{
// Dummy value for initilization, always changed by the conditional
// (and not changing it would trigger an ASSERT)
armour_type armtype = NUM_ARMOURS;
// Secondary armours.
if (one_chance_in(5))
{
// Total weight is 60, each slot has a weight of 12
armtype = random_choose_weighted(12, ARM_BOOTS,
12, ARM_GLOVES,
// Cloak slot
9, ARM_CLOAK,
3, ARM_SCARF,
// Head slot
10, ARM_HELMET,
2, ARM_HAT,
// Shield slot
4, ARM_KITE_SHIELD,
6, ARM_BUCKLER,
2, ARM_TOWER_SHIELD);
}
else if (x_chance_in_y(11 + item_level, 10000))
{
// High level dragon scales
armtype = random_choose(ARM_STEAM_DRAGON_ARMOUR,
ARM_ACID_DRAGON_ARMOUR,
ARM_STORM_DRAGON_ARMOUR,
ARM_GOLD_DRAGON_ARMOUR,
ARM_SWAMP_DRAGON_ARMOUR,
ARM_PEARL_DRAGON_ARMOUR,
ARM_SHADOW_DRAGON_ARMOUR,
ARM_QUICKSILVER_DRAGON_ARMOUR);
}
else if (x_chance_in_y(11 + item_level, 8000))
{
// Crystal plate, some armours which are normally gained by butchering
// monsters for hides.
armtype = random_choose(ARM_CRYSTAL_PLATE_ARMOUR,
ARM_TROLL_LEATHER_ARMOUR,
ARM_FIRE_DRAGON_ARMOUR,
ARM_ICE_DRAGON_ARMOUR);
}
else if (x_chance_in_y(11 + item_level, 60))
{
// All the "mundane" armours. Generally the player will find at least
// one copy of these by the Lair.
armtype = random_choose(ARM_ROBE,
ARM_LEATHER_ARMOUR,
ARM_RING_MAIL,
ARM_SCALE_MAIL,
ARM_CHAIN_MAIL,
ARM_PLATE_ARMOUR);
}
else if (x_chance_in_y(11 + item_level, 35))
{
// All the "mundane" amours except plate.
armtype = random_choose(ARM_ROBE,
ARM_LEATHER_ARMOUR,
ARM_RING_MAIL,
ARM_SCALE_MAIL,
ARM_CHAIN_MAIL);
}
else
{
// Default (lowest-level) armours.
armtype = random_choose(ARM_ROBE,
ARM_LEATHER_ARMOUR,
ARM_RING_MAIL);
}
ASSERT(armtype != NUM_ARMOURS);
return armtype;
}
static void _generate_armour_item(item_def& item, bool allow_uniques,
int force_type, int item_level,
int agent = NO_AGENT)
{
if (force_type != OBJ_RANDOM)
item.sub_type = force_type;
else
{
for (int i = 0; i < 1000; ++i)
{
item.sub_type = _get_random_armour_type(item_level);
if (is_armour_brand_ok(item.sub_type, item.brand, true))
break;
}
}
// Fall back to an ordinary item if artefacts not allowed for this type.
if (item_level == ISPEC_RANDART && _armour_disallows_randart(item.sub_type))
item_level = ISPEC_GOOD_ITEM;
// Forced randart.
if (item_level == ISPEC_RANDART)
{
int ego = item.brand;
for (int i = 0; i < 100; ++i)
if (_try_make_armour_artefact(item, force_type, 0, true, agent)
&& is_artefact(item))
{
// borrowed from similar code for weapons -- is this really the
// best way to force an ego??
if (ego > SPARM_NORMAL)
{
set_artefact_brand(item, ego);
if (randart_is_bad(item)) // recheck, the brand changed
{
force_type = item.sub_type;
item.clear();
item.quantity = 1;
item.base_type = OBJ_ARMOUR;
item.sub_type = force_type;
continue;
}
}
return;
}
// fall back to an ordinary item
item_level = ISPEC_GOOD_ITEM;
}
if (allow_uniques
&& _try_make_armour_artefact(item, force_type, item_level, false, agent))
{
return;
}
if (item.sub_type == ARM_BOOTS && one_chance_in(8))
item.sub_type = ARM_BARDING;
const bool force_good = item_level >= ISPEC_GIFT;
const bool forced_ego = (item.brand > 0);
const bool no_ego = (item.brand == SPARM_FORBID_EGO);
if (no_ego)
item.brand = SPARM_NORMAL;
if (item_level < 0)
{
// Thoroughly damaged, could have been good once.
if (!no_ego && (forced_ego || one_chance_in(4)))
{
// Brand is set as for "good" items.
set_item_ego_type(item, OBJ_ARMOUR, _generate_armour_ego(item));
}
item.plus -= 1 + random2(3);
}
// Scarves always get an ego.
else if (item.sub_type == ARM_SCARF)
set_item_ego_type(item, OBJ_ARMOUR, _generate_armour_ego(item));
else if ((forced_ego || item.sub_type == ARM_HAT
|| x_chance_in_y(51 + item_level, 250))
&& !item.is_mundane() || force_good)
{
// Make a good item...
item.plus += random2(3);
if (item.sub_type <= ARM_PLATE_ARMOUR
&& x_chance_in_y(21 + item_level, 300))
{
item.plus += random2(3);
}
if (!no_ego && x_chance_in_y(31 + item_level, 350))
{
// ...an ego item, in fact.
set_item_ego_type(item, OBJ_ARMOUR, _generate_armour_ego(item));
if (get_armour_ego_type(item) == SPARM_PONDEROUSNESS)
item.plus += 3 + random2(8);
}
}
// Don't overenchant items.
if (item.plus > armour_max_enchant(item))
item.plus = armour_max_enchant(item);
// Don't let unenchantable armour get minuses.
if (!armour_is_enchantable(item))
item.plus = 0;
// Never give brands to scales or hides, in case of misbehaving vaults.
if (armour_type_is_hide(static_cast<armour_type>(item.sub_type)))
set_item_ego_type(item, OBJ_ARMOUR, SPARM_NORMAL);
// squash boring items.
if (!force_good && item.brand == SPARM_NORMAL && item.plus > 0
&& item.plus < _armour_plus_threshold(get_armour_slot(item)))
{
item.plus = 0;
}
}
/**
* Choose a random wand subtype for ordinary wand generation.
*
* Some wands [mostly more powerful ones] are less common than others.
* Attack wands are more common, mostly to preserve historical wand freqs.
*
* @return A random wand_type.
*/
static int _random_wand_subtype()
{
// total weight 70 [arbitrary]
return random_choose_weighted(10, WAND_FLAME,
10, WAND_ICEBLAST,
8, WAND_RANDOM_EFFECTS,
8, WAND_POLYMORPH,
8, WAND_PARALYSIS,
8, WAND_ACID,
6, WAND_MINDBURST,
6, WAND_DIGGING,
5, WAND_CHARMING);
}
/**
* Should wands of this type NOT spawn extremely early on? (At very low
* item_level, or in the hands of very low HD monsters?)
*
* @param type The wand_type in question.
* @return Whether it'd be excessively mean for this wand to be used
* against very early players.
*/
bool is_high_tier_wand(int type)
{
switch (type)
{
case WAND_CHARMING:
case WAND_PARALYSIS:
case WAND_ACID:
case WAND_ICEBLAST:
case WAND_MINDBURST:
return true;
default:
return false;
}
}
static void _generate_wand_item(item_def& item, int force_type, int item_level)
{
if (force_type != OBJ_RANDOM)
item.sub_type = force_type;
else
item.sub_type = _random_wand_subtype();
// Add wand charges and ensure we have at least one charge.
item.charges = 1 + random2avg(wand_charge_value(item.sub_type), 3);
// Don't let monsters pickup early high-tier wands
if (item_level < 2 && is_high_tier_wand(item.sub_type))
item.flags |= ISFLAG_NO_PICKUP;
}
static void _generate_potion_item(item_def& item, int force_type,
int item_level, int agent)
{
item.quantity = 1;
if (one_chance_in(18))
item.quantity++;
if (one_chance_in(25))
item.quantity++;
if (force_type != OBJ_RANDOM)
item.sub_type = force_type;
else
{
int stype;
int tries = 500;
// If created by Xom, keep going until an approved potion is chosen
// Currently does nothing, until we come up with a boring potion.
do
{
// total weight: 1045
stype = random_choose_weighted(192, POT_CURING,
105, POT_HEAL_WOUNDS,
73, POT_FLIGHT,
73, POT_HASTE,
73, POT_LIGNIFY,
66, POT_ATTRACTION,
66, POT_DEGENERATION,
66, POT_MIGHT,
66, POT_BRILLIANCE,
53, POT_MUTATION,
35, POT_INVISIBILITY,
35, POT_RESISTANCE,
35, POT_MAGIC,
35, POT_BERSERK_RAGE,
35, POT_CANCELLATION,
35, POT_AMBROSIA,
2, POT_EXPERIENCE);
}
while (agent == GOD_XOM
&& _is_boring_item(OBJ_POTIONS, stype)
&& --tries > 0);
item.sub_type = stype;
}
// don't let monsters pickup early dangerous potions
if (item_level < 2 && item.sub_type == POT_BERSERK_RAGE)
item.flags |= ISFLAG_NO_PICKUP;
}
static void _generate_scroll_item(item_def& item, int force_type,
int item_level, int agent)
{
// determine sub_type:
if (force_type != OBJ_RANDOM)
item.sub_type = force_type;
else
{
const int depth_mod = random2(1 + item_level);
int tries = 500;
// If this item is created by Xom, keep looping until an
// interesting scroll is discovered (as determined by
// _is_boring_item). Otherwise just weighted-choose a scroll.
do
{
// total weight: 597 if depth_mod < 4
// 716 otherwise
// -122 in sprint
item.sub_type = random_choose_weighted(
200, SCR_IDENTIFY,
// [Cha] don't generate teleportation scrolls if in sprint
100, (crawl_state.game_is_sprint() ? NUM_SCROLLS
: SCR_TELEPORTATION),
45, SCR_AMNESIA,
40, SCR_ENCHANT_ARMOUR,
40, SCR_ENCHANT_WEAPON,
40, SCR_MAGIC_MAPPING,
32, SCR_FEAR,
32, SCR_FOG,
32, SCR_BLINKING,
32, SCR_IMMOLATION,
// [Cha] don't generate noise scrolls if in sprint
22, (crawl_state.game_is_sprint() ? NUM_SCROLLS : SCR_NOISE),
22, SCR_RANDOM_USELESSNESS,
// Higher-level scrolls.
27, (depth_mod < 4 ? NUM_SCROLLS : SCR_VULNERABILITY),
17, (depth_mod < 4 ? NUM_SCROLLS : SCR_SUMMONING),
15, (depth_mod < 4 ? NUM_SCROLLS : SCR_ACQUIREMENT),
15, (depth_mod < 4 ? NUM_SCROLLS : SCR_SILENCE),
15, (depth_mod < 4 ? NUM_SCROLLS : SCR_BRAND_WEAPON),
15, (depth_mod < 4 ? NUM_SCROLLS : SCR_TORMENT),
15, (depth_mod < 4 ? NUM_SCROLLS : SCR_HOLY_WORD));
}
while (item.sub_type == NUM_SCROLLS
|| agent == GOD_XOM
&& _is_boring_item(OBJ_SCROLLS, item.sub_type)
&& --tries > 0);
}
item.quantity = random_choose_weighted(46, 1,
1, 2,
1, 3);
item.plus = 0;
}
/// Choose a random spellbook type for the given level.
static book_type _choose_book_type(int item_level)
{
const book_type book = static_cast<book_type>(random2(NUM_FIXED_BOOKS));
if (item_type_removed(OBJ_BOOKS, book))
return _choose_book_type(item_level); // choose something else
// If this book is really rare for this depth, continue trying.
const int rarity = book_rarity(book);
ASSERT(rarity != 100); // 'removed item' - ugh...
if (!one_chance_in(100) && x_chance_in_y(rarity-1, item_level+1))
return _choose_book_type(item_level); // choose something else
return book;
}
/// Choose a random skill for a manual to be generated for.
static skill_type _choose_manual_skill()
{
// spell skill (or invo/evo)
if (one_chance_in(4))
{
skill_type skill;
do
{
skill = static_cast<skill_type>(
SK_SPELLCASTING + random2(NUM_SKILLS - SK_SPELLCASTING));
} while (is_removed_skill(skill));
return skill;
}
// mundane skill
skill_type skill;
do
{
skill = static_cast<skill_type>(random2(SK_LAST_MUNDANE+1));
} while (is_removed_skill(skill));
return skill;
}
static void _generate_book_item(item_def& item, bool allow_uniques,
int force_type, int item_level)
{
if (force_type != OBJ_RANDOM)
item.sub_type = force_type;
else if (item_level > 6 && x_chance_in_y(21 + item_level, 4000))
item.sub_type = BOOK_MANUAL; // skill manual - rare!
else
item.sub_type = _choose_book_type(item_level);
if (item.sub_type == BOOK_MANUAL)
{
item.skill = _choose_manual_skill();
// Set number of bonus skill points.
item.skill_points = random_range(2000, 3000);
// Preidentify.
set_ident_flags(item, ISFLAG_IDENT_MASK);
return; // rare enough without being replaced with randarts
}
// Only randomly generate randart books for OBJ_RANDOM, since randart
// spellbooks aren't merely of-the-same-type-but-better, but
// have an entirely different set of spells.
if (allow_uniques && item_level > 2 && force_type == OBJ_RANDOM
&& x_chance_in_y(101 + item_level * 3, 4000))
{
int choice = random_choose_weighted(
29, BOOK_RANDART_THEME,
1, BOOK_RANDART_LEVEL);
item.sub_type = choice;
}
if (item.sub_type == BOOK_RANDART_THEME)
build_themed_book(item, capped_spell_filter(20));
else if (item.sub_type == BOOK_RANDART_LEVEL)
{
int max_level = min(9, max(1, item_level / 3));
int spl_level = random_range(1, max_level);
make_book_level_randart(item, spl_level);
}
}
static stave_type _get_random_stave_type()
{
stave_type r;
do
{
r = static_cast<stave_type>(random2(NUM_STAVES));
}
while (item_type_removed(OBJ_STAVES, r));
return r;
}
static void _generate_staff_item(item_def& item, bool allow_uniques,
int force_type, int item_level, int agent)
{
// If we make the unique roll, no further generation necessary.
// Copied unrand code from _try_make_weapon_artefact since randart enhancer staves
// can't happen.
if (allow_uniques
&& one_chance_in(item_level == ISPEC_GOOD_ITEM ? 27 : 100))
{
// Temporarily fix the base_type to get enhancer staves
// TODO: ???
item.base_type = OBJ_WEAPONS;
// need to use force_type here, because _try_make_item_unrand can set
// it for fallback randarts.
force_type = WPN_STAFF;
if (_try_make_item_unrand(item, force_type, agent))
return;
if (item.base_type != OBJ_STAVES)
{
// this will happen if an unrand staff requests a real weapon as
// a fallback. TODO: can this be accommodated in this code path?
item.base_type = OBJ_STAVES;
force_type = OBJ_RANDOM;
}
}
if (force_type == OBJ_RANDOM)
item.sub_type = _get_random_stave_type();
else
item.sub_type = force_type;
}
static void _generate_rune_item(item_def& item, int force_type)
{
if (force_type == OBJ_RANDOM)
{
vector<int> possibles;
for (int i = 0; i < NUM_RUNE_TYPES; i++)
if (!item_type_removed(OBJ_RUNES, i) && !you.runes[i]
&& i != RUNE_ELF && i != RUNE_FOREST)
{
possibles.push_back(i);
}
item.sub_type = possibles.empty()
? RUNE_DEMONIC
: *random_iterator(possibles);
}
else
item.sub_type = force_type;
}
static bool _try_make_jewellery_unrandart(item_def& item, int force_type,
int item_level, int agent)
{
int type = (force_type == NUM_RINGS) ? get_random_ring_type() :
(force_type == NUM_JEWELLERY) ? get_random_amulet_type()
: force_type;
if (item_level > 2
&& one_chance_in(20)
&& x_chance_in_y(101 + item_level * 3, 2000))
{
if (_try_make_item_unrand(item, type, agent))
return true;
}
return false;
}
/**
* A 'good' plus for stat rings is GOOD_STAT_RING_PLUS, for other rings it's
* GOOD_RING_PLUS.
*
* @param subtype The type of ring in question.
* @return 4 or 6.
* (minor numerical variations are boring.)
*/
static short _good_jewellery_plus(int subtype)
{
switch (subtype)
{
case RING_STRENGTH:
case RING_DEXTERITY:
case RING_INTELLIGENCE:
return GOOD_STAT_RING_PLUS;
default:
return GOOD_RING_PLUS;
}
}
/**
* Generate a random 'plus' for a given type of ring.
*
* @param subtype The type of ring in question.
* @return A 'plus' for that ring. 0 for most types.
*/
static short _determine_ring_plus(int subtype)
{
if (!jewellery_type_has_plusses(subtype))
return 0;
return _good_jewellery_plus(subtype);
}
static void _generate_jewellery_item(item_def& item, bool allow_uniques,
int force_type, int item_level,
int agent)
{
if (allow_uniques && item_level != ISPEC_RANDART
&& _try_make_jewellery_unrandart(item, force_type, item_level, agent))
{
return;
}
// Determine subtype.
// Note: removed double probability reduction for some subtypes
if (force_type != OBJ_RANDOM
&& force_type != NUM_RINGS
&& force_type != NUM_JEWELLERY)
{
item.sub_type = force_type;
}
else
{
int tries = 500;
do
{
if (force_type == NUM_RINGS)
item.sub_type = get_random_ring_type();
else if (force_type == NUM_JEWELLERY)
item.sub_type = get_random_amulet_type();
else
item.sub_type = (one_chance_in(4) ? get_random_amulet_type()
: get_random_ring_type());
}
while (agent == GOD_XOM
&& _is_boring_item(OBJ_JEWELLERY, item.sub_type)
&& --tries > 0);
}
item.plus = _determine_ring_plus(item.sub_type);
// All jewellery base types should now work. - bwr
if (item_level == ISPEC_RANDART
|| allow_uniques && item_level > 2
&& x_chance_in_y(101 + item_level * 3, 4000))
{
make_item_randart(item);
}
}
static void _generate_misc_item(item_def& item, int force_type)
{
if (force_type != OBJ_RANDOM)
item.sub_type = force_type;
else
{
item.sub_type = random_choose(MISC_PHIAL_OF_FLOODS,
MISC_LIGHTNING_ROD,
MISC_BOX_OF_BEASTS,
MISC_PHANTOM_MIRROR,
MISC_TIN_OF_TREMORSTONES,
MISC_CONDENSER_VANE);
}
}
/**
* Alter the inputed item to have no "plusses" (mostly weapon/armour enchantment)
*
* @param[in,out] item_slot The item slot of the item to remove "plusses" from.
*/
void squash_plusses(int item_slot)
{
item_def& item(env.item[item_slot]);
item.plus = 0;
item.plus2 = 0;
item.brand = 0;
set_equip_desc(item, ISFLAG_NO_DESC);
}
static bool _ego_unrand_only(int base_type, int ego)
{
if (base_type == OBJ_WEAPONS)
{
switch (static_cast<brand_type>(ego))
{
case SPWPN_REAPING:
case SPWPN_ACID:
return true;
default:
return false;
}
}
// all armours are ok?
return false;
}
// Make a corresponding randart instead as a fallback.
// Attempts to use base type, sub type, and ego (for armour/weapons).
// Artefacts can explicitly specify a base type and fallback type.
// Could be even more flexible: maybe allow an item spec to describe
// complex fallbacks?
static void _setup_fallback_randart(const int unrand_id,
item_def &item,
int &force_type,
int &item_level)
{
ASSERT(get_unrand_entry(unrand_id));
const unrandart_entry &unrand = *get_unrand_entry(unrand_id);
dprf("Placing fallback randart for %s", unrand.name);
uint8_t fallback_sub_type;
if (unrand.fallback_base_type != OBJ_UNASSIGNED)
{
item.base_type = unrand.fallback_base_type;
fallback_sub_type = unrand.fallback_sub_type;
}
else
{
item.base_type = unrand.base_type;
fallback_sub_type = unrand.sub_type;
}
if (item.base_type == OBJ_WEAPONS
&& fallback_sub_type == WPN_STAFF)
{
item.base_type = OBJ_STAVES;
if (unrand_id == UNRAND_OLGREB)
force_type = STAFF_POISON;
else
force_type = OBJ_RANDOM;
// XXX: small chance of other unrands under some circumstances...
}
else if (item.base_type == OBJ_JEWELLERY
&& fallback_sub_type == AMU_NOTHING)
{
force_type = NUM_JEWELLERY;
}
else
force_type = fallback_sub_type;
// import some brand information from the unrand. TODO: I'm doing this for
// the sake of vault designers who make themed vaults. But it also often
// makes the item more redundant with the unrand; maybe add a bit more
// flexibility in item specs so that this part is optional? However, from a
// seeding perspective, it also makes sense if the item generated is
// very comparable.
// unset fallback_brand is -1. In that case it will try to use the regular
// brand if there is one. If the end result here is 0, the brand (for
// weapons) will be chosen randomly. So to force randomness, use
// SPWPN_NORMAL on the fallback ego, or set neither. (Randarts cannot be
// unbranded.)
item.brand = unrand.fallback_brand; // no type checking here...
if (item.brand < 0
&& !_ego_unrand_only(item.base_type, unrand.prpty[ARTP_BRAND])
&& item.base_type == unrand.base_type // brand isn't well-defined for != case
&& ((item.base_type == OBJ_WEAPONS
&& is_weapon_brand_ok(item.sub_type, unrand.prpty[ARTP_BRAND], true))
|| (item.base_type == OBJ_ARMOUR
&& is_armour_brand_ok(item.sub_type, unrand.prpty[ARTP_BRAND], true))))
{
// maybe do jewellery too?
item.brand = unrand.prpty[ARTP_BRAND];
}
if (item.brand < 0)
item.brand = 0;
item_level = ISPEC_RANDART;
}
/**
* Create an item.
*
* Various parameters determine whether the item can be an artifact, set the
* item class (ex. weapon, wand), set the item subtype (ex.
* hand axe, wand of flame), set the item ego (ex. of flaming, of running), set
* the rough power level of the item, and set the agent of the item (which
* affects what artefacts can be generated, and also non-artefact items if the
* agent is Xom). Item class, Item type, and Item ego can also be randomly
* selected (by setting those parameters to OBJ_RANDOM, OBJ_RANDOM, and 0
* respectively).
*
* @param allow_uniques Can the item generated be an artefact?
* @param force_class The desired OBJECTS class (Example: OBJ_ARMOUR)
* @param force_type The desired SUBTYPE - enum varies by OBJ
* @param item_level How powerful the item is allowed to be
* @param force_ego The desired ego/brand
* @param agent The agent creating the item (Example: Xom) or -1 if NA
*
* @return The generated item's item slot or NON_ITEM if it fails.
*/
int items(bool allow_uniques,
object_class_type force_class,
int force_type,
int item_level,
int force_ego,
int agent)
{
rng::subgenerator item_rng;
ASSERT(force_ego <= 0
|| force_class == OBJ_WEAPONS
|| force_class == OBJ_ARMOUR
|| force_class == OBJ_MISSILES
|| force_class == OBJ_MISCELLANY);
// Find an empty slot for the item (with culling if required).
int p = get_mitm_slot(10);
if (p == NON_ITEM)
return NON_ITEM;
item_def& item(env.item[p]);
const bool force_good = item_level >= ISPEC_GIFT;
if (force_ego != 0)
allow_uniques = false;
item.brand = force_ego;
// cap item_level unless an acquirement-level item {dlb}:
if (item_level > 50 && !force_good)
item_level = 50;
// determine base_type for item generated {dlb}:
if (force_class != OBJ_RANDOM)
{
ASSERT(force_class < NUM_OBJECT_CLASSES);
item.base_type = force_class;
}
else
{
ASSERT(force_type == OBJ_RANDOM);
// Total weight: 1765
item.base_type = random_choose_weighted(
10, OBJ_STAVES,
30, OBJ_BOOKS,
45, OBJ_JEWELLERY,
70, OBJ_WANDS,
212, OBJ_ARMOUR,
212, OBJ_WEAPONS,
176, OBJ_POTIONS,
300, OBJ_MISSILES,
270, OBJ_SCROLLS,
440, OBJ_GOLD);
// misc items placement wholly dependent upon current depth {dlb}:
if (item_level > 7 && x_chance_in_y(21 + item_level, 5000))
item.base_type = OBJ_MISCELLANY;
if (item_level < 7
&& (item.base_type == OBJ_BOOKS
|| item.base_type == OBJ_STAVES
|| item.base_type == OBJ_WANDS)
&& random2(7) >= item_level)
{
item.base_type = random_choose(OBJ_POTIONS, OBJ_SCROLLS);
}
}
ASSERT(force_type == OBJ_RANDOM
|| item.base_type == OBJ_JEWELLERY && force_type == NUM_JEWELLERY
|| force_type < get_max_subtype(item.base_type));
// make_item_randart() might do things differently based upon the
// acquirement agent, especially for god gifts.
if (agent != NO_AGENT && !is_stackable_item(item))
origin_acquired(item, agent);
item.quantity = 1; // generally the case
if (force_ego < SP_FORBID_EGO)
{
const int unrand_id = -force_ego;
if (get_unique_item_status(unrand_id) == UNIQ_NOT_EXISTS)
{
make_item_unrandart(env.item[p], unrand_id);
ASSERT(env.item[p].is_valid());
return p;
}
_setup_fallback_randart(unrand_id, item, force_type, item_level);
allow_uniques = false;
}
// Determine sub_type accordingly. {dlb}
switch (item.base_type)
{
case OBJ_WEAPONS:
_generate_weapon_item(item, allow_uniques, force_type,
item_level, agent);
break;
case OBJ_MISSILES:
_generate_missile_item(item, force_type, item_level);
break;
case OBJ_ARMOUR:
_generate_armour_item(item, allow_uniques, force_type, item_level,
agent);
break;
case OBJ_WANDS:
_generate_wand_item(item, force_type, item_level);
break;
case OBJ_POTIONS:
_generate_potion_item(item, force_type, item_level, agent);
break;
case OBJ_SCROLLS:
_generate_scroll_item(item, force_type, item_level, agent);
break;
case OBJ_JEWELLERY:
_generate_jewellery_item(item, allow_uniques, force_type, item_level,
agent);
break;
case OBJ_BOOKS:
_generate_book_item(item, allow_uniques, force_type, item_level);
break;
case OBJ_STAVES:
// Don't generate unrand staves this way except through acquirement,
// since they also generate as OBJ_WEAPONS.
_generate_staff_item(item, (agent != NO_AGENT), force_type, item_level, agent);
break;
case OBJ_ORBS: // always forced in current setup {dlb}
case OBJ_RUNES:
_generate_rune_item(item, force_type);
break;
case OBJ_MISCELLANY:
_generate_misc_item(item, force_type);
break;
// that is, everything turns to gold if not enumerated above, so ... {dlb}
default:
item.base_type = OBJ_GOLD;
if (force_good)
item.quantity = 100 + random2(400);
else
{
item.quantity = 1 + random2avg(19, 2);
item.quantity += random2(item_level);
}
break;
}
if (item.base_type == OBJ_WEAPONS
&& !is_weapon_brand_ok(item.sub_type, get_weapon_brand(item), false)
|| item.base_type == OBJ_ARMOUR
&& !is_armour_brand_ok(item.sub_type, get_armour_ego_type(item), false)
|| item.base_type == OBJ_MISSILES
&& !is_missile_brand_ok(item.sub_type, item.brand, false))
{
mprf(MSGCH_ERROR, "Invalid brand on item %s, annulling.",
item.name(DESC_PLAIN, false, true, false, false, ISFLAG_KNOW_PLUSES).c_str());
item.brand = 0;
}
// Colour the item.
item_colour(item);
// Set brand appearance.
item_set_appearance(item);
// Don't place the item just yet.
item.pos.reset();
item.link = NON_ITEM;
// Note that item might be invalidated now, since p could have changed.
ASSERTM(env.item[p].is_valid(),
"idx: %d, qty: %hd, base: %d, sub: %d, spe: %d, col: %d, rnd: %d",
item.index(), item.quantity,
(int)item.base_type, (int)item.sub_type, item.special,
(int)item.get_colour(), (int)item.rnd);
return p;
}
void reroll_brand(item_def &item, int item_level)
{
ASSERT(!is_artefact(item));
switch (item.base_type)
{
case OBJ_WEAPONS:
item.brand = determine_weapon_brand(item, item_level);
break;
case OBJ_MISSILES:
item.brand = _determine_missile_brand(item, item_level);
break;
case OBJ_ARMOUR:
item.brand = _generate_armour_ego(item);
break;
default:
die("can't reroll brands of this type");
}
item_set_appearance(item);
}
static bool _weapon_is_visibly_special(const item_def &item)
{
const int brand = get_weapon_brand(item);
const bool visibly_branded = (brand != SPWPN_NORMAL);
if (get_equip_desc(item) != ISFLAG_NO_DESC)
return false;
if (visibly_branded || is_artefact(item) || item.plus > 0)
return true;
return false;
}
static bool _armour_is_visibly_special(const item_def &item)
{
const int brand = get_armour_ego_type(item);
const bool visibly_branded = (brand != SPARM_NORMAL);
if (get_equip_desc(item) != ISFLAG_NO_DESC)
return false;
if (visibly_branded || is_artefact(item) || item.plus > 0)
return true;
return false;
}
jewellery_type get_random_amulet_type()
{
static vector<jewellery_type> valid_types;
if (valid_types.empty())
for (int i = AMU_FIRST_AMULET; i < NUM_JEWELLERY; i++)
if (!item_type_removed(OBJ_JEWELLERY, (jewellery_type)i))
valid_types.push_back((jewellery_type)i);
return *random_iterator(valid_types);
}
static jewellery_type _get_raw_random_ring_type()
{
static vector<jewellery_type> valid_types;
if (valid_types.empty())
for (int i = RING_FIRST_RING; i < NUM_RINGS; i++)
if (!item_type_removed(OBJ_JEWELLERY, (jewellery_type)i))
valid_types.push_back((jewellery_type)i);
return *random_iterator(valid_types);
}
jewellery_type get_random_ring_type()
{
const jewellery_type j = _get_raw_random_ring_type();
// Adjusted distribution here. - bwr
if (j == RING_SLAYING && !one_chance_in(3))
return _get_raw_random_ring_type();
return j;
}
// Sets item appearance to match brands, if any.
void item_set_appearance(item_def &item)
{
// Artefact appearance overrides cosmetic flags anyway.
if (is_artefact(item))
return;
if (get_equip_desc(item) != ISFLAG_NO_DESC)
return;
switch (item.base_type)
{
case OBJ_WEAPONS:
if (_weapon_is_visibly_special(item))
set_equip_desc(item, random_choose(ISFLAG_GLOWING, ISFLAG_RUNED));
break;
case OBJ_ARMOUR:
if (_armour_is_visibly_special(item))
{
set_equip_desc(item, random_choose(ISFLAG_GLOWING, ISFLAG_RUNED,
ISFLAG_EMBROIDERED_SHINY));
}
break;
default:
break;
}
}
#if defined(DEBUG_DIAGNOSTICS) || defined(DEBUG_TESTS)
static int _test_item_level()
{
switch (random2(10))
{
case 0:
return ISPEC_GOOD_ITEM;
case 1:
return ISPEC_DAMAGED;
case 2:
return ISPEC_BAD;
case 3:
return ISPEC_RANDART;
default:
return random2(50);
}
}
void makeitem_tests()
{
int i, level;
item_def item;
mpr("Running generate_weapon_item tests.");
for (i = 0; i < 10000; ++i)
{
item.clear();
level = _test_item_level();
item.base_type = OBJ_WEAPONS;
item.brand = coinflip() ? SPWPN_NORMAL
: random2(NUM_REAL_SPECIAL_WEAPONS);
#if TAG_MAJOR_VERSION == 34
if (item.brand == SPWPN_ORC_SLAYING
|| item.brand == SPWPN_REACHING
|| item.brand == SPWPN_RETURNING
|| item.brand == SPWPN_CONFUSE
|| item.brand == SPWPN_DRAGON_SLAYING)
{
item.brand = SPWPN_FORBID_BRAND;
}
#endif
auto weap_type = coinflip() ? OBJ_RANDOM : random2(NUM_WEAPONS);
_generate_weapon_item(item,
coinflip(),
weap_type,
level);
}
mpr("Running generate_armour_item tests.");
for (i = 0; i < 10000; ++i)
{
item.clear();
level = _test_item_level();
item.base_type = OBJ_ARMOUR;
item.brand = coinflip() ? SPARM_NORMAL
: random2(NUM_REAL_SPECIAL_ARMOURS);
int type = coinflip() ? OBJ_RANDOM : random2(NUM_ARMOURS);
#if TAG_MAJOR_VERSION == 34
if (type == ARM_CAP)
type = ARM_HAT;
if (type == ARM_CENTAUR_BARDING)
type = ARM_BOOTS;
#endif
_generate_armour_item(item,
coinflip(),
type,
level);
}
}
#endif
|
; A184514: Lower s-Wythoff sequence, where s(n)=4n-1. Complement of A184515.
; 1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,19,21,22,23,24,26,27,28,29,31,32,33,34,36,37,38,39,40,42,43,44,45,47,48,49,50,52,53,54,55,57,58,59,60,61,63,64,65,66,68,69,70,71,73,74,75,76,78,79,80,81,83,84,85,86,87,89,90,91,92,94,95,96,97,99,100,101,102,104,105,106,107,108,110,111,112,113,115,116,117,118,120,121,122,123
mul $0,2
add $0,1
seq $0,184516 ; Lower s-Wythoff sequence, where s=4n-2. Complement of A184517.
div $0,2
|
; --------------------------------------
; Traffic Lights
; --------------------------------------
MOV AL, 80 ; 1000 0000
Loop:
OUT 01 ; Send data to traffic lights
ROR AL ; Rotate the bits in AL to the right
JMP Loop
; --------------------------------------
END
; --------------------------------------
For more examples, select File > Open Example.
|
; https://adventofcode.com/2020/day/1 (part 2)
OPT listoff : DEVICE ZXSPECTRUMNEXT : MMU 0 7, 0, $0000
valuesHit: ; byte table keeping notes about values hit in input
block 2020+1, 0
inputFile: ; load the input.txt into virtual device memory for processing
INCBIN "input.txt"
DB 10 ; fake <EOL> to make sure there's no digit as last char
inputEnd:
; init variables
inPtr = inputFile
number = -1
; parse the input (to mark each number in the table)
DUP (inputEnd - inputFile) ; read+process whole input file
inByte = {b inPtr}
inPtr = inPtr + 1
IF number < 0
; was outside of number, keep skipping bytes until new digit is found
IF '0' <= inByte && inByte <= '9'
number = inByte - '0' ; start of new number
ENDIF
ELSE
; was inside number, keep adding digits or process it
IF '0' <= inByte && inByte <= '9' ; another digit
number = 10*number + inByte - '0'
ELSE ; not a digit, mark the number
IF 0 <= number && number <= 2020 ; only these make sense
IF {b number} : DISPLAY "Number ",/D,number," found twice!" : ENDIF
ORG number : DB 1 ; mark it table, set more bits for repeated numbers
ENDIF
number = -1 ; start skipping of non-digit characters
ENDIF
ENDIF
EDUP
; do the two nested loops looking for triplets summing as 2020
num1 = 0
num2 = 0
num3 = 0
DUP 2020/3 + 1 ; num1 0..673 (looking for "num1 <= num2 <= num3" type of result)
IF {b num1}
num2 = num1
DUP ((2020-num1)/2) - num2 + 1 ; loop num2 = num1 .. (2020-num1)/2 ; to enforce num2 <= num3
IF {b num2}
num3 = 2020 - num1 - num2
ASSERT 0 <= num1 && num1 <= num2 && num2 <= num3 && num3 <= 2020
IF {b num3}
DISPLAY "Sum 2020: ",/D,num1," + ",/D,num2," + ",/D,num3," dot: ",/D,num1*num2*num3
ENDIF
ENDIF
num2 = num2 + 1
EDUP
ENDIF
num1 = num1 + 1
EDUP
|
; A295130: a(n) = 3*n*(64*n^2 + 1).
; 195,1542,5193,12300,24015,41490,65877,98328,139995,192030,255585,331812,421863,526890,648045,786480,943347,1119798,1316985,1536060,1778175,2044482,2336133,2654280,3000075,3374670,3779217,4214868,4682775,5184090,5719965,6291552,6900003,7546470,8232105,8958060,9725487,10535538,11389365,12288120,13232955,14225022,15265473,16355460,17496135,18688650,19934157,21233808,22588755,24000150,25469145,26996892,28584543,30233250,31944165,33718440,35557227,37461678,39432945,41472180,43580535,45759162,48009213,50331840,52728195,55199430,57746697,60371148,63073935,65856210,68719125,71663832,74691483,77803230,81000225,84283620,87654567,91114218,94663725,98304240,102036915,105862902,109783353,113799420,117912255,122123010,126432837,130842888,135354315,139968270,144685905,149508372,154436823,159472410,164616285,169869600,175233507,180709158,186297705,192000300
mov $1,$0
add $0,2
add $1,$0
mul $1,2
pow $1,3
add $1,$0
mov $0,$1
sub $0,1
mul $0,3
|
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2015 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef MAPNIK_TRANSFORM_PATH_ADAPTER_HPP
#define MAPNIK_TRANSFORM_PATH_ADAPTER_HPP
#include <mapnik/proj_transform.hpp>
#include <mapnik/vertex.hpp>
#include <mapnik/config.hpp>
#include <cstddef>
namespace mapnik {
template <typename Transform, typename Geometry>
struct transform_path_adapter
{
// SFINAE value_type detector
template <typename T>
struct void_type
{
using type = void;
};
template <typename T, typename D, typename _ = void>
struct select_value_type
{
using type = D;
};
template <typename T, typename D>
struct select_value_type<T, D, typename void_type<typename T::value_type>::type>
{
using type = typename T::value_type;
};
using size_type = std::size_t;
using value_type = typename select_value_type<Geometry, void>::type;
transform_path_adapter(Transform const& _t,
Geometry & _geom,
proj_transform const& prj_trans)
: t_(&_t),
geom_(_geom),
prj_trans_(&prj_trans) {}
explicit transform_path_adapter(Geometry & _geom)
: t_(0),
geom_(_geom),
prj_trans_(0) {}
void set_proj_trans(proj_transform const& prj_trans)
{
prj_trans_ = &prj_trans;
}
void set_trans(Transform const& t)
{
t_ = &t;
}
unsigned vertex(double *x, double *y) const
{
unsigned command;
bool ok = false;
bool skipped_points = false;
while (!ok)
{
command = geom_.vertex(x,y);
if (command == SEG_END)
{
return command;
}
double z=0;
ok = prj_trans_->backward(*x, *y, z);
if (!ok) {
skipped_points = true;
}
}
if (skipped_points && (command == SEG_LINETO))
{
command = SEG_MOVETO;
}
t_->forward(x,y);
return command;
}
void rewind(unsigned pos) const
{
geom_.rewind(pos);
}
unsigned type() const
{
return static_cast<unsigned>(geom_.type());
}
Geometry const& geom() const
{
return geom_;
}
private:
Transform const* t_;
Geometry & geom_;
proj_transform const* prj_trans_;
};
}
#endif // MAPNIK_TRANSFORM_PATH_ADAPTER_HPP
|
; A022109: Fibonacci sequence beginning 1, 19.
; 1,19,20,39,59,98,157,255,412,667,1079,1746,2825,4571,7396,11967,19363,31330,50693,82023,132716,214739,347455,562194,909649,1471843,2381492,3853335,6234827,10088162,16322989
mov $1,1
mov $3,18
lpb $0,1
sub $0,1
mov $2,$3
mov $3,$1
add $1,$2
lpe
|
; A047883: Squares on unbounded chessboard for which the least number of knight's moves from corner (0,0) is n.
; 0,2,9,20,27,32,39,46,53,60,67,74,81,88,95,102,109,116,123,130,137,144,151,158,165,172,179,186,193,200,207,214,221,228,235
mov $2,$0
mov $4,$0
mov $5,3
mov $6,4
lpb $2
lpb $6
add $1,2
mul $6,2
sub $6,3
sub $6,$2
add $6,1
lpe
add $3,3
lpb $5
sub $0,3
sub $5,$3
lpe
trn $0,$1
add $1,6
sub $2,1
trn $3,4
lpe
add $0,5
add $3,$0
trn $1,$3
lpb $4
add $1,1
sub $4,1
lpe
|
// Copyright (c) 2014-2017, The X12 Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "net/http_auth.h"
#include <array>
#include <boost/algorithm/string/find_iterator.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/fusion/adapted/std_tuple.hpp>
#include <boost/fusion/algorithm/iteration/for_each.hpp>
#include <boost/fusion/algorithm/iteration/iter_fold.hpp>
#include <boost/fusion/algorithm/query/any.hpp>
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/algorithm/find_if.hpp>
#include <boost/range/iterator_range_core.hpp>
#include <boost/range/join.hpp>
#include <boost/spirit/include/karma_generate.hpp>
#include <boost/spirit/include/karma_uint.hpp>
#include <boost/spirit/include/qi_alternative.hpp>
#include <boost/spirit/include/qi_and_predicate.hpp>
#include <boost/spirit/include/qi_char.hpp>
#include <boost/spirit/include/qi_char_class.hpp>
#include <boost/spirit/include/qi_difference.hpp>
#include <boost/spirit/include/qi_kleene.hpp>
#include <boost/spirit/include/qi_parse.hpp>
#include <boost/spirit/include/qi_plus.hpp>
#include <boost/spirit/include/qi_no_case.hpp>
#include <boost/spirit/include/qi_not_predicate.hpp>
#include <boost/spirit/include/qi_raw.hpp>
#include <boost/spirit/include/qi_rule.hpp>
#include <boost/spirit/include/qi_sequence.hpp>
#include <boost/spirit/include/qi_string.hpp>
#include <boost/spirit/include/qi_symbols.hpp>
#include <boost/spirit/include/qi_uint.hpp>
#include <cassert>
#include <iterator>
#include <limits>
#include <tuple>
#include <type_traits>
#include "crypto/crypto.h"
#include "hex.h"
#include "md5_l.h"
#include "string_coding.h"
/* This file uses the `u8` prefix and specifies all chars by ASCII numeric
value. This is for maximum portability - C++ does not actually specify ASCII
as the encoding type for unprefixed string literals, etc. Although rare, the
effort required to support rare compiler encoding types is low.
Also be careful of qi::ascii character classes (`qi::asci::alpha`, etc.) -
non-ASCII characters will cause undefined behavior in the table lookup until
boost 1.60. The expression `&qi::ascii::char_` will fail on non-ASCII
characters without "consuming" the input character. */
namespace
{
namespace http = epee::net_utils::http;
// string_ref is only constexpr if length is given
template<std::size_t N>
constexpr boost::string_ref ceref(const char (&arg)[N])
{
return boost::string_ref(arg, N - 1);
}
constexpr const auto client_auth_field = ceref(u8"Authorization");
constexpr const auto server_auth_field = ceref(u8"WWW-authenticate");
constexpr const auto auth_realm = ceref(u8"x12-rpc");
constexpr const char comma = 44;
constexpr const char equal_sign = 61;
constexpr const char quote = 34;
constexpr const char zero = 48;
constexpr const auto sess_algo = ceref(u8"-sess");
constexpr const unsigned client_reserve_size = 512; //!< std::string::reserve size for clients
//// Digest Algorithms
struct md5_
{
static constexpr const boost::string_ref name = ceref(u8"MD5");
struct update
{
template<typename T>
void operator()(const T& arg) const
{
const boost::iterator_range<const char*> data(boost::as_literal(arg));
md5::MD5Update(
std::addressof(ctx),
reinterpret_cast<const std::uint8_t*>(data.begin()),
data.size()
);
}
void operator()(const std::string& arg) const
{
(*this)(boost::string_ref(arg));
}
md5::MD5_CTX& ctx;
};
template<typename... T>
std::array<char, 32> operator()(const T&... args) const
{
md5::MD5_CTX ctx{};
md5::MD5Init(std::addressof(ctx));
boost::fusion::for_each(std::tie(args...), update{ctx});
std::array<std::uint8_t, 16> digest{{}};
md5::MD5Final(digest.data(), std::addressof(ctx));
return epee::to_hex::array(digest);
}
};
constexpr const boost::string_ref md5_::name;
//! Digest Algorithms available for HTTP Digest Auth. Sort better algos to the left
constexpr const std::tuple<md5_> digest_algorithms{};
//// Various String Utilities
struct ascii_tolower_
{
template<typename Char>
constexpr Char operator()(Char value) const noexcept
{
static_assert(std::is_integral<Char>::value, "only integral types supported");
return (65 <= value && value <= 90) ? (value + 32) : value;
}
};
constexpr const ascii_tolower_ ascii_tolower{};
struct ascii_iequal_
{
template<typename Char>
constexpr bool operator()(Char left, Char right) const noexcept
{
return ascii_tolower(left) == ascii_tolower(right);
}
};
constexpr const ascii_iequal_ ascii_iequal{};
struct http_list_separator_
{
template<typename Char>
bool operator()(Char value) const noexcept
{
static_assert(std::is_integral<Char>::value, "only integral types supported");
return boost::spirit::char_encoding::ascii::isascii_(value) &&
(value == comma || boost::spirit::char_encoding::ascii::isspace(value));
}
};
constexpr const http_list_separator_ http_list_separator{};
std::string to_string(boost::iterator_range<const char*> source)
{
return {source.begin(), source.size()};
}
template<typename T>
void add_first_field(std::string& str, const char* const name, const T& value)
{
str.append(name);
str.push_back(equal_sign);
boost::copy(value, std::back_inserter(str));
}
template<typename T>
void add_field(std::string& str, const char* const name, const T& value)
{
str.push_back(comma);
add_first_field(str, name, value);
}
template<typename T>
using quoted_result = boost::joined_range<
const boost::joined_range<const boost::string_ref, const T>, const boost::string_ref
>;
template<typename T>
quoted_result<T> quoted(const T& arg)
{
return boost::range::join(boost::range::join(ceref(u8"\""), arg), ceref(u8"\""));
}
//// Digest Authentication
template<typename Digest>
typename std::result_of<Digest()>::type generate_a1(
Digest digest, const http::login& creds, const boost::string_ref realm)
{
return digest(creds.username, u8":", realm, u8":", creds.password);
}
template<typename Digest>
typename std::result_of<Digest()>::type generate_a1(
Digest digest, const http::http_client_auth::session& user)
{
return generate_a1(std::move(digest), user.credentials, user.server.realm);
}
template<typename T>
void init_client_value(std::string& str,
const boost::string_ref algorithm, const http::http_client_auth::session& user,
const boost::string_ref uri, const T& response)
{
str.append(u8"Digest ");
add_first_field(str, u8"algorithm", algorithm);
add_field(str, u8"nonce", quoted(user.server.nonce));
add_field(str, u8"realm", quoted(user.server.realm));
add_field(str, u8"response", quoted(response));
add_field(str, u8"uri", quoted(uri));
add_field(str, u8"username", quoted(user.credentials.username));
if (!user.server.opaque.empty())
add_field(str, u8"opaque", quoted(user.server.opaque));
}
//! Implements superseded algorithm specified in RFC 2069
template<typename Digest>
struct old_algorithm
{
explicit old_algorithm(Digest digest_) : digest(std::move(digest_)) {}
std::string operator()(const http::http_client_auth::session& user,
const boost::string_ref method, const boost::string_ref uri) const
{
const auto response = digest(
generate_a1(digest, user), u8":", user.server.nonce, u8":", digest(method, u8":", uri)
);
std::string out{};
out.reserve(client_reserve_size);
init_client_value(out, Digest::name, user, uri, response);
return out;
}
private:
Digest digest;
};
//! Implements the `qop=auth` algorithm specified in RFC 2617
template<typename Digest>
struct auth_algorithm
{
explicit auth_algorithm(Digest digest_) : digest(std::move(digest_)) {}
std::string operator()(const http::http_client_auth::session& user,
const boost::string_ref method, const boost::string_ref uri) const
{
namespace karma = boost::spirit::karma;
using counter_type = decltype(user.counter);
static_assert(
std::numeric_limits<counter_type>::radix == 2, "unexpected radix for counter"
);
static_assert(
std::numeric_limits<counter_type>::digits <= 32,
"number of digits will cause underflow on padding below"
);
std::string out{};
out.reserve(client_reserve_size);
karma::generate(std::back_inserter(out), karma::hex(user.counter));
out.insert(out.begin(), 8 - out.size(), zero); // zero left pad
if (out.size() != 8)
return {};
std::array<char, 8> nc{{}};
boost::copy(out, nc.data());
const auto response = digest(
generate_a1(digest, user), u8":", user.server.nonce, u8":", nc, u8"::auth:", digest(method, u8":", uri)
);
out.clear();
init_client_value(out, Digest::name, user, uri, response);
add_field(out, u8"qop", ceref(u8"auth"));
add_field(out, u8"nc", nc);
return out;
}
private:
Digest digest;
};
//! Processes client "Authorization" and server "WWW-authenticate" HTTP fields
struct auth_message
{
using iterator = const char*;
enum status{ kFail = 0, kStale, kPass };
//! \return Status of the `response` field from the client
static status verify(const boost::string_ref method, const boost::string_ref request,
const http::http_server_auth::session& user)
{
const auto parsed = parse(request);
if (parsed &&
boost::equals(parsed->username, user.credentials.username) &&
boost::fusion::any(digest_algorithms, has_valid_response{*parsed, user, method}))
{
if (boost::equals(parsed->nonce, user.nonce))
{
// RFC 2069 format does not verify nc value - allow just once
if (user.counter == 1 || (!parsed->qop.empty() && parsed->counter() == user.counter))
{
return kPass;
}
}
return kStale;
}
return kFail;
}
//! \return Information needed to generate client authentication `response`s.
static http::http_client_auth::session::keys extract(
const http::http_response_info& response, const bool is_first)
{
using field = std::pair<std::string, std::string>;
server_parameters best{};
const std::list<field>& fields = response.m_header_info.m_etc_fields;
auto current = fields.begin();
const auto end = fields.end();
while (true)
{
current = std::find_if(current, end, [] (const field& value) {
return boost::equals(server_auth_field, value.first, ascii_iequal);
});
if (current == end)
break;
const auto parsed = parse(current->second);
if (parsed)
{
server_parameters local_best = parsed->algorithm.empty() ?
server_parameters{*parsed, boost::fusion::find<md5_>(digest_algorithms)} :
boost::fusion::iter_fold(digest_algorithms, server_parameters{}, matches_algorithm{*parsed});
if (local_best.index < best.index)
best = std::move(local_best);
}
++current;
}
if (is_first || boost::equals(best.stale, ceref(u8"true"), ascii_iequal))
return best.take();
return {}; // authentication failed with bad user/pass
}
private:
explicit auth_message()
: algorithm()
, cnonce()
, nc()
, nonce()
, qop()
, realm()
, response()
, stale()
, uri()
, username() {
}
static boost::optional<auth_message> parse(const boost::string_ref request)
{
struct parser
{
using field_parser = std::function<bool(const parser&, iterator&, iterator, auth_message&)>;
explicit parser() : field_table(), skip_whitespace(), header(), quoted_string(), token(), fields() {
using namespace std::placeholders;
namespace qi = boost::spirit::qi;
struct parse_nc
{
bool operator()(const parser&, iterator& current, const iterator end, auth_message& result) const
{
return qi::parse(
current, end,
(qi::raw[qi::uint_parser<std::uint32_t, 16, 8, 8>{}]),
result.nc
);
}
};
struct parse_token
{
bool operator()(const parser& parse, iterator& current, const iterator end,
boost::iterator_range<iterator>& result) const
{
return qi::parse(current, end, parse.token, result);
}
};
struct parse_string
{
bool operator()(const parser& parse, iterator& current, const iterator end,
boost::iterator_range<iterator>& result) const
{
return qi::parse(current, end, parse.quoted_string, result);
}
bool operator()(const parser& parse, iterator& current, const iterator end) const
{
return qi::parse(current, end, parse.quoted_string);
}
};
struct parse_response
{
bool operator()(const parser&, iterator& current, const iterator end, auth_message& result) const
{
using byte = qi::uint_parser<std::uint8_t, 16, 2, 2>;
return qi::parse(
current, end,
(qi::lit(quote) >> qi::raw[+(byte{})] >> qi::lit(quote)),
result.response
);
}
};
field_table.add
(u8"algorithm", std::bind(parse_token{}, _1, _2, _3, std::bind(&auth_message::algorithm, _4)))
(u8"cnonce", std::bind(parse_string{}, _1, _2, _3, std::bind(&auth_message::cnonce, _4)))
(u8"domain", std::bind(parse_string{}, _1, _2, _3)) // ignore field
(u8"nc", parse_nc{})
(u8"nonce", std::bind(parse_string{}, _1, _2, _3, std::bind(&auth_message::nonce, _4)))
(u8"opaque", std::bind(parse_string{}, _1, _2, _3, std::bind(&auth_message::opaque, _4)))
(u8"qop", std::bind(parse_token{}, _1, _2, _3, std::bind(&auth_message::qop, _4)))
(u8"realm", std::bind(parse_string{}, _1, _2, _3, std::bind(&auth_message::realm, _4)))
(u8"response", parse_response{})
(u8"stale", std::bind(parse_token{}, _1, _2, _3, std::bind(&auth_message::stale, _4)))
(u8"uri", std::bind(parse_string{}, _1, _2, _3, std::bind(&auth_message::uri, _4)))
(u8"username", std::bind(parse_string{}, _1, _2, _3, std::bind(&auth_message::username, _4)));
skip_whitespace = *(&qi::ascii::char_ >> qi::ascii::space);
header = skip_whitespace >> qi::ascii::no_case[u8"digest"] >> skip_whitespace;
quoted_string = (qi::lit(quote) >> qi::raw[+(u8"\\\"" | (qi::ascii::char_ - quote))] >> qi::lit(quote));
token =
(!qi::lit(quote) >> qi::raw[+(&qi::ascii::char_ >> (qi::ascii::graph - qi::ascii::char_(u8"()<>@,;:\\\"/[]?={}")))]) |
quoted_string;
fields = field_table >> skip_whitespace >> equal_sign >> skip_whitespace;
}
boost::optional<auth_message> operator()(const boost::string_ref request) const
{
namespace qi = boost::spirit::qi;
iterator current = request.begin();
const iterator end = request.end();
if (!qi::parse(current, end, header))
{
return boost::none;
}
auth_message info{};
field_parser null_parser{};
std::reference_wrapper<const field_parser> field = null_parser;
do // require at least one field; require field after `,` character
{
if (!qi::parse(current, end, fields, field) || !field(*this, current, end, info))
{
return boost::none;
}
qi::parse(current, end, skip_whitespace);
} while (qi::parse(current, end, qi::char_(comma) >> skip_whitespace));
return boost::make_optional(current == end, info);
}
private:
boost::spirit::qi::symbols<
char, field_parser, boost::spirit::qi::tst<char, field_parser>, ascii_tolower_
> field_table;
boost::spirit::qi::rule<iterator> skip_whitespace;
boost::spirit::qi::rule<iterator> header;
boost::spirit::qi::rule<iterator, boost::iterator_range<iterator>()> quoted_string;
boost::spirit::qi::rule<iterator, boost::iterator_range<iterator>()> token;
boost::spirit::qi::rule<iterator, std::reference_wrapper<const field_parser>()> fields;
}; // parser
static const parser parse_;
return parse_(request);
}
struct has_valid_response
{
template<typename Digest, typename Result>
Result generate_old_response(Digest digest, const Result& key, const Result& auth) const
{
return digest(key, u8":", request.nonce, u8":", auth);
}
template<typename Digest, typename Result>
Result generate_new_response(Digest digest, const Result& key, const Result& auth) const
{
return digest(
key, u8":", request.nonce, u8":", request.nc, u8":", request.cnonce, u8":", request.qop, u8":", auth
);
}
template<typename Result>
bool check(const Result& result) const
{
return boost::equals(request.response, result, ascii_iequal);
}
template<typename Digest>
bool operator()(const Digest& digest) const
{
if (boost::starts_with(request.algorithm, Digest::name, ascii_iequal) ||
(request.algorithm.empty() && std::is_same<md5_, Digest>::value))
{
auto key = generate_a1(digest, user.credentials, auth_realm);
if (boost::ends_with(request.algorithm, sess_algo, ascii_iequal))
{
key = digest(key, u8":", request.nonce, u8":", request.cnonce);
}
auto auth = digest(method, u8":", request.uri);
if (request.qop.empty())
{
return check(generate_old_response(std::move(digest), std::move(key), std::move(auth)));
}
else if (boost::equals(ceref(u8"auth"), request.qop, ascii_iequal))
{
return check(generate_new_response(std::move(digest), std::move(key), std::move(auth)));
}
}
return false;
}
const auth_message& request;
const http::http_server_auth::session& user;
const boost::string_ref method;
};
boost::optional<std::uint32_t> counter() const
{
namespace qi = boost::spirit::qi;
using hex = qi::uint_parser<std::uint32_t, 16>;
std::uint32_t value = 0;
const bool converted = qi::parse(nc.begin(), nc.end(), hex{}, value);
return boost::make_optional(converted, value);
}
struct server_parameters
{
server_parameters()
: nonce(), opaque(), realm(), stale(), value_generator()
, index(boost::fusion::size(digest_algorithms))
{}
template<typename DigestIter>
explicit server_parameters(const auth_message& request, const DigestIter& digest)
: nonce(request.nonce)
, opaque(request.opaque)
, stale(request.stale)
, realm(request.realm)
, value_generator()
, index(boost::fusion::distance(boost::fusion::begin(digest_algorithms), digest))
{
using digest_type = typename boost::fusion::result_of::value_of<DigestIter>::type;
// debug check internal state of the auth_message class
assert(
(std::is_same<digest_type, md5_>::value) ||
boost::equals((*digest).name, request.algorithm, ascii_iequal)
);
if (request.qop.empty())
value_generator = old_algorithm<digest_type>{*digest};
else
{
for (auto elem = boost::make_split_iterator(request.qop, boost::token_finder(http_list_separator));
!elem.eof();
++elem)
{
if (boost::equals(ceref(u8"auth"), *elem, ascii_iequal))
{
value_generator = auth_algorithm<digest_type>{*digest};
break;
}
}
if (!value_generator) // no supported qop mode
index = boost::fusion::size(digest_algorithms);
}
}
http::http_client_auth::session::keys take()
{
return {to_string(nonce), to_string(opaque), to_string(realm), std::move(value_generator)};
}
boost::iterator_range<iterator> nonce;
boost::iterator_range<iterator> opaque;
boost::iterator_range<iterator> realm;
boost::iterator_range<iterator> stale;
http::http_client_auth::session::keys::algorithm value_generator;
unsigned index;
};
struct matches_algorithm
{
template<typename DigestIter>
server_parameters operator()(server_parameters current, const DigestIter& digest) const
{
if (!current.value_generator)
{
if (boost::equals(response.algorithm, (*digest).name, ascii_iequal))
{
current = server_parameters{response, digest};
}
}
return current;
}
const auth_message& response;
};
boost::iterator_range<iterator> algorithm;
boost::iterator_range<iterator> cnonce;
boost::iterator_range<iterator> nc;
boost::iterator_range<iterator> nonce;
boost::iterator_range<iterator> opaque;
boost::iterator_range<iterator> qop;
boost::iterator_range<iterator> realm;
boost::iterator_range<iterator> response;
boost::iterator_range<iterator> stale;
boost::iterator_range<iterator> uri;
boost::iterator_range<iterator> username;
}; // auth_message
struct add_challenge
{
template<typename Digest>
void operator()(const Digest& digest) const
{
static constexpr const auto fvalue = ceref(u8"Digest qop=\"auth\"");
for (unsigned i = 0; i < 2; ++i)
{
std::string out(fvalue);
const auto algorithm = boost::range::join(
Digest::name, (i == 0 ? boost::string_ref{} : sess_algo)
);
add_field(out, u8"algorithm", algorithm);
add_field(out, u8"realm", quoted(auth_realm));
add_field(out, u8"nonce", quoted(nonce));
add_field(out, u8"stale", is_stale ? ceref("true") : ceref("false"));
fields.push_back(std::make_pair(std::string(server_auth_field), std::move(out)));
}
}
const boost::string_ref nonce;
std::list<std::pair<std::string, std::string>>& fields;
const bool is_stale;
};
http::http_response_info create_digest_response(const boost::string_ref nonce, const bool is_stale)
{
epee::net_utils::http::http_response_info rc{};
rc.m_response_code = 401;
rc.m_response_comment = u8"Unauthorized";
rc.m_mime_tipe = u8"text/html";
rc.m_body =
u8"<html><head><title>Unauthorized Access</title></head><body><h1>401 Unauthorized</h1></body></html>";
boost::fusion::for_each(
digest_algorithms, add_challenge{nonce, rc.m_additional_fields, is_stale}
);
return rc;
}
}
namespace epee
{
namespace net_utils
{
namespace http
{
http_server_auth::http_server_auth(login credentials)
: user(session{std::move(credentials)}) {
}
boost::optional<http_response_info> http_server_auth::do_get_response(const http_request_info& request)
{
assert(user);
using field = std::pair<std::string, std::string>;
const std::list<field>& fields = request.m_header_info.m_etc_fields;
const auto auth = boost::find_if(fields, [] (const field& value) {
return boost::equals(client_auth_field, value.first, ascii_iequal);
});
bool is_stale = false;
if (auth != fields.end())
{
++(user->counter);
switch (auth_message::verify(request.m_http_method_str, auth->second, *user))
{
case auth_message::kPass:
return boost::none;
case auth_message::kStale:
is_stale = true;
break;
default:
case auth_message::kFail:
break;
}
}
user->counter = 0;
{
std::array<std::uint8_t, 16> rand_128bit{{}};
crypto::rand(rand_128bit.size(), rand_128bit.data());
user->nonce = string_encoding::base64_encode(rand_128bit.data(), rand_128bit.size());
}
return create_digest_response(user->nonce, is_stale);
}
http_client_auth::http_client_auth(login credentials)
: user(session{std::move(credentials)}) {
}
http_client_auth::status http_client_auth::do_handle_401(const http_response_info& response)
{
assert(user);
const bool first_auth = (user->counter == 0);
user->server = auth_message::extract(response, first_auth);
if (user->server.generator)
{
user->counter = 0;
return kSuccess;
}
return first_auth ? kParseFailure : kBadPassword;
}
boost::optional<std::pair<std::string, std::string>> http_client_auth::do_get_auth_field(
const boost::string_ref method, const boost::string_ref uri)
{
assert(user);
if (user->server.generator)
{
++(user->counter);
return std::make_pair(std::string(client_auth_field), user->server.generator(*user, method, uri));
}
return boost::none;
}
}
}
}
|
; A070344: a(n) = 3^n mod 29.
; 1,3,9,27,23,11,4,12,7,21,5,15,16,19,28,26,20,2,6,18,25,17,22,8,24,14,13,10,1,3,9,27,23,11,4,12,7,21,5,15,16,19,28,26,20,2,6,18,25,17,22,8,24,14,13,10,1,3,9,27,23,11,4,12,7,21,5,15,16,19,28,26,20,2,6,18,25,17,22,8,24,14,13,10,1,3,9,27,23,11,4,12,7,21,5,15,16,19,28,26,20,2,6,18,25,17,22,8,24,14,13,10,1,3,9,27,23,11,4,12,7,21,5,15,16,19,28,26,20,2,6,18,25,17,22,8,24,14,13,10,1,3,9,27,23,11,4,12,7,21,5,15,16,19,28,26,20,2,6,18,25,17,22,8,24,14,13,10,1,3,9,27,23,11,4,12,7,21,5,15,16,19,28,26,20,2,6,18,25,17,22,8,24,14,13,10,1,3,9,27,23,11,4,12,7,21,5,15,16,19,28,26,20,2,6,18,25,17,22,8,24,14,13,10,1,3,9,27,23,11,4,12,7,21,5,15,16,19,28,26,20,2,6,18,25,17,22,8,24,14
mov $1,1
mov $2,$0
lpb $2,1
mul $1,3
mod $1,29
sub $2,1
lpe
|
title "Processor Type and Stepping Detection"
;++
;
; Copyright (c) 2000 Microsoft Corporation
;
; Module Name:
;
; cpu.asm
;
; Abstract:
;
; This module implements the code necessary to determine cpu information.
;
; Author:
;
; David N. Cutler (davec) 10-Jun-2000
;
; Environment:
;
; Kernel mode only.
;
;--
include ksamd64.inc
;++
;
; VOID
; KiCpuId (
; ULONG Function,
; PCPU_INFO CpuInfo
; );
;
; Routine Description:
;
; Executes the cpuid instruction and returns the resultant register
; values.
;
; Arguments:
;
; ecx - Supplies the cpuid function value.
;
; rdx - Supplies the address a cpu information structure.
;
; Return Value:
;
; The return values from the cpuid instruction are stored in the specified
; cpu infomation structure.
;
;--
NESTED_ENTRY KiCpuId, _TEXT$00
push_reg rbx ; save nonvolatile register
END_PROLOGUE
mov eax, ecx ; set cpuid function
mov r9, rdx ; save information structure address
cpuid ; get cpu information
mov CpuEax[r9], eax ; save cpu information in structure
mov CpuEbx[r9], ebx ;
mov CpuEcx[r9], ecx ;
mov CpuEdx[r9], edx ;
pop rbx ; restore nonvolatile registeer
ret ; return
NESTED_END KiCpuId, _TEXT$00
end
|
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "HugeCTR/include/optimizers/nesterov_optimizer.hpp"
#include "HugeCTR/include/general_buffer2.hpp"
#include "gtest/gtest.h"
#include "utest/test_utils.h"
using namespace std;
using namespace HugeCTR;
namespace {
class NesterovCPU {
public:
NesterovCPU(int len, float* w, const float* g, const __half* g_half, bool mixed_precision,
float lr, float mu)
: w_(w),
g_(g),
g_half_(g_half),
len_(len),
mixed_precision_(mixed_precision),
lr_(lr),
mu_(mu) {
if (mixed_precision) {
accum_half_.resize(len);
} else {
accum_.resize(len);
}
}
void update() {
int scaler = 1;
#ifdef SCALE_128
scaler = 128;
#elif SCALE_256
scaler = 256;
#elif SCALE_512
scaler = 512;
#elif SCALE_1024
scaler = 1024;
#else
scaler = 1;
#endif
for (int i = 0; i < len_; ++i) {
if (mixed_precision_) {
float accum_old = __half2float(accum_half_[i]);
float accum_new = mu_ * accum_old - lr_ * __half2float(g_half_[i]) / scaler;
accum_half_[i] = __float2half(accum_new);
w_[i] += (-mu_ * accum_old + (1 + mu_) * accum_new);
} else {
float accum_old = accum_[i];
float accum_new = mu_ * accum_old - lr_ * g_[i] / scaler;
accum_[i] = accum_new;
w_[i] += (-mu_ * accum_old + (1 + mu_) * accum_new);
}
}
}
private:
float* w_;
const float* g_;
const __half* g_half_;
vector<float> accum_;
vector<__half> accum_half_;
const int len_;
const bool mixed_precision_;
const float lr_;
const float mu_;
};
void compare_array(const float* a, const float* b, int len, float eps) {
for (int i = 0; i < len; ++i) {
ASSERT_NEAR(a[i], b[i], eps) << "array differ at index " << i;
}
}
void nesterov_test(size_t len, int num_update, bool mixed_precision) {
std::shared_ptr<GeneralBuffer2<CudaAllocator>> buff = GeneralBuffer2<CudaAllocator>::create();
Tensor2<float> weight;
buff->reserve({len}, &weight);
Tensor2<float> wgrad;
buff->reserve({len}, &wgrad);
Tensor2<__half> wgrad_half;
buff->reserve({len}, &wgrad_half);
std::shared_ptr<BufferBlock2<float>> opt_buff = buff->create_block<float>();
std::shared_ptr<BufferBlock2<__half>> opt_buff_half = buff->create_block<__half>();
NesterovOptimizer nesterov(weight, wgrad, wgrad_half, mixed_precision, opt_buff, opt_buff_half,
test::get_default_gpu(), 0.01, 0.9);
buff->allocate();
nesterov.initialize();
std::unique_ptr<float[]> h_weight(new float[len]);
std::unique_ptr<float[]> h_wgrad(new float[len]);
std::unique_ptr<__half[]> h_wgrad_half(new __half[len]);
std::unique_ptr<float[]> h_weight_expected(new float[len]);
float* d_weight = weight.get_ptr();
float* d_wgrad = wgrad.get_ptr();
__half* d_wgrad_half = wgrad_half.get_ptr();
test::GaussianDataSimulator simulator(0.0f, 1.0f);
simulator.fill(h_weight.get(), len);
for (size_t i = 0; i < len; ++i) {
h_weight_expected[i] = h_weight[i];
}
cudaMemcpy(d_weight, h_weight.get(), len * sizeof(float), cudaMemcpyHostToDevice);
NesterovCPU nesterov_cpu(len, h_weight_expected.get(), h_wgrad.get(), h_wgrad_half.get(),
mixed_precision, 0.01, 0.9);
for (int i = 0; i < num_update; ++i) {
simulator.fill(h_wgrad.get(), len);
for (size_t i = 0; i < len; ++i) {
if (mixed_precision) {
h_wgrad_half[i] = __float2half(h_wgrad[i]);
}
}
if (mixed_precision) {
cudaMemcpy(d_wgrad_half, h_wgrad_half.get(), len * sizeof(__half), cudaMemcpyHostToDevice);
} else {
cudaMemcpy(d_wgrad, h_wgrad.get(), len * sizeof(float), cudaMemcpyHostToDevice);
}
nesterov.update();
nesterov_cpu.update();
}
cudaMemcpy(h_weight.get(), d_weight, len * sizeof(float), cudaMemcpyDeviceToHost);
if (mixed_precision) {
compare_array(h_weight.get(), h_weight_expected.get(), len, 1e-3);
} else {
compare_array(h_weight.get(), h_weight_expected.get(), len, 1e-6);
}
}
} // namespace
TEST(nesterov, fp32_nesterov) {
nesterov_test(1024, 5, false);
nesterov_test(10240, 5, false);
}
TEST(nesterov, fp16_nesterov) {
nesterov_test(1024, 5, true);
nesterov_test(10240, 5, true);
}
|
<%
import collections
import pwnlib.abi
import pwnlib.constants
import pwnlib.shellcraft
import six
%>
<%docstring>adjtimex(ntx) -> str
Invokes the syscall adjtimex.
See 'man 2 adjtimex' for more information.
Arguments:
ntx(timex*): ntx
Returns:
int
</%docstring>
<%page args="ntx=0"/>
<%
abi = pwnlib.abi.ABI.syscall()
stack = abi.stack
regs = abi.register_arguments[1:]
allregs = pwnlib.shellcraft.registers.current()
can_pushstr = []
can_pushstr_array = []
argument_names = ['ntx']
argument_values = [ntx]
# Load all of the arguments into their destination registers / stack slots.
register_arguments = dict()
stack_arguments = collections.OrderedDict()
string_arguments = dict()
dict_arguments = dict()
array_arguments = dict()
syscall_repr = []
for name, arg in zip(argument_names, argument_values):
if arg is not None:
syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False)))
# If the argument itself (input) is a register...
if arg in allregs:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[index] = arg
# The argument is not a register. It is a string value, and we
# are expecting a string value
elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)):
if isinstance(arg, six.text_type):
arg = arg.encode('utf-8')
string_arguments[name] = arg
# The argument is not a register. It is a dictionary, and we are
# expecting K:V paris.
elif name in can_pushstr_array and isinstance(arg, dict):
array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()]
# The arguent is not a register. It is a list, and we are expecting
# a list of arguments.
elif name in can_pushstr_array and isinstance(arg, (list, tuple)):
array_arguments[name] = arg
# The argument is not a register, string, dict, or list.
# It could be a constant string ('O_RDONLY') for an integer argument,
# an actual integer value, or a constant.
else:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[target] = arg
# Some syscalls have different names on various architectures.
# Determine which syscall number to use for the current architecture.
for syscall in ['SYS_adjtimex']:
if hasattr(pwnlib.constants, syscall):
break
else:
raise Exception("Could not locate any syscalls: %r" % syscalls)
%>
/* adjtimex(${', '.join(syscall_repr)}) */
%for name, arg in string_arguments.items():
${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))}
${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)}
%endfor
%for name, arg in array_arguments.items():
${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)}
%endfor
%for name, arg in stack_arguments.items():
${pwnlib.shellcraft.push(arg)}
%endfor
${pwnlib.shellcraft.setregs(register_arguments)}
${pwnlib.shellcraft.syscall(syscall)}
|
; A001826: Number of divisors of n of form 4k+1.
; 1,1,1,1,2,1,1,1,2,2,1,1,2,1,2,1,2,2,1,2,2,1,1,1,3,2,2,1,2,2,1,1,2,2,2,2,2,1,2,2,2,2,1,1,4,1,1,1,2,3,2,2,2,2,2,1,2,2,1,2,2,1,3,1,4,2,1,2,2,2,1,2,2,2,3,1,2,2,1,2,3,2,1,2,4,1,2,1,2,4,2,1,2,1,2,1,2,2,3,3
mov $4,2
mov $6,$0
lpb $4
mov $0,$6
mov $3,0
sub $4,1
add $0,$4
sub $0,1
mov $5,0
lpb $0
mov $7,$0
sub $0,1
add $3,4
div $7,$3
add $5,$7
lpe
mov $2,$4
mov $7,$5
lpb $2
mov $1,$7
sub $2,1
lpe
lpe
lpb $6
sub $1,$7
mov $6,0
lpe
add $1,1
mov $0,$1
|
//
// Created by nova on 8/29/20.
//
int main(int argc, char* args[])
{
Acme::API acmeAPI(configs);
std::tuple<std::string, std::string, std::string> certsAndPrivateKey;
try {
certsAndPrivateKey = acmeAPI.issueCertificate();
} catch (Acme::IssueCertificateFailed& e) { exit(1); }
auto[endEntityCertPEM, issuerCertPEM, privateKeyPKCS8] = certsAndPrivateKey;
Certification cert;
cert.update(endEntityCertPEM, issuerCertPEM, privateKeyPKCS8);
cert.toFile("/home/nova/Data/Github/acmecat/devres/new_certs");
} |
// AUTO GENERATED by vnxcppcodegen
#include <mmx/contract/Data.hxx>
#include <mmx/contract/Data_calc_cost.hxx>
#include <mmx/contract/Data_calc_cost_return.hxx>
#include <mmx/contract/Data_calc_hash.hxx>
#include <mmx/contract/Data_calc_hash_return.hxx>
#include <mmx/contract/Data_get_dependency.hxx>
#include <mmx/contract/Data_get_dependency_return.hxx>
#include <mmx/contract/Data_get_owner.hxx>
#include <mmx/contract/Data_get_owner_return.hxx>
#include <mmx/contract/Data_get_parties.hxx>
#include <mmx/contract/Data_get_parties_return.hxx>
#include <mmx/contract/Data_set.hxx>
#include <mmx/contract/Data_set_return.hxx>
#include <mmx/contract/Data_transfer.hxx>
#include <mmx/contract/Data_transfer_return.hxx>
#include <mmx/contract/Data_validate.hxx>
#include <mmx/contract/Data_validate_return.hxx>
#include <mmx/contract/DataArray.hxx>
#include <mmx/contract/DataArray_append.hxx>
#include <mmx/contract/DataArray_append_return.hxx>
#include <mmx/contract/DataArray_calc_cost.hxx>
#include <mmx/contract/DataArray_calc_cost_return.hxx>
#include <mmx/contract/DataArray_calc_hash.hxx>
#include <mmx/contract/DataArray_calc_hash_return.hxx>
#include <mmx/contract/DataArray_clear.hxx>
#include <mmx/contract/DataArray_clear_return.hxx>
#include <mmx/contract/DataArray_get_dependency.hxx>
#include <mmx/contract/DataArray_get_dependency_return.hxx>
#include <mmx/contract/DataArray_get_owner.hxx>
#include <mmx/contract/DataArray_get_owner_return.hxx>
#include <mmx/contract/DataArray_get_parties.hxx>
#include <mmx/contract/DataArray_get_parties_return.hxx>
#include <mmx/contract/DataArray_is_valid.hxx>
#include <mmx/contract/DataArray_is_valid_return.hxx>
#include <mmx/contract/DataArray_num_bytes.hxx>
#include <mmx/contract/DataArray_num_bytes_return.hxx>
#include <mmx/contract/DataArray_transfer.hxx>
#include <mmx/contract/DataArray_transfer_return.hxx>
#include <mmx/contract/DataArray_validate.hxx>
#include <mmx/contract/DataArray_validate_return.hxx>
#include <mmx/contract/DataObject.hxx>
#include <mmx/contract/DataObject_calc_cost.hxx>
#include <mmx/contract/DataObject_calc_cost_return.hxx>
#include <mmx/contract/DataObject_calc_hash.hxx>
#include <mmx/contract/DataObject_calc_hash_return.hxx>
#include <mmx/contract/DataObject_clear.hxx>
#include <mmx/contract/DataObject_clear_return.hxx>
#include <mmx/contract/DataObject_erase.hxx>
#include <mmx/contract/DataObject_erase_return.hxx>
#include <mmx/contract/DataObject_get_dependency.hxx>
#include <mmx/contract/DataObject_get_dependency_return.hxx>
#include <mmx/contract/DataObject_get_owner.hxx>
#include <mmx/contract/DataObject_get_owner_return.hxx>
#include <mmx/contract/DataObject_get_parties.hxx>
#include <mmx/contract/DataObject_get_parties_return.hxx>
#include <mmx/contract/DataObject_is_valid.hxx>
#include <mmx/contract/DataObject_is_valid_return.hxx>
#include <mmx/contract/DataObject_num_bytes.hxx>
#include <mmx/contract/DataObject_num_bytes_return.hxx>
#include <mmx/contract/DataObject_set.hxx>
#include <mmx/contract/DataObject_set_return.hxx>
#include <mmx/contract/DataObject_transfer.hxx>
#include <mmx/contract/DataObject_transfer_return.hxx>
#include <mmx/contract/DataObject_validate.hxx>
#include <mmx/contract/DataObject_validate_return.hxx>
#include <mmx/contract/Locked.hxx>
#include <mmx/contract/Locked_calc_cost.hxx>
#include <mmx/contract/Locked_calc_cost_return.hxx>
#include <mmx/contract/Locked_calc_hash.hxx>
#include <mmx/contract/Locked_calc_hash_return.hxx>
#include <mmx/contract/Locked_get_dependency.hxx>
#include <mmx/contract/Locked_get_dependency_return.hxx>
#include <mmx/contract/Locked_get_owner.hxx>
#include <mmx/contract/Locked_get_owner_return.hxx>
#include <mmx/contract/Locked_get_parties.hxx>
#include <mmx/contract/Locked_get_parties_return.hxx>
#include <mmx/contract/Locked_is_spendable.hxx>
#include <mmx/contract/Locked_is_spendable_return.hxx>
#include <mmx/contract/Locked_is_valid.hxx>
#include <mmx/contract/Locked_is_valid_return.hxx>
#include <mmx/contract/Locked_validate.hxx>
#include <mmx/contract/Locked_validate_return.hxx>
#include <mmx/contract/MultiSig.hxx>
#include <mmx/contract/MultiSig_add_owner.hxx>
#include <mmx/contract/MultiSig_add_owner_return.hxx>
#include <mmx/contract/MultiSig_calc_cost.hxx>
#include <mmx/contract/MultiSig_calc_cost_return.hxx>
#include <mmx/contract/MultiSig_calc_hash.hxx>
#include <mmx/contract/MultiSig_calc_hash_return.hxx>
#include <mmx/contract/MultiSig_get_parties.hxx>
#include <mmx/contract/MultiSig_get_parties_return.hxx>
#include <mmx/contract/MultiSig_is_valid.hxx>
#include <mmx/contract/MultiSig_is_valid_return.hxx>
#include <mmx/contract/MultiSig_rem_owner.hxx>
#include <mmx/contract/MultiSig_rem_owner_return.hxx>
#include <mmx/contract/MultiSig_validate.hxx>
#include <mmx/contract/MultiSig_validate_return.hxx>
#include <mmx/contract/NFT.hxx>
#include <mmx/contract/NFT_calc_cost.hxx>
#include <mmx/contract/NFT_calc_cost_return.hxx>
#include <mmx/contract/NFT_calc_hash.hxx>
#include <mmx/contract/NFT_calc_hash_return.hxx>
#include <mmx/contract/NFT_is_valid.hxx>
#include <mmx/contract/NFT_is_valid_return.hxx>
#include <mmx/contract/PlotNFT.hxx>
#include <mmx/contract/PlotNFT_calc_cost.hxx>
#include <mmx/contract/PlotNFT_calc_cost_return.hxx>
#include <mmx/contract/PlotNFT_calc_hash.hxx>
#include <mmx/contract/PlotNFT_calc_hash_return.hxx>
#include <mmx/contract/PlotNFT_get_dependency.hxx>
#include <mmx/contract/PlotNFT_get_dependency_return.hxx>
#include <mmx/contract/PlotNFT_get_owner.hxx>
#include <mmx/contract/PlotNFT_get_owner_return.hxx>
#include <mmx/contract/PlotNFT_get_parties.hxx>
#include <mmx/contract/PlotNFT_get_parties_return.hxx>
#include <mmx/contract/PlotNFT_is_valid.hxx>
#include <mmx/contract/PlotNFT_is_valid_return.hxx>
#include <mmx/contract/PlotNFT_lock_target.hxx>
#include <mmx/contract/PlotNFT_lock_target_return.hxx>
#include <mmx/contract/PlotNFT_unlock.hxx>
#include <mmx/contract/PlotNFT_unlock_return.hxx>
#include <mmx/contract/PlotNFT_validate.hxx>
#include <mmx/contract/PlotNFT_validate_return.hxx>
#include <mmx/contract/PubKey.hxx>
#include <mmx/contract/PubKey_calc_cost.hxx>
#include <mmx/contract/PubKey_calc_cost_return.hxx>
#include <mmx/contract/PubKey_calc_hash.hxx>
#include <mmx/contract/PubKey_calc_hash_return.hxx>
#include <mmx/contract/PubKey_get_dependency.hxx>
#include <mmx/contract/PubKey_get_dependency_return.hxx>
#include <mmx/contract/PubKey_get_owner.hxx>
#include <mmx/contract/PubKey_get_owner_return.hxx>
#include <mmx/contract/PubKey_get_parties.hxx>
#include <mmx/contract/PubKey_get_parties_return.hxx>
#include <mmx/contract/PubKey_is_valid.hxx>
#include <mmx/contract/PubKey_is_valid_return.hxx>
#include <mmx/contract/PubKey_validate.hxx>
#include <mmx/contract/PubKey_validate_return.hxx>
#include <mmx/contract/PuzzleLock.hxx>
#include <mmx/contract/PuzzleLock_calc_cost.hxx>
#include <mmx/contract/PuzzleLock_calc_cost_return.hxx>
#include <mmx/contract/PuzzleLock_calc_hash.hxx>
#include <mmx/contract/PuzzleLock_calc_hash_return.hxx>
#include <mmx/contract/PuzzleLock_get_dependency.hxx>
#include <mmx/contract/PuzzleLock_get_dependency_return.hxx>
#include <mmx/contract/PuzzleLock_get_parties.hxx>
#include <mmx/contract/PuzzleLock_get_parties_return.hxx>
#include <mmx/contract/PuzzleLock_is_valid.hxx>
#include <mmx/contract/PuzzleLock_is_valid_return.hxx>
#include <mmx/contract/PuzzleLock_validate.hxx>
#include <mmx/contract/PuzzleLock_validate_return.hxx>
#include <mmx/contract/Staking.hxx>
#include <mmx/contract/Staking_calc_cost.hxx>
#include <mmx/contract/Staking_calc_cost_return.hxx>
#include <mmx/contract/Staking_calc_hash.hxx>
#include <mmx/contract/Staking_calc_hash_return.hxx>
#include <mmx/contract/Staking_get_dependency.hxx>
#include <mmx/contract/Staking_get_dependency_return.hxx>
#include <mmx/contract/Staking_get_owner.hxx>
#include <mmx/contract/Staking_get_owner_return.hxx>
#include <mmx/contract/Staking_get_parties.hxx>
#include <mmx/contract/Staking_get_parties_return.hxx>
#include <mmx/contract/Staking_is_valid.hxx>
#include <mmx/contract/Staking_is_valid_return.hxx>
#include <mmx/contract/Staking_validate.hxx>
#include <mmx/contract/Staking_validate_return.hxx>
#include <mmx/contract/Token.hxx>
#include <mmx/contract/Token_calc_cost.hxx>
#include <mmx/contract/Token_calc_cost_return.hxx>
#include <mmx/contract/Token_calc_hash.hxx>
#include <mmx/contract/Token_calc_hash_return.hxx>
#include <mmx/contract/Token_get_dependency.hxx>
#include <mmx/contract/Token_get_dependency_return.hxx>
#include <mmx/contract/Token_get_owner.hxx>
#include <mmx/contract/Token_get_owner_return.hxx>
#include <mmx/contract/Token_get_parties.hxx>
#include <mmx/contract/Token_get_parties_return.hxx>
#include <mmx/contract/Token_is_valid.hxx>
#include <mmx/contract/Token_is_valid_return.hxx>
#include <mmx/contract/Token_set_stake_factor.hxx>
#include <mmx/contract/Token_set_stake_factor_return.hxx>
#include <mmx/contract/Token_set_time_factor.hxx>
#include <mmx/contract/Token_set_time_factor_return.hxx>
#include <mmx/contract/Token_transfer.hxx>
#include <mmx/contract/Token_transfer_return.hxx>
#include <mmx/contract/Token_validate.hxx>
#include <mmx/contract/Token_validate_return.hxx>
#include <mmx/contract/VoteSheet.hxx>
#include <mmx/contract/VoteSheet_is_valid.hxx>
#include <mmx/contract/VoteSheet_is_valid_return.hxx>
#include <mmx/contract/WebData.hxx>
#include <mmx/contract/WebData_calc_cost.hxx>
#include <mmx/contract/WebData_calc_cost_return.hxx>
#include <mmx/contract/WebData_calc_hash.hxx>
#include <mmx/contract/WebData_calc_hash_return.hxx>
#include <mmx/contract/WebData_is_valid.hxx>
#include <mmx/contract/WebData_is_valid_return.hxx>
#include <mmx/contract/package.hxx>
#include <vnx/vnx.h>
namespace vnx {
const TypeCode* type<::mmx::contract::Data>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data;
}
void type<::mmx::contract::Data>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data());
}
void type<::mmx::contract::Data>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_calc_cost;
}
void type<::mmx::contract::Data_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_calc_cost());
}
void type<::mmx::contract::Data_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_calc_cost_return;
}
void type<::mmx::contract::Data_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_calc_cost_return());
}
void type<::mmx::contract::Data_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_calc_hash;
}
void type<::mmx::contract::Data_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_calc_hash());
}
void type<::mmx::contract::Data_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_calc_hash_return;
}
void type<::mmx::contract::Data_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_calc_hash_return());
}
void type<::mmx::contract::Data_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_get_dependency>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_get_dependency;
}
void type<::mmx::contract::Data_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_get_dependency());
}
void type<::mmx::contract::Data_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_get_dependency& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_get_dependency_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_get_dependency_return;
}
void type<::mmx::contract::Data_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_get_dependency_return());
}
void type<::mmx::contract::Data_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_get_dependency_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_get_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_get_owner;
}
void type<::mmx::contract::Data_get_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_get_owner());
}
void type<::mmx::contract::Data_get_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_get_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_get_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_get_owner_return;
}
void type<::mmx::contract::Data_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_get_owner_return());
}
void type<::mmx::contract::Data_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_get_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_get_parties;
}
void type<::mmx::contract::Data_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_get_parties());
}
void type<::mmx::contract::Data_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_get_parties_return;
}
void type<::mmx::contract::Data_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_get_parties_return());
}
void type<::mmx::contract::Data_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_set>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_set;
}
void type<::mmx::contract::Data_set>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_set());
}
void type<::mmx::contract::Data_set>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_set& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_set_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_set_return;
}
void type<::mmx::contract::Data_set_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_set_return());
}
void type<::mmx::contract::Data_set_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_set_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_transfer>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_transfer;
}
void type<::mmx::contract::Data_transfer>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_transfer());
}
void type<::mmx::contract::Data_transfer>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_transfer& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_transfer_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_transfer_return;
}
void type<::mmx::contract::Data_transfer_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_transfer_return());
}
void type<::mmx::contract::Data_transfer_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_transfer_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_validate;
}
void type<::mmx::contract::Data_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_validate());
}
void type<::mmx::contract::Data_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Data_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Data_validate_return;
}
void type<::mmx::contract::Data_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Data_validate_return());
}
void type<::mmx::contract::Data_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Data_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray;
}
void type<::mmx::contract::DataArray>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray());
}
void type<::mmx::contract::DataArray>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_append>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_append;
}
void type<::mmx::contract::DataArray_append>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_append());
}
void type<::mmx::contract::DataArray_append>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_append& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_append_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_append_return;
}
void type<::mmx::contract::DataArray_append_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_append_return());
}
void type<::mmx::contract::DataArray_append_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_append_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_calc_cost;
}
void type<::mmx::contract::DataArray_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_calc_cost());
}
void type<::mmx::contract::DataArray_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_calc_cost_return;
}
void type<::mmx::contract::DataArray_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_calc_cost_return());
}
void type<::mmx::contract::DataArray_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_calc_hash;
}
void type<::mmx::contract::DataArray_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_calc_hash());
}
void type<::mmx::contract::DataArray_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_calc_hash_return;
}
void type<::mmx::contract::DataArray_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_calc_hash_return());
}
void type<::mmx::contract::DataArray_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_clear>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_clear;
}
void type<::mmx::contract::DataArray_clear>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_clear());
}
void type<::mmx::contract::DataArray_clear>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_clear& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_clear_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_clear_return;
}
void type<::mmx::contract::DataArray_clear_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_clear_return());
}
void type<::mmx::contract::DataArray_clear_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_clear_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_get_dependency>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_get_dependency;
}
void type<::mmx::contract::DataArray_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_get_dependency());
}
void type<::mmx::contract::DataArray_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_get_dependency& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_get_dependency_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_get_dependency_return;
}
void type<::mmx::contract::DataArray_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_get_dependency_return());
}
void type<::mmx::contract::DataArray_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_get_dependency_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_get_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_get_owner;
}
void type<::mmx::contract::DataArray_get_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_get_owner());
}
void type<::mmx::contract::DataArray_get_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_get_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_get_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_get_owner_return;
}
void type<::mmx::contract::DataArray_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_get_owner_return());
}
void type<::mmx::contract::DataArray_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_get_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_get_parties;
}
void type<::mmx::contract::DataArray_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_get_parties());
}
void type<::mmx::contract::DataArray_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_get_parties_return;
}
void type<::mmx::contract::DataArray_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_get_parties_return());
}
void type<::mmx::contract::DataArray_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_is_valid;
}
void type<::mmx::contract::DataArray_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_is_valid());
}
void type<::mmx::contract::DataArray_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_is_valid_return;
}
void type<::mmx::contract::DataArray_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_is_valid_return());
}
void type<::mmx::contract::DataArray_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_num_bytes>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_num_bytes;
}
void type<::mmx::contract::DataArray_num_bytes>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_num_bytes());
}
void type<::mmx::contract::DataArray_num_bytes>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_num_bytes& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_num_bytes_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_num_bytes_return;
}
void type<::mmx::contract::DataArray_num_bytes_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_num_bytes_return());
}
void type<::mmx::contract::DataArray_num_bytes_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_num_bytes_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_transfer>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_transfer;
}
void type<::mmx::contract::DataArray_transfer>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_transfer());
}
void type<::mmx::contract::DataArray_transfer>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_transfer& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_transfer_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_transfer_return;
}
void type<::mmx::contract::DataArray_transfer_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_transfer_return());
}
void type<::mmx::contract::DataArray_transfer_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_transfer_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_validate;
}
void type<::mmx::contract::DataArray_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_validate());
}
void type<::mmx::contract::DataArray_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataArray_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataArray_validate_return;
}
void type<::mmx::contract::DataArray_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataArray_validate_return());
}
void type<::mmx::contract::DataArray_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataArray_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject;
}
void type<::mmx::contract::DataObject>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject());
}
void type<::mmx::contract::DataObject>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_calc_cost;
}
void type<::mmx::contract::DataObject_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_calc_cost());
}
void type<::mmx::contract::DataObject_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_calc_cost_return;
}
void type<::mmx::contract::DataObject_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_calc_cost_return());
}
void type<::mmx::contract::DataObject_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_calc_hash;
}
void type<::mmx::contract::DataObject_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_calc_hash());
}
void type<::mmx::contract::DataObject_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_calc_hash_return;
}
void type<::mmx::contract::DataObject_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_calc_hash_return());
}
void type<::mmx::contract::DataObject_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_clear>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_clear;
}
void type<::mmx::contract::DataObject_clear>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_clear());
}
void type<::mmx::contract::DataObject_clear>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_clear& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_clear_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_clear_return;
}
void type<::mmx::contract::DataObject_clear_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_clear_return());
}
void type<::mmx::contract::DataObject_clear_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_clear_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_erase>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_erase;
}
void type<::mmx::contract::DataObject_erase>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_erase());
}
void type<::mmx::contract::DataObject_erase>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_erase& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_erase_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_erase_return;
}
void type<::mmx::contract::DataObject_erase_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_erase_return());
}
void type<::mmx::contract::DataObject_erase_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_erase_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_get_dependency>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_get_dependency;
}
void type<::mmx::contract::DataObject_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_get_dependency());
}
void type<::mmx::contract::DataObject_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_get_dependency& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_get_dependency_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_get_dependency_return;
}
void type<::mmx::contract::DataObject_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_get_dependency_return());
}
void type<::mmx::contract::DataObject_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_get_dependency_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_get_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_get_owner;
}
void type<::mmx::contract::DataObject_get_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_get_owner());
}
void type<::mmx::contract::DataObject_get_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_get_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_get_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_get_owner_return;
}
void type<::mmx::contract::DataObject_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_get_owner_return());
}
void type<::mmx::contract::DataObject_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_get_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_get_parties;
}
void type<::mmx::contract::DataObject_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_get_parties());
}
void type<::mmx::contract::DataObject_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_get_parties_return;
}
void type<::mmx::contract::DataObject_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_get_parties_return());
}
void type<::mmx::contract::DataObject_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_is_valid;
}
void type<::mmx::contract::DataObject_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_is_valid());
}
void type<::mmx::contract::DataObject_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_is_valid_return;
}
void type<::mmx::contract::DataObject_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_is_valid_return());
}
void type<::mmx::contract::DataObject_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_num_bytes>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_num_bytes;
}
void type<::mmx::contract::DataObject_num_bytes>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_num_bytes());
}
void type<::mmx::contract::DataObject_num_bytes>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_num_bytes& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_num_bytes_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_num_bytes_return;
}
void type<::mmx::contract::DataObject_num_bytes_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_num_bytes_return());
}
void type<::mmx::contract::DataObject_num_bytes_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_num_bytes_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_set>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_set;
}
void type<::mmx::contract::DataObject_set>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_set());
}
void type<::mmx::contract::DataObject_set>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_set& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_set_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_set_return;
}
void type<::mmx::contract::DataObject_set_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_set_return());
}
void type<::mmx::contract::DataObject_set_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_set_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_transfer>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_transfer;
}
void type<::mmx::contract::DataObject_transfer>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_transfer());
}
void type<::mmx::contract::DataObject_transfer>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_transfer& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_transfer_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_transfer_return;
}
void type<::mmx::contract::DataObject_transfer_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_transfer_return());
}
void type<::mmx::contract::DataObject_transfer_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_transfer_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_validate;
}
void type<::mmx::contract::DataObject_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_validate());
}
void type<::mmx::contract::DataObject_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::DataObject_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_DataObject_validate_return;
}
void type<::mmx::contract::DataObject_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::DataObject_validate_return());
}
void type<::mmx::contract::DataObject_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::DataObject_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked;
}
void type<::mmx::contract::Locked>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked());
}
void type<::mmx::contract::Locked>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_calc_cost;
}
void type<::mmx::contract::Locked_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_calc_cost());
}
void type<::mmx::contract::Locked_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_calc_cost_return;
}
void type<::mmx::contract::Locked_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_calc_cost_return());
}
void type<::mmx::contract::Locked_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_calc_hash;
}
void type<::mmx::contract::Locked_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_calc_hash());
}
void type<::mmx::contract::Locked_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_calc_hash_return;
}
void type<::mmx::contract::Locked_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_calc_hash_return());
}
void type<::mmx::contract::Locked_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_get_dependency>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_get_dependency;
}
void type<::mmx::contract::Locked_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_get_dependency());
}
void type<::mmx::contract::Locked_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_get_dependency& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_get_dependency_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_get_dependency_return;
}
void type<::mmx::contract::Locked_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_get_dependency_return());
}
void type<::mmx::contract::Locked_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_get_dependency_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_get_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_get_owner;
}
void type<::mmx::contract::Locked_get_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_get_owner());
}
void type<::mmx::contract::Locked_get_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_get_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_get_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_get_owner_return;
}
void type<::mmx::contract::Locked_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_get_owner_return());
}
void type<::mmx::contract::Locked_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_get_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_get_parties;
}
void type<::mmx::contract::Locked_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_get_parties());
}
void type<::mmx::contract::Locked_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_get_parties_return;
}
void type<::mmx::contract::Locked_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_get_parties_return());
}
void type<::mmx::contract::Locked_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_is_spendable>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_is_spendable;
}
void type<::mmx::contract::Locked_is_spendable>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_is_spendable());
}
void type<::mmx::contract::Locked_is_spendable>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_is_spendable& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_is_spendable_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_is_spendable_return;
}
void type<::mmx::contract::Locked_is_spendable_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_is_spendable_return());
}
void type<::mmx::contract::Locked_is_spendable_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_is_spendable_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_is_valid;
}
void type<::mmx::contract::Locked_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_is_valid());
}
void type<::mmx::contract::Locked_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_is_valid_return;
}
void type<::mmx::contract::Locked_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_is_valid_return());
}
void type<::mmx::contract::Locked_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_validate;
}
void type<::mmx::contract::Locked_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_validate());
}
void type<::mmx::contract::Locked_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Locked_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Locked_validate_return;
}
void type<::mmx::contract::Locked_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Locked_validate_return());
}
void type<::mmx::contract::Locked_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Locked_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig;
}
void type<::mmx::contract::MultiSig>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig());
}
void type<::mmx::contract::MultiSig>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_add_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_add_owner;
}
void type<::mmx::contract::MultiSig_add_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_add_owner());
}
void type<::mmx::contract::MultiSig_add_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_add_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_add_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_add_owner_return;
}
void type<::mmx::contract::MultiSig_add_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_add_owner_return());
}
void type<::mmx::contract::MultiSig_add_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_add_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_calc_cost;
}
void type<::mmx::contract::MultiSig_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_calc_cost());
}
void type<::mmx::contract::MultiSig_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_calc_cost_return;
}
void type<::mmx::contract::MultiSig_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_calc_cost_return());
}
void type<::mmx::contract::MultiSig_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_calc_hash;
}
void type<::mmx::contract::MultiSig_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_calc_hash());
}
void type<::mmx::contract::MultiSig_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_calc_hash_return;
}
void type<::mmx::contract::MultiSig_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_calc_hash_return());
}
void type<::mmx::contract::MultiSig_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_get_parties;
}
void type<::mmx::contract::MultiSig_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_get_parties());
}
void type<::mmx::contract::MultiSig_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_get_parties_return;
}
void type<::mmx::contract::MultiSig_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_get_parties_return());
}
void type<::mmx::contract::MultiSig_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_is_valid;
}
void type<::mmx::contract::MultiSig_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_is_valid());
}
void type<::mmx::contract::MultiSig_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_is_valid_return;
}
void type<::mmx::contract::MultiSig_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_is_valid_return());
}
void type<::mmx::contract::MultiSig_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_rem_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_rem_owner;
}
void type<::mmx::contract::MultiSig_rem_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_rem_owner());
}
void type<::mmx::contract::MultiSig_rem_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_rem_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_rem_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_rem_owner_return;
}
void type<::mmx::contract::MultiSig_rem_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_rem_owner_return());
}
void type<::mmx::contract::MultiSig_rem_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_rem_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_validate;
}
void type<::mmx::contract::MultiSig_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_validate());
}
void type<::mmx::contract::MultiSig_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::MultiSig_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_MultiSig_validate_return;
}
void type<::mmx::contract::MultiSig_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::MultiSig_validate_return());
}
void type<::mmx::contract::MultiSig_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::MultiSig_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::NFT>::get_type_code() {
return mmx::contract::vnx_native_type_code_NFT;
}
void type<::mmx::contract::NFT>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::NFT());
}
void type<::mmx::contract::NFT>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::NFT& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::NFT_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_NFT_calc_cost;
}
void type<::mmx::contract::NFT_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::NFT_calc_cost());
}
void type<::mmx::contract::NFT_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::NFT_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::NFT_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_NFT_calc_cost_return;
}
void type<::mmx::contract::NFT_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::NFT_calc_cost_return());
}
void type<::mmx::contract::NFT_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::NFT_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::NFT_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_NFT_calc_hash;
}
void type<::mmx::contract::NFT_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::NFT_calc_hash());
}
void type<::mmx::contract::NFT_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::NFT_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::NFT_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_NFT_calc_hash_return;
}
void type<::mmx::contract::NFT_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::NFT_calc_hash_return());
}
void type<::mmx::contract::NFT_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::NFT_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::NFT_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_NFT_is_valid;
}
void type<::mmx::contract::NFT_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::NFT_is_valid());
}
void type<::mmx::contract::NFT_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::NFT_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::NFT_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_NFT_is_valid_return;
}
void type<::mmx::contract::NFT_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::NFT_is_valid_return());
}
void type<::mmx::contract::NFT_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::NFT_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT;
}
void type<::mmx::contract::PlotNFT>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT());
}
void type<::mmx::contract::PlotNFT>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_calc_cost;
}
void type<::mmx::contract::PlotNFT_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_calc_cost());
}
void type<::mmx::contract::PlotNFT_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_calc_cost_return;
}
void type<::mmx::contract::PlotNFT_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_calc_cost_return());
}
void type<::mmx::contract::PlotNFT_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_calc_hash;
}
void type<::mmx::contract::PlotNFT_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_calc_hash());
}
void type<::mmx::contract::PlotNFT_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_calc_hash_return;
}
void type<::mmx::contract::PlotNFT_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_calc_hash_return());
}
void type<::mmx::contract::PlotNFT_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_get_dependency>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_get_dependency;
}
void type<::mmx::contract::PlotNFT_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_get_dependency());
}
void type<::mmx::contract::PlotNFT_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_get_dependency& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_get_dependency_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_get_dependency_return;
}
void type<::mmx::contract::PlotNFT_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_get_dependency_return());
}
void type<::mmx::contract::PlotNFT_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_get_dependency_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_get_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_get_owner;
}
void type<::mmx::contract::PlotNFT_get_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_get_owner());
}
void type<::mmx::contract::PlotNFT_get_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_get_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_get_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_get_owner_return;
}
void type<::mmx::contract::PlotNFT_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_get_owner_return());
}
void type<::mmx::contract::PlotNFT_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_get_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_get_parties;
}
void type<::mmx::contract::PlotNFT_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_get_parties());
}
void type<::mmx::contract::PlotNFT_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_get_parties_return;
}
void type<::mmx::contract::PlotNFT_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_get_parties_return());
}
void type<::mmx::contract::PlotNFT_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_is_valid;
}
void type<::mmx::contract::PlotNFT_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_is_valid());
}
void type<::mmx::contract::PlotNFT_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_is_valid_return;
}
void type<::mmx::contract::PlotNFT_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_is_valid_return());
}
void type<::mmx::contract::PlotNFT_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_lock_target>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_lock_target;
}
void type<::mmx::contract::PlotNFT_lock_target>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_lock_target());
}
void type<::mmx::contract::PlotNFT_lock_target>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_lock_target& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_lock_target_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_lock_target_return;
}
void type<::mmx::contract::PlotNFT_lock_target_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_lock_target_return());
}
void type<::mmx::contract::PlotNFT_lock_target_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_lock_target_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_unlock>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_unlock;
}
void type<::mmx::contract::PlotNFT_unlock>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_unlock());
}
void type<::mmx::contract::PlotNFT_unlock>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_unlock& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_unlock_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_unlock_return;
}
void type<::mmx::contract::PlotNFT_unlock_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_unlock_return());
}
void type<::mmx::contract::PlotNFT_unlock_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_unlock_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_validate;
}
void type<::mmx::contract::PlotNFT_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_validate());
}
void type<::mmx::contract::PlotNFT_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PlotNFT_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PlotNFT_validate_return;
}
void type<::mmx::contract::PlotNFT_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PlotNFT_validate_return());
}
void type<::mmx::contract::PlotNFT_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PlotNFT_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey;
}
void type<::mmx::contract::PubKey>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey());
}
void type<::mmx::contract::PubKey>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_calc_cost;
}
void type<::mmx::contract::PubKey_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_calc_cost());
}
void type<::mmx::contract::PubKey_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_calc_cost_return;
}
void type<::mmx::contract::PubKey_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_calc_cost_return());
}
void type<::mmx::contract::PubKey_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_calc_hash;
}
void type<::mmx::contract::PubKey_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_calc_hash());
}
void type<::mmx::contract::PubKey_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_calc_hash_return;
}
void type<::mmx::contract::PubKey_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_calc_hash_return());
}
void type<::mmx::contract::PubKey_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_get_dependency>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_get_dependency;
}
void type<::mmx::contract::PubKey_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_get_dependency());
}
void type<::mmx::contract::PubKey_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_get_dependency& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_get_dependency_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_get_dependency_return;
}
void type<::mmx::contract::PubKey_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_get_dependency_return());
}
void type<::mmx::contract::PubKey_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_get_dependency_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_get_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_get_owner;
}
void type<::mmx::contract::PubKey_get_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_get_owner());
}
void type<::mmx::contract::PubKey_get_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_get_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_get_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_get_owner_return;
}
void type<::mmx::contract::PubKey_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_get_owner_return());
}
void type<::mmx::contract::PubKey_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_get_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_get_parties;
}
void type<::mmx::contract::PubKey_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_get_parties());
}
void type<::mmx::contract::PubKey_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_get_parties_return;
}
void type<::mmx::contract::PubKey_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_get_parties_return());
}
void type<::mmx::contract::PubKey_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_is_valid;
}
void type<::mmx::contract::PubKey_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_is_valid());
}
void type<::mmx::contract::PubKey_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_is_valid_return;
}
void type<::mmx::contract::PubKey_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_is_valid_return());
}
void type<::mmx::contract::PubKey_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_validate;
}
void type<::mmx::contract::PubKey_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_validate());
}
void type<::mmx::contract::PubKey_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PubKey_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PubKey_validate_return;
}
void type<::mmx::contract::PubKey_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PubKey_validate_return());
}
void type<::mmx::contract::PubKey_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PubKey_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock;
}
void type<::mmx::contract::PuzzleLock>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock());
}
void type<::mmx::contract::PuzzleLock>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_calc_cost;
}
void type<::mmx::contract::PuzzleLock_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_calc_cost());
}
void type<::mmx::contract::PuzzleLock_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_calc_cost_return;
}
void type<::mmx::contract::PuzzleLock_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_calc_cost_return());
}
void type<::mmx::contract::PuzzleLock_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_calc_hash;
}
void type<::mmx::contract::PuzzleLock_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_calc_hash());
}
void type<::mmx::contract::PuzzleLock_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_calc_hash_return;
}
void type<::mmx::contract::PuzzleLock_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_calc_hash_return());
}
void type<::mmx::contract::PuzzleLock_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_get_dependency>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_get_dependency;
}
void type<::mmx::contract::PuzzleLock_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_get_dependency());
}
void type<::mmx::contract::PuzzleLock_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_get_dependency& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_get_dependency_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_get_dependency_return;
}
void type<::mmx::contract::PuzzleLock_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_get_dependency_return());
}
void type<::mmx::contract::PuzzleLock_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_get_dependency_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_get_parties;
}
void type<::mmx::contract::PuzzleLock_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_get_parties());
}
void type<::mmx::contract::PuzzleLock_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_get_parties_return;
}
void type<::mmx::contract::PuzzleLock_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_get_parties_return());
}
void type<::mmx::contract::PuzzleLock_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_is_valid;
}
void type<::mmx::contract::PuzzleLock_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_is_valid());
}
void type<::mmx::contract::PuzzleLock_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_is_valid_return;
}
void type<::mmx::contract::PuzzleLock_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_is_valid_return());
}
void type<::mmx::contract::PuzzleLock_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_validate;
}
void type<::mmx::contract::PuzzleLock_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_validate());
}
void type<::mmx::contract::PuzzleLock_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::PuzzleLock_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_PuzzleLock_validate_return;
}
void type<::mmx::contract::PuzzleLock_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::PuzzleLock_validate_return());
}
void type<::mmx::contract::PuzzleLock_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::PuzzleLock_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking;
}
void type<::mmx::contract::Staking>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking());
}
void type<::mmx::contract::Staking>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_calc_cost;
}
void type<::mmx::contract::Staking_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_calc_cost());
}
void type<::mmx::contract::Staking_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_calc_cost_return;
}
void type<::mmx::contract::Staking_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_calc_cost_return());
}
void type<::mmx::contract::Staking_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_calc_hash;
}
void type<::mmx::contract::Staking_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_calc_hash());
}
void type<::mmx::contract::Staking_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_calc_hash_return;
}
void type<::mmx::contract::Staking_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_calc_hash_return());
}
void type<::mmx::contract::Staking_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_get_dependency>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_get_dependency;
}
void type<::mmx::contract::Staking_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_get_dependency());
}
void type<::mmx::contract::Staking_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_get_dependency& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_get_dependency_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_get_dependency_return;
}
void type<::mmx::contract::Staking_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_get_dependency_return());
}
void type<::mmx::contract::Staking_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_get_dependency_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_get_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_get_owner;
}
void type<::mmx::contract::Staking_get_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_get_owner());
}
void type<::mmx::contract::Staking_get_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_get_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_get_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_get_owner_return;
}
void type<::mmx::contract::Staking_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_get_owner_return());
}
void type<::mmx::contract::Staking_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_get_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_get_parties;
}
void type<::mmx::contract::Staking_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_get_parties());
}
void type<::mmx::contract::Staking_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_get_parties_return;
}
void type<::mmx::contract::Staking_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_get_parties_return());
}
void type<::mmx::contract::Staking_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_is_valid;
}
void type<::mmx::contract::Staking_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_is_valid());
}
void type<::mmx::contract::Staking_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_is_valid_return;
}
void type<::mmx::contract::Staking_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_is_valid_return());
}
void type<::mmx::contract::Staking_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_validate;
}
void type<::mmx::contract::Staking_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_validate());
}
void type<::mmx::contract::Staking_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Staking_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Staking_validate_return;
}
void type<::mmx::contract::Staking_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Staking_validate_return());
}
void type<::mmx::contract::Staking_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Staking_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token;
}
void type<::mmx::contract::Token>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token());
}
void type<::mmx::contract::Token>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_calc_cost;
}
void type<::mmx::contract::Token_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_calc_cost());
}
void type<::mmx::contract::Token_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_calc_cost_return;
}
void type<::mmx::contract::Token_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_calc_cost_return());
}
void type<::mmx::contract::Token_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_calc_hash;
}
void type<::mmx::contract::Token_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_calc_hash());
}
void type<::mmx::contract::Token_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_calc_hash_return;
}
void type<::mmx::contract::Token_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_calc_hash_return());
}
void type<::mmx::contract::Token_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_get_dependency>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_get_dependency;
}
void type<::mmx::contract::Token_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_get_dependency());
}
void type<::mmx::contract::Token_get_dependency>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_get_dependency& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_get_dependency_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_get_dependency_return;
}
void type<::mmx::contract::Token_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_get_dependency_return());
}
void type<::mmx::contract::Token_get_dependency_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_get_dependency_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_get_owner>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_get_owner;
}
void type<::mmx::contract::Token_get_owner>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_get_owner());
}
void type<::mmx::contract::Token_get_owner>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_get_owner& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_get_owner_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_get_owner_return;
}
void type<::mmx::contract::Token_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_get_owner_return());
}
void type<::mmx::contract::Token_get_owner_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_get_owner_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_get_parties>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_get_parties;
}
void type<::mmx::contract::Token_get_parties>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_get_parties());
}
void type<::mmx::contract::Token_get_parties>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_get_parties& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_get_parties_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_get_parties_return;
}
void type<::mmx::contract::Token_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_get_parties_return());
}
void type<::mmx::contract::Token_get_parties_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_get_parties_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_is_valid;
}
void type<::mmx::contract::Token_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_is_valid());
}
void type<::mmx::contract::Token_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_is_valid_return;
}
void type<::mmx::contract::Token_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_is_valid_return());
}
void type<::mmx::contract::Token_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_set_stake_factor>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_set_stake_factor;
}
void type<::mmx::contract::Token_set_stake_factor>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_set_stake_factor());
}
void type<::mmx::contract::Token_set_stake_factor>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_set_stake_factor& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_set_stake_factor_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_set_stake_factor_return;
}
void type<::mmx::contract::Token_set_stake_factor_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_set_stake_factor_return());
}
void type<::mmx::contract::Token_set_stake_factor_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_set_stake_factor_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_set_time_factor>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_set_time_factor;
}
void type<::mmx::contract::Token_set_time_factor>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_set_time_factor());
}
void type<::mmx::contract::Token_set_time_factor>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_set_time_factor& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_set_time_factor_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_set_time_factor_return;
}
void type<::mmx::contract::Token_set_time_factor_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_set_time_factor_return());
}
void type<::mmx::contract::Token_set_time_factor_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_set_time_factor_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_transfer>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_transfer;
}
void type<::mmx::contract::Token_transfer>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_transfer());
}
void type<::mmx::contract::Token_transfer>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_transfer& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_transfer_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_transfer_return;
}
void type<::mmx::contract::Token_transfer_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_transfer_return());
}
void type<::mmx::contract::Token_transfer_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_transfer_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_validate>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_validate;
}
void type<::mmx::contract::Token_validate>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_validate());
}
void type<::mmx::contract::Token_validate>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_validate& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::Token_validate_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_Token_validate_return;
}
void type<::mmx::contract::Token_validate_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::Token_validate_return());
}
void type<::mmx::contract::Token_validate_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::Token_validate_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::VoteSheet>::get_type_code() {
return mmx::contract::vnx_native_type_code_VoteSheet;
}
void type<::mmx::contract::VoteSheet>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::VoteSheet());
}
void type<::mmx::contract::VoteSheet>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::VoteSheet& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::VoteSheet_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_VoteSheet_is_valid;
}
void type<::mmx::contract::VoteSheet_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::VoteSheet_is_valid());
}
void type<::mmx::contract::VoteSheet_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::VoteSheet_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::VoteSheet_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_VoteSheet_is_valid_return;
}
void type<::mmx::contract::VoteSheet_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::VoteSheet_is_valid_return());
}
void type<::mmx::contract::VoteSheet_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::VoteSheet_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::WebData>::get_type_code() {
return mmx::contract::vnx_native_type_code_WebData;
}
void type<::mmx::contract::WebData>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::WebData());
}
void type<::mmx::contract::WebData>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::WebData& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::WebData_calc_cost>::get_type_code() {
return mmx::contract::vnx_native_type_code_WebData_calc_cost;
}
void type<::mmx::contract::WebData_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::WebData_calc_cost());
}
void type<::mmx::contract::WebData_calc_cost>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::WebData_calc_cost& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::WebData_calc_cost_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_WebData_calc_cost_return;
}
void type<::mmx::contract::WebData_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::WebData_calc_cost_return());
}
void type<::mmx::contract::WebData_calc_cost_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::WebData_calc_cost_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::WebData_calc_hash>::get_type_code() {
return mmx::contract::vnx_native_type_code_WebData_calc_hash;
}
void type<::mmx::contract::WebData_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::WebData_calc_hash());
}
void type<::mmx::contract::WebData_calc_hash>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::WebData_calc_hash& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::WebData_calc_hash_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_WebData_calc_hash_return;
}
void type<::mmx::contract::WebData_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::WebData_calc_hash_return());
}
void type<::mmx::contract::WebData_calc_hash_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::WebData_calc_hash_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::WebData_is_valid>::get_type_code() {
return mmx::contract::vnx_native_type_code_WebData_is_valid;
}
void type<::mmx::contract::WebData_is_valid>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::WebData_is_valid());
}
void type<::mmx::contract::WebData_is_valid>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::WebData_is_valid& value, bool special) {
code.push_back(CODE_OBJECT);
}
const TypeCode* type<::mmx::contract::WebData_is_valid_return>::get_type_code() {
return mmx::contract::vnx_native_type_code_WebData_is_valid_return;
}
void type<::mmx::contract::WebData_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code) {
create_dynamic_code(code, ::mmx::contract::WebData_is_valid_return());
}
void type<::mmx::contract::WebData_is_valid_return>::create_dynamic_code(std::vector<uint16_t>& code, const ::mmx::contract::WebData_is_valid_return& value, bool special) {
code.push_back(CODE_OBJECT);
}
} // namespace vnx
namespace mmx {
namespace contract {
static void register_all_types() {
vnx::register_type_code(::mmx::contract::Data::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_get_dependency::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_get_dependency_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_get_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_get_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_set::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_set_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_transfer::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_transfer_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::Data_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_append::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_append_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_clear::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_clear_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_get_dependency::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_get_dependency_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_get_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_get_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_num_bytes::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_num_bytes_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_transfer::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_transfer_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataArray_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_clear::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_clear_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_erase::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_erase_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_get_dependency::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_get_dependency_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_get_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_get_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_num_bytes::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_num_bytes_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_set::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_set_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_transfer::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_transfer_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::DataObject_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_get_dependency::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_get_dependency_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_get_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_get_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_is_spendable::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_is_spendable_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::Locked_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_add_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_add_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_rem_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_rem_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::MultiSig_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::NFT::static_create_type_code());
vnx::register_type_code(::mmx::contract::NFT_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::NFT_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::NFT_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::NFT_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::NFT_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::NFT_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_get_dependency::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_get_dependency_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_get_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_get_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_lock_target::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_lock_target_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_unlock::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_unlock_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::PlotNFT_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_get_dependency::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_get_dependency_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_get_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_get_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::PubKey_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_get_dependency::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_get_dependency_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::PuzzleLock_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_get_dependency::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_get_dependency_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_get_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_get_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::Staking_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_get_dependency::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_get_dependency_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_get_owner::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_get_owner_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_get_parties::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_get_parties_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_set_stake_factor::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_set_stake_factor_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_set_time_factor::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_set_time_factor_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_transfer::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_transfer_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_validate::static_create_type_code());
vnx::register_type_code(::mmx::contract::Token_validate_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::VoteSheet::static_create_type_code());
vnx::register_type_code(::mmx::contract::VoteSheet_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::VoteSheet_is_valid_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::WebData::static_create_type_code());
vnx::register_type_code(::mmx::contract::WebData_calc_cost::static_create_type_code());
vnx::register_type_code(::mmx::contract::WebData_calc_cost_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::WebData_calc_hash::static_create_type_code());
vnx::register_type_code(::mmx::contract::WebData_calc_hash_return::static_create_type_code());
vnx::register_type_code(::mmx::contract::WebData_is_valid::static_create_type_code());
vnx::register_type_code(::mmx::contract::WebData_is_valid_return::static_create_type_code());
}
static struct vnx_static_init {
vnx_static_init() {
register_all_types();
}
} vnx_static_init_;
const vnx::TypeCode* const vnx_native_type_code_Data = vnx::get_type_code(vnx::Hash64(0xadfeee3822244f50ull));
const vnx::TypeCode* const vnx_native_type_code_Data_calc_cost = vnx::get_type_code(vnx::Hash64(0xd330303ae8af8a8bull));
const vnx::TypeCode* const vnx_native_type_code_Data_calc_cost_return = vnx::get_type_code(vnx::Hash64(0xffa8c93868ea4352ull));
const vnx::TypeCode* const vnx_native_type_code_Data_calc_hash = vnx::get_type_code(vnx::Hash64(0x322fb5c8d3dfe74ull));
const vnx::TypeCode* const vnx_native_type_code_Data_calc_hash_return = vnx::get_type_code(vnx::Hash64(0x84fe9434ee352e2eull));
const vnx::TypeCode* const vnx_native_type_code_Data_get_dependency = vnx::get_type_code(vnx::Hash64(0x1ad32dbfc3b5cfe0ull));
const vnx::TypeCode* const vnx_native_type_code_Data_get_dependency_return = vnx::get_type_code(vnx::Hash64(0x4104eebc308d6c2cull));
const vnx::TypeCode* const vnx_native_type_code_Data_get_owner = vnx::get_type_code(vnx::Hash64(0xeeeff20febabaa19ull));
const vnx::TypeCode* const vnx_native_type_code_Data_get_owner_return = vnx::get_type_code(vnx::Hash64(0xfc6339e48d99addaull));
const vnx::TypeCode* const vnx_native_type_code_Data_get_parties = vnx::get_type_code(vnx::Hash64(0x252438e6b3ab3127ull));
const vnx::TypeCode* const vnx_native_type_code_Data_get_parties_return = vnx::get_type_code(vnx::Hash64(0x32b825852917b597ull));
const vnx::TypeCode* const vnx_native_type_code_Data_set = vnx::get_type_code(vnx::Hash64(0x191ecbe87a4ee70aull));
const vnx::TypeCode* const vnx_native_type_code_Data_set_return = vnx::get_type_code(vnx::Hash64(0xd16081633c1f8756ull));
const vnx::TypeCode* const vnx_native_type_code_Data_transfer = vnx::get_type_code(vnx::Hash64(0x1d784025aa08ea1ull));
const vnx::TypeCode* const vnx_native_type_code_Data_transfer_return = vnx::get_type_code(vnx::Hash64(0x3f18e1b249687c7dull));
const vnx::TypeCode* const vnx_native_type_code_Data_validate = vnx::get_type_code(vnx::Hash64(0x17de02619513f20cull));
const vnx::TypeCode* const vnx_native_type_code_Data_validate_return = vnx::get_type_code(vnx::Hash64(0x665ccb0bd661c914ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray = vnx::get_type_code(vnx::Hash64(0xe7b4a595cc73f3fbull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_append = vnx::get_type_code(vnx::Hash64(0xa37fa83da54b49c8ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_append_return = vnx::get_type_code(vnx::Hash64(0xafa390b9fbac4738ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_calc_cost = vnx::get_type_code(vnx::Hash64(0x8efad25daf7c1e65ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_calc_cost_return = vnx::get_type_code(vnx::Hash64(0x8de502f46e6ebbf8ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_calc_hash = vnx::get_type_code(vnx::Hash64(0x5ee8193bcaee6a9aull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_calc_hash_return = vnx::get_type_code(vnx::Hash64(0xf6b35ff8e8b1d684ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_clear = vnx::get_type_code(vnx::Hash64(0x529ca01cf4898deull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_clear_return = vnx::get_type_code(vnx::Hash64(0xb5779cb9f111c854ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_get_dependency = vnx::get_type_code(vnx::Hash64(0x20f315ee5d164225ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_get_dependency_return = vnx::get_type_code(vnx::Hash64(0x729c0b845fea385full));
const vnx::TypeCode* const vnx_native_type_code_DataArray_get_owner = vnx::get_type_code(vnx::Hash64(0xb3251068ac783ef7ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_get_owner_return = vnx::get_type_code(vnx::Hash64(0x8e2ef2288b1d5570ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_get_parties = vnx::get_type_code(vnx::Hash64(0xc3ecbeaf6e2182d1ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_get_parties_return = vnx::get_type_code(vnx::Hash64(0x87ec076ef4e26bd9ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_is_valid = vnx::get_type_code(vnx::Hash64(0x5ec2b39605eb4210ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_is_valid_return = vnx::get_type_code(vnx::Hash64(0x1e67a4878b6c72ddull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_num_bytes = vnx::get_type_code(vnx::Hash64(0x795e506d17006b72ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_num_bytes_return = vnx::get_type_code(vnx::Hash64(0x3ce5c62f6469debull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_transfer = vnx::get_type_code(vnx::Hash64(0x6974a603c03681f8ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_transfer_return = vnx::get_type_code(vnx::Hash64(0x5a0632efd89a564full));
const vnx::TypeCode* const vnx_native_type_code_DataArray_validate = vnx::get_type_code(vnx::Hash64(0x7f7d20600f85fd55ull));
const vnx::TypeCode* const vnx_native_type_code_DataArray_validate_return = vnx::get_type_code(vnx::Hash64(0x34218564793e326ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject = vnx::get_type_code(vnx::Hash64(0x8973249d46c7f5e6ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_calc_cost = vnx::get_type_code(vnx::Hash64(0x8093db93eae8a4c2ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_calc_cost_return = vnx::get_type_code(vnx::Hash64(0xac846c7eba6b3eceull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_calc_hash = vnx::get_type_code(vnx::Hash64(0x508110f58f7ad03dull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_calc_hash_return = vnx::get_type_code(vnx::Hash64(0xd7d231723cb453b2ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_clear = vnx::get_type_code(vnx::Hash64(0xb8025ff733055610ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_clear_return = vnx::get_type_code(vnx::Hash64(0x557aed84d9bd8b37ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_erase = vnx::get_type_code(vnx::Hash64(0x394eb3e7b2a1858aull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_erase_return = vnx::get_type_code(vnx::Hash64(0x6d35ffd2f5f0f53bull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_get_dependency = vnx::get_type_code(vnx::Hash64(0x3f4d36be6b85f1afull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_get_dependency_return = vnx::get_type_code(vnx::Hash64(0xb7daf726dd0fbd6ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_get_owner = vnx::get_type_code(vnx::Hash64(0xbd4c19a6e9ec8450ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_get_owner_return = vnx::get_type_code(vnx::Hash64(0xaf4f9ca25f18d046ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_get_parties = vnx::get_type_code(vnx::Hash64(0x633cf0e3a55db82eull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_get_parties_return = vnx::get_type_code(vnx::Hash64(0x8e1dc882a556713bull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_is_valid = vnx::get_type_code(vnx::Hash64(0x1667f5f2183332b7ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_is_valid_return = vnx::get_type_code(vnx::Hash64(0xd431fc6f5b83f211ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_num_bytes = vnx::get_type_code(vnx::Hash64(0x773759a35294d1d5ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_num_bytes_return = vnx::get_type_code(vnx::Hash64(0x22af32e8224318ddull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_set = vnx::get_type_code(vnx::Hash64(0x589fb537505638dull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_set_return = vnx::get_type_code(vnx::Hash64(0xf10ac2f58267a4d0ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_transfer = vnx::get_type_code(vnx::Hash64(0x21d1e067ddeef15full));
const vnx::TypeCode* const vnx_native_type_code_DataObject_transfer_return = vnx::get_type_code(vnx::Hash64(0x90506a070875d683ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_validate = vnx::get_type_code(vnx::Hash64(0x37d86604125d8df2ull));
const vnx::TypeCode* const vnx_native_type_code_DataObject_validate_return = vnx::get_type_code(vnx::Hash64(0xc91440be977c63eaull));
const vnx::TypeCode* const vnx_native_type_code_Locked = vnx::get_type_code(vnx::Hash64(0xd0ff1b6e7bad1493ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_calc_cost = vnx::get_type_code(vnx::Hash64(0x4d220deaf420a61aull));
const vnx::TypeCode* const vnx_native_type_code_Locked_calc_cost_return = vnx::get_type_code(vnx::Hash64(0x4ef0016844aa601full));
const vnx::TypeCode* const vnx_native_type_code_Locked_calc_hash = vnx::get_type_code(vnx::Hash64(0x9d30c68c91b2d2e5ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_calc_hash_return = vnx::get_type_code(vnx::Hash64(0x35a65c64c2750d63ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_get_dependency = vnx::get_type_code(vnx::Hash64(0xf155dff11fe1aed3ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_get_dependency_return = vnx::get_type_code(vnx::Hash64(0xe918f484aa2ae261ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_get_owner = vnx::get_type_code(vnx::Hash64(0x70fdcfdff7248688ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_get_owner_return = vnx::get_type_code(vnx::Hash64(0x4d3bf1b4a1d98e97ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_get_parties = vnx::get_type_code(vnx::Hash64(0xb634d38d89230559ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_get_parties_return = vnx::get_type_code(vnx::Hash64(0x8a824e2ac3637512ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_is_spendable = vnx::get_type_code(vnx::Hash64(0xa904459ea0b4fdddull));
const vnx::TypeCode* const vnx_native_type_code_Locked_is_spendable_return = vnx::get_type_code(vnx::Hash64(0x19d6a2814597bd97ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_is_valid = vnx::get_type_code(vnx::Hash64(0x37ed54e91a14f1acull));
const vnx::TypeCode* const vnx_native_type_code_Locked_is_valid_return = vnx::get_type_code(vnx::Hash64(0xba9468890cf05961ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_validate = vnx::get_type_code(vnx::Hash64(0x1652c71f107a4ee9ull));
const vnx::TypeCode* const vnx_native_type_code_Locked_validate_return = vnx::get_type_code(vnx::Hash64(0xa7b1d458c00fc89aull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig = vnx::get_type_code(vnx::Hash64(0x7d674c5f7297dedull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_add_owner = vnx::get_type_code(vnx::Hash64(0xaa2e4c882b71dd83ull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_add_owner_return = vnx::get_type_code(vnx::Hash64(0xff53ef68cb213c51ull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_calc_cost = vnx::get_type_code(vnx::Hash64(0x1f65ef156660d39full));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_calc_cost_return = vnx::get_type_code(vnx::Hash64(0x27d3b356beac0b61ull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_calc_hash = vnx::get_type_code(vnx::Hash64(0xcf77247303f2a760ull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_calc_hash_return = vnx::get_type_code(vnx::Hash64(0x5c85ee5a3873661dull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_get_parties = vnx::get_type_code(vnx::Hash64(0x99bf8748d9ab3076ull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_get_parties_return = vnx::get_type_code(vnx::Hash64(0x3c5857efd3a8b353ull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_is_valid = vnx::get_type_code(vnx::Hash64(0x613ac937350f5cd7ull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_is_valid_return = vnx::get_type_code(vnx::Hash64(0x2b104aee1e626c8cull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_rem_owner = vnx::get_type_code(vnx::Hash64(0x76c14727e0beab3cull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_rem_owner_return = vnx::get_type_code(vnx::Hash64(0xfa7d0d0c0718b8b1ull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_validate = vnx::get_type_code(vnx::Hash64(0x40855ac13f61e392ull));
const vnx::TypeCode* const vnx_native_type_code_MultiSig_validate_return = vnx::get_type_code(vnx::Hash64(0x3635f63fd29dfd77ull));
const vnx::TypeCode* const vnx_native_type_code_NFT = vnx::get_type_code(vnx::Hash64(0x7cb24b9888a47906ull));
const vnx::TypeCode* const vnx_native_type_code_NFT_calc_cost = vnx::get_type_code(vnx::Hash64(0x462462234574232ull));
const vnx::TypeCode* const vnx_native_type_code_NFT_calc_cost_return = vnx::get_type_code(vnx::Hash64(0xcbb78b8c7318ffecull));
const vnx::TypeCode* const vnx_native_type_code_NFT_calc_hash = vnx::get_type_code(vnx::Hash64(0xd4708d4451c536cdull));
const vnx::TypeCode* const vnx_native_type_code_NFT_calc_hash_return = vnx::get_type_code(vnx::Hash64(0xb0e1d680f5c79290ull));
const vnx::TypeCode* const vnx_native_type_code_NFT_is_valid = vnx::get_type_code(vnx::Hash64(0xfc70fda3036d3a08ull));
const vnx::TypeCode* const vnx_native_type_code_NFT_is_valid_return = vnx::get_type_code(vnx::Hash64(0x744c9a1ab5d94c5bull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT = vnx::get_type_code(vnx::Hash64(0x7705f4da286543dull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_calc_cost = vnx::get_type_code(vnx::Hash64(0xb8ed405cc3b49949ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_calc_cost_return = vnx::get_type_code(vnx::Hash64(0x20fc6d7eb7db96b1ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_calc_hash = vnx::get_type_code(vnx::Hash64(0x68ff8b3aa626edb6ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_calc_hash_return = vnx::get_type_code(vnx::Hash64(0x5baa30723104fbcdull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_get_dependency = vnx::get_type_code(vnx::Hash64(0x82d6a03bbbfb4e99ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_get_dependency_return = vnx::get_type_code(vnx::Hash64(0x1051c88efeeb565eull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_get_owner = vnx::get_type_code(vnx::Hash64(0x85328269c0b0b9dbull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_get_owner_return = vnx::get_type_code(vnx::Hash64(0x23379da252a87839ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_get_parties = vnx::get_type_code(vnx::Hash64(0xa72de574ea419e96ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_get_parties_return = vnx::get_type_code(vnx::Hash64(0x865e4b38cdd0c616ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_is_valid = vnx::get_type_code(vnx::Hash64(0xee4e1a5d6185e72bull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_is_valid_return = vnx::get_type_code(vnx::Hash64(0xdd7471627ac9d81dull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_lock_target = vnx::get_type_code(vnx::Hash64(0xce98b5ca521ecf16ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_lock_target_return = vnx::get_type_code(vnx::Hash64(0x8cffbca2d246eec1ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_unlock = vnx::get_type_code(vnx::Hash64(0xa0b90b41dbf800f0ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_unlock_return = vnx::get_type_code(vnx::Hash64(0xd82126adce18ab73ull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_validate = vnx::get_type_code(vnx::Hash64(0xcff189ab6beb586eull));
const vnx::TypeCode* const vnx_native_type_code_PlotNFT_validate_return = vnx::get_type_code(vnx::Hash64(0xc051cdb3b63649e6ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey = vnx::get_type_code(vnx::Hash64(0x9b3cd508d7f41423ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_calc_cost = vnx::get_type_code(vnx::Hash64(0x502d1edce44719b3ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_calc_cost_return = vnx::get_type_code(vnx::Hash64(0xc2f589dac0e8bcb0ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_calc_hash = vnx::get_type_code(vnx::Hash64(0x803fd5ba81d56d4cull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_calc_hash_return = vnx::get_type_code(vnx::Hash64(0xb9a3d4d64637d1ccull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_get_dependency = vnx::get_type_code(vnx::Hash64(0x5eddf8d7882958f5ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_get_dependency_return = vnx::get_type_code(vnx::Hash64(0x3870c96738844d0full));
const vnx::TypeCode* const vnx_native_type_code_PubKey_get_owner = vnx::get_type_code(vnx::Hash64(0x6df2dce9e7433921ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_get_owner_return = vnx::get_type_code(vnx::Hash64(0xc13e7906259b5238ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_get_parties = vnx::get_type_code(vnx::Hash64(0xa6978635d6f6f845ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_get_parties_return = vnx::get_type_code(vnx::Hash64(0x2aa5238d809c9087ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_is_valid = vnx::get_type_code(vnx::Hash64(0xe97fdd91c060e967ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_is_valid_return = vnx::get_type_code(vnx::Hash64(0xce58570ddfcea36dull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_validate = vnx::get_type_code(vnx::Hash64(0xc8c04e67ca0e5622ull));
const vnx::TypeCode* const vnx_native_type_code_PubKey_validate_return = vnx::get_type_code(vnx::Hash64(0xd37debdc13313296ull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock = vnx::get_type_code(vnx::Hash64(0xf33097b29a62c755ull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_calc_cost = vnx::get_type_code(vnx::Hash64(0xef887e5b77e465b5ull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_calc_cost_return = vnx::get_type_code(vnx::Hash64(0xe3703fa5e9b25e67ull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_calc_hash = vnx::get_type_code(vnx::Hash64(0x3f9ab53d1276114aull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_calc_hash_return = vnx::get_type_code(vnx::Hash64(0x982662a96f6d331bull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_get_dependency = vnx::get_type_code(vnx::Hash64(0xc83c186ef34eeb1bull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_get_dependency_return = vnx::get_type_code(vnx::Hash64(0xd13f6ea487c656bbull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_get_parties = vnx::get_type_code(vnx::Hash64(0xa0530fd9cb9a9c62ull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_get_parties_return = vnx::get_type_code(vnx::Hash64(0x85242cc27c6f3c52ull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_is_valid = vnx::get_type_code(vnx::Hash64(0xf4969d5cbc33744eull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_is_valid_return = vnx::get_type_code(vnx::Hash64(0xe0d6fa185046c2a1ull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_validate = vnx::get_type_code(vnx::Hash64(0xd5290eaab65dcb0bull));
const vnx::TypeCode* const vnx_native_type_code_PuzzleLock_validate_return = vnx::get_type_code(vnx::Hash64(0xfdf346c99cb9535aull));
const vnx::TypeCode* const vnx_native_type_code_Staking = vnx::get_type_code(vnx::Hash64(0xf058a3326fc2e7dcull));
const vnx::TypeCode* const vnx_native_type_code_Staking_calc_cost = vnx::get_type_code(vnx::Hash64(0x2f4c65f2e7467929ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_calc_cost_return = vnx::get_type_code(vnx::Hash64(0x59e400e91ac41189ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_calc_hash = vnx::get_type_code(vnx::Hash64(0xff5eae9482d40dd6ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_calc_hash_return = vnx::get_type_code(vnx::Hash64(0x22b25de59c1b7cf5ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_get_dependency = vnx::get_type_code(vnx::Hash64(0x69fc4777b2a7af06ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_get_dependency_return = vnx::get_type_code(vnx::Hash64(0x78150da57ad63d50ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_get_owner = vnx::get_type_code(vnx::Hash64(0x1293a7c7e44259bbull));
const vnx::TypeCode* const vnx_native_type_code_Staking_get_owner_return = vnx::get_type_code(vnx::Hash64(0x5a2ff035ffb7ff01ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_get_parties = vnx::get_type_code(vnx::Hash64(0x30595432b3360eb1ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_get_parties_return = vnx::get_type_code(vnx::Hash64(0x3a66d52454096f9ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_is_valid = vnx::get_type_code(vnx::Hash64(0xa4cc3abf037419f8ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_is_valid_return = vnx::get_type_code(vnx::Hash64(0xa2b3934c1b02f096ull));
const vnx::TypeCode* const vnx_native_type_code_Staking_validate = vnx::get_type_code(vnx::Hash64(0x8573a949091aa6bdull));
const vnx::TypeCode* const vnx_native_type_code_Staking_validate_return = vnx::get_type_code(vnx::Hash64(0xbf962f9dd7fd616dull));
const vnx::TypeCode* const vnx_native_type_code_Token = vnx::get_type_code(vnx::Hash64(0x2d8835d6429431b2ull));
const vnx::TypeCode* const vnx_native_type_code_Token_calc_cost = vnx::get_type_code(vnx::Hash64(0xbf384ca6ba587f13ull));
const vnx::TypeCode* const vnx_native_type_code_Token_calc_cost_return = vnx::get_type_code(vnx::Hash64(0x7837720d0f1ee972ull));
const vnx::TypeCode* const vnx_native_type_code_Token_calc_hash = vnx::get_type_code(vnx::Hash64(0x6f2a87c0dfca0becull));
const vnx::TypeCode* const vnx_native_type_code_Token_calc_hash_return = vnx::get_type_code(vnx::Hash64(0x3612f0189c1840eull));
const vnx::TypeCode* const vnx_native_type_code_Token_get_dependency = vnx::get_type_code(vnx::Hash64(0xd6b8b4d0f1a86d08ull));
const vnx::TypeCode* const vnx_native_type_code_Token_get_dependency_return = vnx::get_type_code(vnx::Hash64(0x210a40139084cf5full));
const vnx::TypeCode* const vnx_native_type_code_Token_get_owner = vnx::get_type_code(vnx::Hash64(0x82e78e93b95c5f81ull));
const vnx::TypeCode* const vnx_native_type_code_Token_get_owner_return = vnx::get_type_code(vnx::Hash64(0x7bfc82d1ea6d07faull));
const vnx::TypeCode* const vnx_native_type_code_Token_get_parties = vnx::get_type_code(vnx::Hash64(0x6631733b12e41c68ull));
const vnx::TypeCode* const vnx_native_type_code_Token_get_parties_return = vnx::get_type_code(vnx::Hash64(0x434ef119eecba212ull));
const vnx::TypeCode* const vnx_native_type_code_Token_is_valid = vnx::get_type_code(vnx::Hash64(0xe2f8f3a19e55d9baull));
const vnx::TypeCode* const vnx_native_type_code_Token_is_valid_return = vnx::get_type_code(vnx::Hash64(0xdaf9a5651490bd5aull));
const vnx::TypeCode* const vnx_native_type_code_Token_set_stake_factor = vnx::get_type_code(vnx::Hash64(0xe72a46777bb7e2a3ull));
const vnx::TypeCode* const vnx_native_type_code_Token_set_stake_factor_return = vnx::get_type_code(vnx::Hash64(0xe34256657a02f975ull));
const vnx::TypeCode* const vnx_native_type_code_Token_set_time_factor = vnx::get_type_code(vnx::Hash64(0x33d338ac43ee93e3ull));
const vnx::TypeCode* const vnx_native_type_code_Token_set_time_factor_return = vnx::get_type_code(vnx::Hash64(0x7801743424347b91ull));
const vnx::TypeCode* const vnx_native_type_code_Token_transfer = vnx::get_type_code(vnx::Hash64(0xd54ee6345b881a52ull));
const vnx::TypeCode* const vnx_native_type_code_Token_transfer_return = vnx::get_type_code(vnx::Hash64(0x9e98330d476699c8ull));
const vnx::TypeCode* const vnx_native_type_code_Token_validate = vnx::get_type_code(vnx::Hash64(0xc3476057943b66ffull));
const vnx::TypeCode* const vnx_native_type_code_Token_validate_return = vnx::get_type_code(vnx::Hash64(0xc7dc19b4d86f2ca1ull));
const vnx::TypeCode* const vnx_native_type_code_VoteSheet = vnx::get_type_code(vnx::Hash64(0xdaac9a8f3f87ad6aull));
const vnx::TypeCode* const vnx_native_type_code_VoteSheet_is_valid = vnx::get_type_code(vnx::Hash64(0x8ce2f9bd972e3147ull));
const vnx::TypeCode* const vnx_native_type_code_VoteSheet_is_valid_return = vnx::get_type_code(vnx::Hash64(0xf5a70ae8dfe86db2ull));
const vnx::TypeCode* const vnx_native_type_code_WebData = vnx::get_type_code(vnx::Hash64(0xf7c226b211c088c4ull));
const vnx::TypeCode* const vnx_native_type_code_WebData_calc_cost = vnx::get_type_code(vnx::Hash64(0x3bbbd77da38a1013ull));
const vnx::TypeCode* const vnx_native_type_code_WebData_calc_cost_return = vnx::get_type_code(vnx::Hash64(0x83c6569262ee4aa5ull));
const vnx::TypeCode* const vnx_native_type_code_WebData_calc_hash = vnx::get_type_code(vnx::Hash64(0xeba91c1bc61864ecull));
const vnx::TypeCode* const vnx_native_type_code_WebData_calc_hash_return = vnx::get_type_code(vnx::Hash64(0xf8900b9ee43127d9ull));
const vnx::TypeCode* const vnx_native_type_code_WebData_is_valid = vnx::get_type_code(vnx::Hash64(0x7ae99137e8822105ull));
const vnx::TypeCode* const vnx_native_type_code_WebData_is_valid_return = vnx::get_type_code(vnx::Hash64(0x1c9f4aaa82fff87aull));
} // namespace mmx
} // namespace contract
|
; A173196: Partial sums of A002620.
; 0,0,1,3,7,13,22,34,50,70,95,125,161,203,252,308,372,444,525,615,715,825,946,1078,1222,1378,1547,1729,1925,2135,2360,2600,2856,3128,3417,3723,4047,4389,4750,5130,5530,5950,6391,6853,7337,7843,8372,8924,9500,10100,10725,11375,12051,12753,13482,14238,15022,15834,16675,17545,18445,19375,20336,21328,22352,23408,24497,25619,26775,27965,29190,30450,31746,33078,34447,35853,37297,38779,40300,41860,43460,45100,46781,48503,50267,52073,53922,55814,57750,59730,61755,63825,65941,68103,70312,72568,74872,77224
mov $1,$0
add $0,2
add $0,$1
bin $0,2
sub $0,3
mul $0,$1
div $0,24
|
; A083345: Numerator of r(n) = Sum(e/p: n=Product(p^e)).
; Submitted by Jamie Morken(s2)
; 0,1,1,1,1,5,1,3,2,7,1,4,1,9,8,2,1,7,1,6,10,13,1,11,2,15,1,8,1,31,1,5,14,19,12,5,1,21,16,17,1,41,1,12,13,25,1,7,2,9,20,14,1,3,16,23,22,31,1,23,1,33,17,3,18,61,1,18,26,59,1,13,1,39,11,20,18,71,1,11,4,43,1,31,22,45,32,35,1,41,20,24,34,49,24,17,1,11,25,7
add $0,1
mov $1,$0
seq $1,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
gcd $0,$1
div $1,$0
mov $0,$1
|
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x7808, %r13
nop
nop
nop
xor %rbx, %rbx
movw $0x6162, (%r13)
nop
nop
nop
cmp %r13, %r13
lea addresses_D_ht+0x1a238, %rsi
lea addresses_D_ht+0x1b278, %rdi
nop
add %r9, %r9
mov $49, %rcx
rep movsq
dec %rbx
lea addresses_A_ht+0x1498, %rdi
sub %r9, %r9
movw $0x6162, (%rdi)
nop
nop
add %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rax
push %rdi
push %rsi
// Faulty Load
lea addresses_UC+0x6c38, %r9
nop
nop
nop
nop
xor %rdi, %rdi
mov (%r9), %r10
lea oracles, %rax
and $0xff, %r10
shlq $12, %r10
mov (%rax,%r10,1), %r10
pop %rsi
pop %rdi
pop %rax
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_UC', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'37': 21829}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
|
or r12, [rsp+0x1e08] |
; A011001: Binomial coefficient C(n,48).
; 1,49,1225,20825,270725,2869685,25827165,202927725,1420494075,8996462475,52179482355,279871768995,1399358844975,6566222272575,29078984349975,122131734269895,488526937079580,1867897112363100,6848956078664700,24151581961607100,82115378669464140,269807672771096460,858478958817125100,2650087220696342700,7950261662089028100,23214764053299962052,66072789997853738148,183535527771815939300,498167861094928978100,1322721562217570045300,3439076061765682117780,8764097060628673784020,21910242651571684460050
add $0,48
bin $0,48
|
db DEX_WOOPER ; pokedex id
db 55 ; base hp
db 45 ; base attack
db 45 ; base defense
db 15 ; base speed
db 25 ; base special
db WATER ; species type 1
db GROUND ; species type 2
db 190 ; catch rate
db 210 ; base exp yield
INCBIN "pic/ymon/wooper.pic",0,1 ; 77, sprite dimensions
dw WooperPicFront
dw WooperPicBack
; attacks known at lvl 0
db BUBBLE
db LEER
db 0
db 0
db 3 ; growth rate
; learnset
tmlearn 1,5,6,8
tmlearn 9,10,11,12,13,14,15
tmlearn 17,18,19,20
tmlearn 26,27,28,31,32
tmlearn 33,34,40
tmlearn 44
tmlearn 50,53,54
db BANK(WooperPicFront)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.